diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2012-01-23 17:41:30 -0500 |
---|---|---|
committer | Ben Hutchings <bhutchings@solarflare.com> | 2012-01-26 19:11:00 -0500 |
commit | 1ddceb4c69463e09b6929c750046c59589d45d82 (patch) | |
tree | a0feef7e3364ee2b077f39a96d657865a8649b8e | |
parent | f9c762500ae77ab8940094be1325c8a2a1c8e5f5 (diff) |
sfc: Move the end of the non-GRO RX path into its own function
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
-rw-r--r-- | drivers/net/ethernet/sfc/rx.c | 41 |
1 files changed, 23 insertions, 18 deletions
diff --git a/drivers/net/ethernet/sfc/rx.c b/drivers/net/ethernet/sfc/rx.c index 3572c34a79fb..d97c6ebcf06d 100644 --- a/drivers/net/ethernet/sfc/rx.c +++ b/drivers/net/ethernet/sfc/rx.c | |||
@@ -568,12 +568,30 @@ out: | |||
568 | channel->rx_pkt_csummed = checksummed; | 568 | channel->rx_pkt_csummed = checksummed; |
569 | } | 569 | } |
570 | 570 | ||
571 | static void efx_rx_deliver(struct efx_channel *channel, | ||
572 | struct efx_rx_buffer *rx_buf) | ||
573 | { | ||
574 | struct sk_buff *skb; | ||
575 | |||
576 | /* We now own the SKB */ | ||
577 | skb = rx_buf->u.skb; | ||
578 | rx_buf->u.skb = NULL; | ||
579 | |||
580 | /* Set the SKB flags */ | ||
581 | skb_checksum_none_assert(skb); | ||
582 | |||
583 | /* Pass the packet up */ | ||
584 | netif_receive_skb(skb); | ||
585 | |||
586 | /* Update allocation strategy method */ | ||
587 | channel->rx_alloc_level += RX_ALLOC_FACTOR_SKB; | ||
588 | } | ||
589 | |||
571 | /* Handle a received packet. Second half: Touches packet payload. */ | 590 | /* Handle a received packet. Second half: Touches packet payload. */ |
572 | void __efx_rx_packet(struct efx_channel *channel, | 591 | void __efx_rx_packet(struct efx_channel *channel, |
573 | struct efx_rx_buffer *rx_buf, bool checksummed) | 592 | struct efx_rx_buffer *rx_buf, bool checksummed) |
574 | { | 593 | { |
575 | struct efx_nic *efx = channel->efx; | 594 | struct efx_nic *efx = channel->efx; |
576 | struct sk_buff *skb; | ||
577 | u8 *eh = efx_rx_buf_eh(efx, rx_buf); | 595 | u8 *eh = efx_rx_buf_eh(efx, rx_buf); |
578 | 596 | ||
579 | /* If we're in loopback test, then pass the packet directly to the | 597 | /* If we're in loopback test, then pass the packet directly to the |
@@ -586,7 +604,7 @@ void __efx_rx_packet(struct efx_channel *channel, | |||
586 | } | 604 | } |
587 | 605 | ||
588 | if (!rx_buf->is_page) { | 606 | if (!rx_buf->is_page) { |
589 | skb = rx_buf->u.skb; | 607 | struct sk_buff *skb = rx_buf->u.skb; |
590 | 608 | ||
591 | prefetch(skb_shinfo(skb)); | 609 | prefetch(skb_shinfo(skb)); |
592 | 610 | ||
@@ -606,23 +624,10 @@ void __efx_rx_packet(struct efx_channel *channel, | |||
606 | if (unlikely(!(efx->net_dev->features & NETIF_F_RXCSUM))) | 624 | if (unlikely(!(efx->net_dev->features & NETIF_F_RXCSUM))) |
607 | checksummed = false; | 625 | checksummed = false; |
608 | 626 | ||
609 | if (likely(checksummed || rx_buf->is_page)) { | 627 | if (likely(checksummed || rx_buf->is_page)) |
610 | efx_rx_packet_gro(channel, rx_buf, eh, checksummed); | 628 | efx_rx_packet_gro(channel, rx_buf, eh, checksummed); |
611 | return; | 629 | else |
612 | } | 630 | efx_rx_deliver(channel, rx_buf); |
613 | |||
614 | /* We now own the SKB */ | ||
615 | skb = rx_buf->u.skb; | ||
616 | rx_buf->u.skb = NULL; | ||
617 | |||
618 | /* Set the SKB flags */ | ||
619 | skb_checksum_none_assert(skb); | ||
620 | |||
621 | /* Pass the packet up */ | ||
622 | netif_receive_skb(skb); | ||
623 | |||
624 | /* Update allocation strategy method */ | ||
625 | channel->rx_alloc_level += RX_ALLOC_FACTOR_SKB; | ||
626 | } | 631 | } |
627 | 632 | ||
628 | void efx_rx_strategy(struct efx_channel *channel) | 633 | void efx_rx_strategy(struct efx_channel *channel) |