From 186798270acb7e7c4159af982bb3f3dd5d9f50d0 Mon Sep 17 00:00:00 2001 From: Jieqiang Wang Date: Mon, 19 Sep 2022 23:33:21 +0800 Subject: rdma: set correct CQE flags CQE flags located in bits 16-31 at offset 0x1c should be defined as actual numbers instead of indexes. Besides, L3 header type for IPv4 is 10(2 in decimal) and for IPv6 is 01(1 in decimal) according to CQE entry fields description of page 120 in Mellanox Programmer Reference Manual. (https://network.nvidia.com/files/doc-2020/ethernet-adapters-programming-manual.pdf) Fixing this issue will lead to correct CQE flags printing for rdma-input node when buffer trace is enabled. Type: fix Signed-off-by: Jieqiang Wang Change-Id: I9b578ca5cbd8cd93a577aa83131e31c79f60430e --- src/plugins/rdma/rdma_mlx5dv.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/rdma/rdma_mlx5dv.h b/src/plugins/rdma/rdma_mlx5dv.h index efcefe7fbf7..bf01a3a37d6 100644 --- a/src/plugins/rdma/rdma_mlx5dv.h +++ b/src/plugins/rdma/rdma_mlx5dv.h @@ -24,16 +24,16 @@ #include #include /* CQE flags - bits 16-31 of qword at offset 0x1c */ -#define CQE_FLAG_L4_OK 10 -#define CQE_FLAG_L3_OK 9 -#define CQE_FLAG_L2_OK 8 -#define CQE_FLAG_IP_FRAG 7 +#define CQE_FLAG_L4_OK (1 << 10) +#define CQE_FLAG_L3_OK (1 << 9) +#define CQE_FLAG_L2_OK (1 << 8) +#define CQE_FLAG_IP_FRAG (1 << 7) #define CQE_FLAG_L4_HDR_TYPE(f) (((f) >> 4) & 7) #define CQE_FLAG_L3_HDR_TYPE_SHIFT (2) #define CQE_FLAG_L3_HDR_TYPE_MASK (3 << CQE_FLAG_L3_HDR_TYPE_SHIFT) #define CQE_FLAG_L3_HDR_TYPE(f) (((f) & CQE_FLAG_L3_HDR_TYPE_MASK) >> CQE_FLAG_L3_HDR_TYPE_SHIFT) -#define CQE_FLAG_L3_HDR_TYPE_IP4 1 -#define CQE_FLAG_L3_HDR_TYPE_IP6 2 +#define CQE_FLAG_L3_HDR_TYPE_IP4 2 +#define CQE_FLAG_L3_HDR_TYPE_IP6 1 #define CQE_FLAG_IP_EXT_OPTS 1 /* CQE byte count (Striding RQ) */ -- cgit 1.2.3-korg