From: Stephen Hemminger <shemminger@vyatta.com>
To: Jeff Garzik <jgarzik@pobox.com>,
Andy@mail.vyatta.com, "Fleming <afleming"@freescale.com,
Becky Bruce <bgill@freescale.com>,
Kumar Gala <galak@kernel.crashing.org>
Cc: netdev@vger.kernel.org
Subject: gianfar: rx buffer management
Date: Wed, 16 Apr 2008 15:10:58 -0700 [thread overview]
Message-ID: <20080416151058.26ceaf42@extreme> (raw)
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.
reply other threads:[~2008-04-16 22:11 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080416151058.26ceaf42@extreme \
--to=shemminger@vyatta.com \
--cc="Fleming <afleming"@freescale.com \
--cc=Andy@mail.vyatta.com \
--cc=bgill@freescale.com \
--cc=galak@kernel.crashing.org \
--cc=jgarzik@pobox.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).