diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2013-01-29 18:33:15 -0500 |
---|---|---|
committer | Ben Hutchings <bhutchings@solarflare.com> | 2013-03-07 15:22:09 -0500 |
commit | b184f16b7feb9ede7d658ee6f2c77434d580d764 (patch) | |
tree | 1880814cb198d48664bfda545e7aa6df86fcd995 /drivers/net/ethernet/sfc | |
parent | ff734ef4bca05fd5cd51b83d2e2a9f008b64f9a3 (diff) |
sfc: Replace efx_rx_buf_eh() with simpler efx_rx_buf_va()
efx_rx_buf_va() returns the virtual address of the current start of
the buffer. The callers must add the hash prefix size themselves.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Diffstat (limited to 'drivers/net/ethernet/sfc')
-rw-r--r-- | drivers/net/ethernet/sfc/rx.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/ethernet/sfc/rx.c b/drivers/net/ethernet/sfc/rx.c index 60f4eb7cebc6..23d67d1f136f 100644 --- a/drivers/net/ethernet/sfc/rx.c +++ b/drivers/net/ethernet/sfc/rx.c | |||
@@ -54,9 +54,9 @@ static inline unsigned int efx_rx_buf_offset(struct efx_nic *efx, | |||
54 | return buf->page_offset + efx->type->rx_buffer_hash_size; | 54 | return buf->page_offset + efx->type->rx_buffer_hash_size; |
55 | } | 55 | } |
56 | 56 | ||
57 | static u8 *efx_rx_buf_eh(struct efx_nic *efx, struct efx_rx_buffer *buf) | 57 | static inline u8 *efx_rx_buf_va(struct efx_rx_buffer *buf) |
58 | { | 58 | { |
59 | return page_address(buf->page) + efx_rx_buf_offset(efx, buf); | 59 | return page_address(buf->page) + buf->page_offset; |
60 | } | 60 | } |
61 | 61 | ||
62 | static inline u32 efx_rx_buf_hash(const u8 *eh) | 62 | static inline u32 efx_rx_buf_hash(const u8 *eh) |
@@ -458,7 +458,7 @@ void efx_rx_packet(struct efx_rx_queue *rx_queue, unsigned int index, | |||
458 | /* Prefetch nice and early so data will (hopefully) be in cache by | 458 | /* Prefetch nice and early so data will (hopefully) be in cache by |
459 | * the time we look at it. | 459 | * the time we look at it. |
460 | */ | 460 | */ |
461 | prefetch(efx_rx_buf_eh(efx, rx_buf)); | 461 | prefetch(efx_rx_buf_va(rx_buf) + efx->type->rx_buffer_hash_size); |
462 | 462 | ||
463 | /* Pipeline receives so that we give time for packet headers to be | 463 | /* Pipeline receives so that we give time for packet headers to be |
464 | * prefetched into cache. | 464 | * prefetched into cache. |
@@ -497,7 +497,7 @@ static void efx_rx_deliver(struct efx_channel *channel, u8 *eh, | |||
497 | void __efx_rx_packet(struct efx_channel *channel, struct efx_rx_buffer *rx_buf) | 497 | void __efx_rx_packet(struct efx_channel *channel, struct efx_rx_buffer *rx_buf) |
498 | { | 498 | { |
499 | struct efx_nic *efx = channel->efx; | 499 | struct efx_nic *efx = channel->efx; |
500 | u8 *eh = efx_rx_buf_eh(efx, rx_buf); | 500 | u8 *eh = efx_rx_buf_va(rx_buf) + efx->type->rx_buffer_hash_size; |
501 | 501 | ||
502 | /* If we're in loopback test, then pass the packet directly to the | 502 | /* If we're in loopback test, then pass the packet directly to the |
503 | * loopback layer, and free the rx_buf here | 503 | * loopback layer, and free the rx_buf here |