Skip to content

Commit 12e8b57

Browse files
netoptimizerdavem330
authored andcommitted
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 <[email protected]> Acked-by: Saeed Mahameed <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 7f65b1f commit 12e8b57

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

include/linux/mlx5/device.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -787,8 +787,14 @@ enum {
787787
};
788788

789789
enum {
790-
CQE_RSS_HTYPE_IP = 0x3 << 6,
791-
CQE_RSS_HTYPE_L4 = 0x3 << 2,
790+
CQE_RSS_HTYPE_IP = 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+
*/
792798
};
793799

794800
enum {

0 commit comments

Comments
 (0)