diff options
author | Edward Cree | 2020-08-14 13:26:22 +0100 |
---|---|---|
committer | David S. Miller | 2020-08-14 14:07:16 -0700 |
commit | 068885434ccb20542e0d759aebbefe7a6724d85f (patch) | |
tree | 0b09ac803886c4b0af1e13ab88bacfd83570a668 /drivers/net/ethernet/sfc/efx.h | |
parent | e591d298cc7b9e2d82e701ab3fdfe7c97b692994 (diff) |
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/efx.h')
-rw-r--r-- | drivers/net/ethernet/sfc/efx.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/net/ethernet/sfc/efx.h b/drivers/net/ethernet/sfc/efx.h index a9808e86068d..daf0c00c1242 100644 --- a/drivers/net/ethernet/sfc/efx.h +++ b/drivers/net/ethernet/sfc/efx.h @@ -45,6 +45,14 @@ static inline void efx_rx_flush_packet(struct efx_channel *channel) __ef100_rx_packet, __efx_rx_packet, channel); } +static inline bool efx_rx_buf_hash_valid(struct efx_nic *efx, const u8 *prefix) +{ + if (efx->type->rx_buf_hash_valid) + return INDIRECT_CALL_1(efx->type->rx_buf_hash_valid, + ef100_rx_buf_hash_valid, + prefix); + return true; +} /* Maximum number of TCP segments we support for soft-TSO */ #define EFX_TSO_MAX_SEGS 100 |