aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sfc/rx.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/sfc/rx.c')
-rw-r--r--drivers/net/sfc/rx.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/net/sfc/rx.c b/drivers/net/sfc/rx.c
index 0fb98355a092..799c461ce7b8 100644
--- a/drivers/net/sfc/rx.c
+++ b/drivers/net/sfc/rx.c
@@ -104,9 +104,9 @@ static inline unsigned int efx_rx_buf_size(struct efx_nic *efx)
104static inline u32 efx_rx_buf_hash(struct efx_rx_buffer *buf) 104static inline u32 efx_rx_buf_hash(struct efx_rx_buffer *buf)
105{ 105{
106#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) || NET_IP_ALIGN % 4 == 0 106#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) || NET_IP_ALIGN % 4 == 0
107 return __le32_to_cpup((const __le32 *)buf->data); 107 return __le32_to_cpup((const __le32 *)(buf->data - 4));
108#else 108#else
109 const u8 *data = (const u8 *)buf->data; 109 const u8 *data = (const u8 *)(buf->data - 4);
110 return ((u32)data[0] | 110 return ((u32)data[0] |
111 (u32)data[1] << 8 | 111 (u32)data[1] << 8 |
112 (u32)data[2] << 16 | 112 (u32)data[2] << 16 |
@@ -469,8 +469,6 @@ static void efx_rx_packet_lro(struct efx_channel *channel,
469 469
470 if (efx->net_dev->features & NETIF_F_RXHASH) 470 if (efx->net_dev->features & NETIF_F_RXHASH)
471 skb->rxhash = efx_rx_buf_hash(rx_buf); 471 skb->rxhash = efx_rx_buf_hash(rx_buf);
472 rx_buf->data += efx->type->rx_buffer_hash_size;
473 rx_buf->len -= efx->type->rx_buffer_hash_size;
474 472
475 skb_shinfo(skb)->frags[0].page = page; 473 skb_shinfo(skb)->frags[0].page = page;
476 skb_shinfo(skb)->frags[0].page_offset = 474 skb_shinfo(skb)->frags[0].page_offset =
@@ -577,6 +575,9 @@ void __efx_rx_packet(struct efx_channel *channel,
577 struct efx_nic *efx = channel->efx; 575 struct efx_nic *efx = channel->efx;
578 struct sk_buff *skb; 576 struct sk_buff *skb;
579 577
578 rx_buf->data += efx->type->rx_buffer_hash_size;
579 rx_buf->len -= efx->type->rx_buffer_hash_size;
580
580 /* If we're in loopback test, then pass the packet directly to the 581 /* If we're in loopback test, then pass the packet directly to the
581 * loopback layer, and free the rx_buf here 582 * loopback layer, and free the rx_buf here
582 */ 583 */
@@ -589,11 +590,11 @@ void __efx_rx_packet(struct efx_channel *channel,
589 if (rx_buf->skb) { 590 if (rx_buf->skb) {
590 prefetch(skb_shinfo(rx_buf->skb)); 591 prefetch(skb_shinfo(rx_buf->skb));
591 592
593 skb_reserve(rx_buf->skb, efx->type->rx_buffer_hash_size);
592 skb_put(rx_buf->skb, rx_buf->len); 594 skb_put(rx_buf->skb, rx_buf->len);
593 595
594 if (efx->net_dev->features & NETIF_F_RXHASH) 596 if (efx->net_dev->features & NETIF_F_RXHASH)
595 rx_buf->skb->rxhash = efx_rx_buf_hash(rx_buf); 597 rx_buf->skb->rxhash = efx_rx_buf_hash(rx_buf);
596 skb_pull(rx_buf->skb, efx->type->rx_buffer_hash_size);
597 598
598 /* Move past the ethernet header. rx_buf->data still points 599 /* Move past the ethernet header. rx_buf->data still points
599 * at the ethernet header */ 600 * at the ethernet header */