From: Stephen Hemminger <shemminger@vyatta.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Ming Lei <tom.leiming@gmail.com>,
Oliver Neukum <oliver@neukum.org>, <netdev@vger.kernel.org>,
<linux-usb@vger.kernel.org>
Subject: Re: future developments of usbnet
Date: Mon, 9 May 2011 08:46:49 -0700 [thread overview]
Message-ID: <20110509084649.127ec0da@nehalam> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1105091130440.2002-100000@iolanthe.rowland.org>
On Mon, 9 May 2011 11:31:16 -0400 (EDT)
Alan Stern <stern@rowland.harvard.edu> wrote:
> On Mon, 9 May 2011, Ming Lei wrote:
>
> > Hi,
> >
> > 2011/5/9 Oliver Neukum <oliver@neukum.org>:
> >
> > > Do we really need to avoid it, or do we just need to recover?
> > > If avoidance is needed, should we use NAPI?
> >
> > IMO, OOM can recover it certainly but with much cost, so we should
> > avoid the case. I don't think NAPI can avoid it, because NAPI will
> > cause skb to be allocated without any limit if there are packets
> > coming, still no chance left for usbnet_bh to handle and free these
> > SKBs.
>
> How do other network drivers handle this problem? Can the same
> strategy be used?
>
> Alan Stern
Most Ethernet drivers have a fixed size receive ring and pass preallocated
memory (skb's or pages) for the hardware to fill in. When NAPI poll is run
it refills the ring and passes the data up to netif_receive_skb. NAPI allows
the poll routine to process a limited number of packets (weight) and after
that the poll loop exits and gets rerun by soft interrupt. If data is
arriving faster than the kernel can process, eventually the receive ring
passed to hardware gets exhausted and the hardware drops packets.
There is no explicit memory bound limit, instead the flow control happens
when the receive ring gets full.
next prev parent reply other threads:[~2011-05-09 15:46 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-06 18:45 future developments of usbnet Oliver Neukum
[not found] ` <201105062045.37336.oliver-GvhC2dPhHPQdnm+yROfE0A@public.gmane.org>
2011-05-09 3:26 ` Ming Lei
2011-05-09 8:42 ` Oliver Neukum
[not found] ` <201105091042.01014.oliver-GvhC2dPhHPQdnm+yROfE0A@public.gmane.org>
2011-05-09 15:22 ` Ming Lei
2011-05-09 15:31 ` Alan Stern
2011-05-09 15:46 ` Stephen Hemminger [this message]
2011-05-11 17:37 ` Oliver Neukum
[not found] ` <201105111937.47448.oliver-GvhC2dPhHPQdnm+yROfE0A@public.gmane.org>
2011-05-11 17:47 ` David Miller
2011-05-12 7:59 ` Oliver Neukum
[not found] ` <201105120959.28473.oliver-GvhC2dPhHPQdnm+yROfE0A@public.gmane.org>
2011-05-12 14:37 ` Alan Stern
2011-05-14 10:01 ` Oliver Neukum
[not found] ` <201105141201.40265.oliver-GvhC2dPhHPQdnm+yROfE0A@public.gmane.org>
2011-05-14 10:46 ` Michał Mirosław
2011-05-12 17:46 ` David Miller
2011-05-10 9:42 ` Richard Cochran
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=20110509084649.127ec0da@nehalam \
--to=shemminger@vyatta.com \
--cc=linux-usb@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=oliver@neukum.org \
--cc=stern@rowland.harvard.edu \
--cc=tom.leiming@gmail.com \
/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).