Re: [PATCH 2.6.35-rc1] net-next: vmxnet3 fixes [1/5] Spare skb toavoid starvation

From: David Miller
Date: Thu Jul 15 2010 - 21:39:07 EST


From: Shreyas Bhatewara <sbhatewara@xxxxxxxxxx>
Date: Thu, 15 Jul 2010 18:19:39 -0700 (PDT)

>
> Reposting this patch with struct vmxnet3_cmd_ring *ring made const
> according to Stephen's feedback.

Please address my feedback, which is that this is not the way to
handle this problem.

You can prevent all forms of starvation, without hacky spare-skbs or
things like that, by trying to allocate the replacement SKB _before_
sending the packet up to the stack.

If the replacement SKB allocation fails, you do not give the packet to
the network stack. Instead, you give it back to the card's RX ring.

See drivers/net/tg3.c, drivers/net/niu.c, etc. for examples of this.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/