sfc: Do not pass non-TCP packets into GRO code
authorBen Hutchings <bhutchings@solarflare.com>
Thu, 16 May 2013 17:38:13 +0000 (18:38 +0100)
committerBen Hutchings <bhutchings@solarflare.com>
Mon, 24 Jun 2013 19:00:32 +0000 (20:00 +0100)
GRO can handle non-TCP packets and pass them up without coalescing,
but it has to do some extra work to parse the packet which we can
bypass using the hardware parse result.  (This condition yields a
false negative for TCP/IPv6 packets received by Falcon, but its
performance is already poor in that case due to lack of checksum
offload.)

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
drivers/net/ethernet/sfc/rx.c

index 6efff3d030b692ab26c1c4dd36cd8075946cf1e2..5c45118cc03a4957a1a70b1d4816e5cf8aa3ff2f 100644 (file)
@@ -629,7 +629,7 @@ void __efx_rx_packet(struct efx_channel *channel)
        if (unlikely(!(efx->net_dev->features & NETIF_F_RXCSUM)))
                rx_buf->flags &= ~EFX_RX_PKT_CSUMMED;
 
-       if (!channel->type->receive_skb)
+       if ((rx_buf->flags & EFX_RX_PKT_TCP) && !channel->type->receive_skb)
                efx_rx_packet_gro(channel, rx_buf, channel->rx_pkt_n_frags, eh);
        else
                efx_rx_deliver(channel, eh, rx_buf, channel->rx_pkt_n_frags);