aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesper Dangaard Brouer <brouer@redhat.com>2017-05-22 14:13:07 -0400
committerDavid S. Miller <davem@davemloft.net>2017-05-23 11:03:31 -0400
commit12e8b570e732eaa5eae3a2895ba3fbcf91bde2b4 (patch)
tree2f34453038bbccd9cea3cb0bce8ec21ce655d43d
parent7f65b1f5adc5f8496ca8bec4947de66fefe36220 (diff)
mlx5: fix bug reading rss_hash_type from CQE
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>
-rw-r--r--include/linux/mlx5/device.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/linux/mlx5/device.h b/include/linux/mlx5/device.h
index dd9a263ed368..a940ec6a046c 100644
--- a/include/linux/mlx5/device.h
+++ b/include/linux/mlx5/device.h
@@ -787,8 +787,14 @@ enum {
787}; 787};
788 788
789enum { 789enum {
790 CQE_RSS_HTYPE_IP = 0x3 << 6, 790 CQE_RSS_HTYPE_IP = 0x3 << 2,
791 CQE_RSS_HTYPE_L4 = 0x3 << 2, 791 /* cqe->rss_hash_type[3:2] - IP destination selected for hash
792 * (00 = none, 01 = IPv4, 10 = IPv6, 11 = Reserved)
793 */
794 CQE_RSS_HTYPE_L4 = 0x3 << 6,
795 /* cqe->rss_hash_type[7:6] - L4 destination selected for hash
796 * (00 = none, 01 = TCP. 10 = UDP, 11 = IPSEC.SPI
797 */
792}; 798};
793 799
794enum { 800enum {