Re: [PATCH] e1000 rx buffer allocation

From: Chris Leech
Date: Fri Aug 27 2004 - 13:41:30 EST


On Thu, 26 Aug 2004 18:18:43 -0700, David S. Miller <davem@xxxxxxxxxx> wrote:
> On Thu, 26 Aug 2004 17:35:38 -0600 (MDT)
> shane@xxxxxxxxxxxxxxx wrote:
>
> > Independently of my patch, I'm a little concerned about what will happen
> > if the driver runs out of rx buffers. Ideally, it will just drop packets,
> > but I wonder if the code will panic instead.
>
> It is a good question. Some chips are known to hang when
> the rx buffer has no entries in it and a packet arrives.

The e1000 driver and PRO/1000 hardware don't have a problem with that,
other than dropping packets until receive buffers become available.
Packets that make it into the receive FIFO, but then stall because
there are no buffers available, cause the "receive no buffers" counter
to increment and sit in the FIFO until a buffer is available. Packets
that are received once the FIFO is full cause the "missed packet"
counter to increment and are dropped.

As for moving the allocations out of the hard interrupt context, e1000
was one of several drivers that tried that a few years back by using
tasklets. What I found is that if you split the allocation from the
receive processing, it's far to easy to generate an interrupt load
which starves the skb allocations. The result is that you
continuously use all of the buffers then stall while they all get
replaced, and performance is horrible. But if the patch works for
your network load ...

A better approach for improving jumbo frame allocations might be to
use multiple smaller buffers for each receive, something the PRO/1000
hardware can do but the e1000 driver has never taken advantage of.

Dave, you mentioned the possibility of drivers doing that in a
conversation with Harald about handling fragmented packets
(http://marc.theaimsgroup.com/?l=linux-netdev&m=109293677816177&w=2)
What would be the more correct approach to this? Putting all receive
data into page allocations and filling out the frags array, or
chaining together small skbs using the frag_list?

- Chris
-
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/