]> git.baikalelectronics.ru Git - kernel.git/commit
sfc: Allow shared pages to be recycled
authorSteve Hodgson <shodgson@solarflare.com>
Tue, 1 Jun 2010 11:20:53 +0000 (11:20 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 2 Jun 2010 09:21:10 +0000 (02:21 -0700)
commita4eec30f67f40823c9229d7f91e0e8349bad8fd6
tree8b1108981cac25a732fed7e488d5a6004e49015e
parentaaca300b30c33beb123265e76e825b23a5b0b4b0
sfc: Allow shared pages to be recycled

Insert a structure at the start of the shared page that
tracks the dma mapping refcnt. DMA into the next cache
line of the (shared) page (plus EFX_PAGE_IP_ALIGN).

When recycling a page, check the page refcnt. If the
page is otherwise unused, then resurrect the other
receive buffer that previously referenced the page.
Be careful not to overflow the receive ring, since we
can now resurrect n receive buffers in a row.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/sfc/efx.c
drivers/net/sfc/net_driver.h
drivers/net/sfc/rx.c