mlx5: fix bug reading rss_hash_type from CQE
authorJesper Dangaard Brouer <brouer@redhat.com>
Mon, 22 May 2017 18:13:07 +0000 (20:13 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 13 Apr 2018 17:50:10 +0000 (19:50 +0200)
commitb23f1c33a2082b1e54fe6b2d0189c1afd2c9875f
tree72eb90b8acd79fdc9faefcc802830d307bdb27ec
parentddec2acd13e4a32109bddcd5fa41a98ddeb3fe3d
mlx5: fix bug reading rss_hash_type from CQE

[ Upstream commit 12e8b570e732eaa5eae3a2895ba3fbcf91bde2b4 ]

Masks for extracting part of the Completion Queue Entry (CQE)
field rss_hash_type was swapped, namely CQE_RSS_HTYPE_IP and
CQE_RSS_HTYPE_L4.

The bug resulted in setting skb->l4_hash, even-though the
rss_hash_type indicated that hash was NOT computed over the
L4 (UDP or TCP) part of the packet.

Added comments from the datasheet, to make it more clear what
these masks are selecting.

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Acked-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/mlx5/device.h