Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 289813
b: refs/heads/master
c: 1ddceb4
h: refs/heads/master
i:
  289811: 69122be
v: v3
  • Loading branch information
Ben Hutchings committed Jan 27, 2012
1 parent fe6dab8 commit 339a1b4
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 19 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: f9c762500ae77ab8940094be1325c8a2a1c8e5f5
refs/heads/master: 1ddceb4c69463e09b6929c750046c59589d45d82
41 changes: 23 additions & 18 deletions trunk/drivers/net/ethernet/sfc/rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -568,12 +568,30 @@ void efx_rx_packet(struct efx_rx_queue *rx_queue, unsigned int index,
channel->rx_pkt_csummed = checksummed;
}

static void efx_rx_deliver(struct efx_channel *channel,
struct efx_rx_buffer *rx_buf)
{
struct sk_buff *skb;

/* We now own the SKB */
skb = rx_buf->u.skb;
rx_buf->u.skb = NULL;

/* Set the SKB flags */
skb_checksum_none_assert(skb);

/* Pass the packet up */
netif_receive_skb(skb);

/* Update allocation strategy method */
channel->rx_alloc_level += RX_ALLOC_FACTOR_SKB;
}

/* Handle a received packet. Second half: Touches packet payload. */
void __efx_rx_packet(struct efx_channel *channel,
struct efx_rx_buffer *rx_buf, bool checksummed)
{
struct efx_nic *efx = channel->efx;
struct sk_buff *skb;
u8 *eh = efx_rx_buf_eh(efx, rx_buf);

/* If we're in loopback test, then pass the packet directly to the
Expand All @@ -586,7 +604,7 @@ void __efx_rx_packet(struct efx_channel *channel,
}

if (!rx_buf->is_page) {
skb = rx_buf->u.skb;
struct sk_buff *skb = rx_buf->u.skb;

prefetch(skb_shinfo(skb));

Expand All @@ -606,23 +624,10 @@ void __efx_rx_packet(struct efx_channel *channel,
if (unlikely(!(efx->net_dev->features & NETIF_F_RXCSUM)))
checksummed = false;

if (likely(checksummed || rx_buf->is_page)) {
if (likely(checksummed || rx_buf->is_page))
efx_rx_packet_gro(channel, rx_buf, eh, checksummed);
return;
}

/* We now own the SKB */
skb = rx_buf->u.skb;
rx_buf->u.skb = NULL;

/* Set the SKB flags */
skb_checksum_none_assert(skb);

/* Pass the packet up */
netif_receive_skb(skb);

/* Update allocation strategy method */
channel->rx_alloc_level += RX_ALLOC_FACTOR_SKB;
else
efx_rx_deliver(channel, rx_buf);
}

void efx_rx_strategy(struct efx_channel *channel)
Expand Down

0 comments on commit 339a1b4

Please sign in to comment.