aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sfc/efx.c
diff options
context:
space:
mode:
authorSteve Hodgson <shodgson@solarflare.com>2010-06-01 07:20:53 -0400
committerDavid S. Miller <davem@davemloft.net>2010-06-02 05:21:10 -0400
commit62b330baede3849897ce7fc5534eadc34cd03a51 (patch)
tree8b1108981cac25a732fed7e488d5a6004e49015e /drivers/net/sfc/efx.c
parent244558006cf02f0096fb247f3a54dc7e7d81a256 (diff)
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>
Diffstat (limited to 'drivers/net/sfc/efx.c')
-rw-r--r--drivers/net/sfc/efx.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/sfc/efx.c b/drivers/net/sfc/efx.c
index 5d9ef05e6abb..aae33471029a 100644
--- a/drivers/net/sfc/efx.c
+++ b/drivers/net/sfc/efx.c
@@ -469,7 +469,8 @@ static void efx_init_channels(struct efx_nic *efx)
469 efx->rx_buffer_len = (max(EFX_PAGE_IP_ALIGN, NET_IP_ALIGN) + 469 efx->rx_buffer_len = (max(EFX_PAGE_IP_ALIGN, NET_IP_ALIGN) +
470 EFX_MAX_FRAME_LEN(efx->net_dev->mtu) + 470 EFX_MAX_FRAME_LEN(efx->net_dev->mtu) +
471 efx->type->rx_buffer_padding); 471 efx->type->rx_buffer_padding);
472 efx->rx_buffer_order = get_order(efx->rx_buffer_len); 472 efx->rx_buffer_order = get_order(efx->rx_buffer_len +
473 sizeof(struct efx_rx_page_state));
473 474
474 /* Initialise the channels */ 475 /* Initialise the channels */
475 efx_for_each_channel(channel, efx) { 476 efx_for_each_channel(channel, efx) {