sfc: Recycle discarded rx buffers back onto the queue
authorSteve Hodgson <shodgson@solarflare.com>
Tue, 1 Jun 2010 11:20:34 +0000 (11:20 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 2 Jun 2010 09:21:09 +0000 (02:21 -0700)
commit244558006cf02f0096fb247f3a54dc7e7d81a256
treed56b996063fa685cdaf49720a9370910913db837
parentf7d6f379db61233a1740cb2c6818b9c97531771f
sfc: Recycle discarded rx buffers back onto the queue

The cut-through design of the receive path means that packets that
fail to match the appropriate MAC filter are not discarded at the MAC
but are flagged in the completion event as 'to be discarded'.  On
networks with heavy multicast traffic, this can account for a
significant proportion of received packets, so it is worthwhile to
recycle the buffer immediately in this case rather than freeing it
and then reallocating it shortly after.

The only complication here is dealing with a page shared
between two receive buffers. In that case, we need to be
careful to free the dma mapping when both buffers have
been free'd by the kernel. This means that we can only
recycle such a page if both receive buffers are discarded.
Unfortunately, in an environment with 1500mtu,
rx_alloc_method=PAGE, and a mixture of discarded and
not-discarded frames hitting the same receive queue,
buffer recycling won't always be possible.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/sfc/rx.c
This page took 0.069516 seconds and 5 git commands to generate.