summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/sfc/rx_common.c
diff options
context:
space:
mode:
authorEdward Cree <ecree@solarflare.com>2020-08-14 13:26:22 +0100
committerDavid S. Miller <davem@davemloft.net>2020-08-14 14:07:16 -0700
commit068885434ccb20542e0d759aebbefe7a6724d85f (patch)
tree0b09ac803886c4b0af1e13ab88bacfd83570a668 /drivers/net/ethernet/sfc/rx_common.c
parente591d298cc7b9e2d82e701ab3fdfe7c97b692994 (diff)
downloadlinux-068885434ccb20542e0d759aebbefe7a6724d85f.tar.bz2
sfc: check hash is valid before using it
On EF100, the RX hash field in the packet prefix may not be valid (e.g. if the header parse failed), and this is indicated by a one-bit flag elsewhere in the packet prefix. Only call skb_set_hash() if the RSS_HASH_VALID bit is set. Signed-off-by: Edward Cree <ecree@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/sfc/rx_common.c')
-rw-r--r--drivers/net/ethernet/sfc/rx_common.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ethernet/sfc/rx_common.c b/drivers/net/ethernet/sfc/rx_common.c
index fb77c7bbe4af..ef9bca92b0b7 100644
--- a/drivers/net/ethernet/sfc/rx_common.c
+++ b/drivers/net/ethernet/sfc/rx_common.c
@@ -525,7 +525,8 @@ efx_rx_packet_gro(struct efx_channel *channel, struct efx_rx_buffer *rx_buf,
return;
}
- if (efx->net_dev->features & NETIF_F_RXHASH)
+ if (efx->net_dev->features & NETIF_F_RXHASH &&
+ efx_rx_buf_hash_valid(efx, eh))
skb_set_hash(skb, efx_rx_buf_hash(efx, eh),
PKT_HASH_TYPE_L3);
if (csum) {