Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 203172
b: refs/heads/master
c: 604f604
h: refs/heads/master
v: v3
  • Loading branch information
Ben Hutchings authored and David S. Miller committed Jun 26, 2010
1 parent a56ac95 commit 6a64314
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 29046f9b1e36f6e3332ce2d8e366005fd177b37a
refs/heads/master: 604f6049ba2af86fe361d4cc320443d35b232df1
11 changes: 6 additions & 5 deletions trunk/drivers/net/sfc/rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ static inline unsigned int efx_rx_buf_size(struct efx_nic *efx)
static inline u32 efx_rx_buf_hash(struct efx_rx_buffer *buf)
{
#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) || NET_IP_ALIGN % 4 == 0
return __le32_to_cpup((const __le32 *)buf->data);
return __le32_to_cpup((const __le32 *)(buf->data - 4));
#else
const u8 *data = (const u8 *)buf->data;
const u8 *data = (const u8 *)(buf->data - 4);
return ((u32)data[0] |
(u32)data[1] << 8 |
(u32)data[2] << 16 |
Expand Down Expand Up @@ -469,8 +469,6 @@ static void efx_rx_packet_lro(struct efx_channel *channel,

if (efx->net_dev->features & NETIF_F_RXHASH)
skb->rxhash = efx_rx_buf_hash(rx_buf);
rx_buf->data += efx->type->rx_buffer_hash_size;
rx_buf->len -= efx->type->rx_buffer_hash_size;

skb_shinfo(skb)->frags[0].page = page;
skb_shinfo(skb)->frags[0].page_offset =
Expand Down Expand Up @@ -577,6 +575,9 @@ void __efx_rx_packet(struct efx_channel *channel,
struct efx_nic *efx = channel->efx;
struct sk_buff *skb;

rx_buf->data += efx->type->rx_buffer_hash_size;
rx_buf->len -= efx->type->rx_buffer_hash_size;

/* If we're in loopback test, then pass the packet directly to the
* loopback layer, and free the rx_buf here
*/
Expand All @@ -589,11 +590,11 @@ void __efx_rx_packet(struct efx_channel *channel,
if (rx_buf->skb) {
prefetch(skb_shinfo(rx_buf->skb));

skb_reserve(rx_buf->skb, efx->type->rx_buffer_hash_size);
skb_put(rx_buf->skb, rx_buf->len);

if (efx->net_dev->features & NETIF_F_RXHASH)
rx_buf->skb->rxhash = efx_rx_buf_hash(rx_buf);
skb_pull(rx_buf->skb, efx->type->rx_buffer_hash_size);

/* Move past the ethernet header. rx_buf->data still points
* at the ethernet header */
Expand Down
3 changes: 0 additions & 3 deletions trunk/drivers/net/sfc/selftest.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,6 @@ void efx_loopback_rx_packet(struct efx_nic *efx,

payload = &state->payload;

buf_ptr += efx->type->rx_buffer_hash_size;
pkt_len -= efx->type->rx_buffer_hash_size;

received = (struct efx_loopback_payload *) buf_ptr;
received->ip.saddr = payload->ip.saddr;
if (state->offload_csum)
Expand Down

0 comments on commit 6a64314

Please sign in to comment.