netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* gianfar: rx buffer management
@ 2008-04-16 22:10 Stephen Hemminger
  0 siblings, 0 replies; only message in thread
From: Stephen Hemminger @ 2008-04-16 22:10 UTC (permalink / raw)
  To: Jeff Garzik, Andy, "Fleming <afleming", Becky Bruce,
	Kumar Gala
  Cc: netdev

I was looking at all drivers to update them to use netdev_alloc_skb
and noticed this turd in the gianfar.c driver:

struct sk_buff * gfar_new_skb(struct net_device *dev, struct rxbd8 *bdp)
{
	unsigned int alignamount;
	struct gfar_private *priv = netdev_priv(dev);
	struct sk_buff *skb = NULL;
	unsigned int timeout = SKB_ALLOC_TIMEOUT;

	/* We have to allocate the skb, so keep trying till we succeed */
	while ((!skb) && timeout--)
		skb = dev_alloc_skb(priv->rx_buffer_size + RXBUF_ALIGNMENT);


Trying a million times in softirq is not going to work. Please change to use
a more sane strategy. Probably the simples would be to allocate a new skb
before processing the current buffer and if that fails, just drop the current
rx packet and reuse the skb.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-04-16 22:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-16 22:10 gianfar: rx buffer management Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).