patch 'common/mlx5: fix duplicate read of general capabilities' has been queued to stable release 23.11.1

Xueming Li xuemingl at nvidia.com
Tue Mar 5 10:47:50 CET 2024


Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=10061b4047bb006039807526ffec813ae5ead193

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 10061b4047bb006039807526ffec813ae5ead193 Mon Sep 17 00:00:00 2001
From: Michael Baum <michaelba at nvidia.com>
Date: Thu, 25 Jan 2024 15:30:21 +0200
Subject: [PATCH] common/mlx5: fix duplicate read of general capabilities
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit e8ffd7c26637b9119694368f16d2eb1341767fc6 ]

General object types support is indicated in bitmap general_obj_types,
which is part of HCA capabilities list.
This bitmap was read multiple times, and each time a different bit was
extracted.

Previous patch optimized the code, reading the bitmap once into a local
variable, and then extracting the required bits.
However, it missed few of them which still read the bitmap for
themselves. In addition, for other readings, it moved them to use local
variable without removing the old reading, and they are read twice.

This patch moves them all to use the local variable and removes all
duplications.

Fixes: 876d4702b141 ("common/mlx5: optimize read of general capabilities")

Signed-off-by: Michael Baum <michaelba at nvidia.com>
Acked-by: Suanming Mou <suanmingm at nvidia.com>
---
 drivers/common/mlx5/mlx5_devx_cmds.c | 18 ++++--------------
 1 file changed, 4 insertions(+), 14 deletions(-)

diff --git a/drivers/common/mlx5/mlx5_devx_cmds.c b/drivers/common/mlx5/mlx5_devx_cmds.c
index 4d8818924a..41f6e0a727 100644
--- a/drivers/common/mlx5/mlx5_devx_cmds.c
+++ b/drivers/common/mlx5/mlx5_devx_cmds.c
@@ -966,18 +966,6 @@ mlx5_devx_cmd_query_hca_attr(void *ctx,
 	attr->max_geneve_tlv_option_data_len = MLX5_GET(cmd_hca_cap, hcattr,
 			max_geneve_tlv_option_data_len);
 	attr->qos.sup = MLX5_GET(cmd_hca_cap, hcattr, qos);
-	attr->qos.flow_meter_aso_sup = !!(MLX5_GET64(cmd_hca_cap, hcattr,
-					 general_obj_types) &
-			      MLX5_GENERAL_OBJ_TYPES_CAP_FLOW_METER_ASO);
-	attr->vdpa.valid = !!(MLX5_GET64(cmd_hca_cap, hcattr,
-					 general_obj_types) &
-			      MLX5_GENERAL_OBJ_TYPES_CAP_VIRTQ_NET_Q);
-	attr->vdpa.queue_counters_valid = !!(MLX5_GET64(cmd_hca_cap, hcattr,
-							general_obj_types) &
-				  MLX5_GENERAL_OBJ_TYPES_CAP_VIRTIO_Q_COUNTERS);
-	attr->parse_graph_flex_node = !!(MLX5_GET64(cmd_hca_cap, hcattr,
-					 general_obj_types) &
-			      MLX5_GENERAL_OBJ_TYPES_CAP_PARSE_GRAPH_FLEX_NODE);
 	attr->wqe_index_ignore = MLX5_GET(cmd_hca_cap, hcattr,
 					  wqe_index_ignore_cap);
 	attr->cross_channel = MLX5_GET(cmd_hca_cap, hcattr, cd);
@@ -1001,6 +989,9 @@ mlx5_devx_cmd_query_hca_attr(void *ctx,
 	/* Read the general_obj_types bitmap and extract the relevant bits. */
 	general_obj_types_supported = MLX5_GET64(cmd_hca_cap, hcattr,
 						 general_obj_types);
+	attr->qos.flow_meter_aso_sup =
+			!!(general_obj_types_supported &
+			   MLX5_GENERAL_OBJ_TYPES_CAP_FLOW_METER_ASO);
 	attr->vdpa.valid = !!(general_obj_types_supported &
 			      MLX5_GENERAL_OBJ_TYPES_CAP_VIRTQ_NET_Q);
 	attr->vdpa.queue_counters_valid =
@@ -1074,8 +1065,7 @@ mlx5_devx_cmd_query_hca_attr(void *ctx,
 		MLX5_GET(cmd_hca_cap, hcattr, umr_modify_entity_size_disabled);
 	attr->wait_on_time = MLX5_GET(cmd_hca_cap, hcattr, wait_on_time);
 	attr->crypto = MLX5_GET(cmd_hca_cap, hcattr, crypto);
-	attr->ct_offload = !!(MLX5_GET64(cmd_hca_cap, hcattr,
-					 general_obj_types) &
+	attr->ct_offload = !!(general_obj_types_supported &
 			      MLX5_GENERAL_OBJ_TYPES_CAP_CONN_TRACK_OFFLOAD);
 	attr->rq_delay_drop = MLX5_GET(cmd_hca_cap, hcattr, rq_delay_drop);
 	attr->nic_flow_table = MLX5_GET(cmd_hca_cap, hcattr, nic_flow_table);
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:34.852426329 +0800
+++ 0129-common-mlx5-fix-duplicate-read-of-general-capabiliti.patch	2024-03-05 17:39:31.043566502 +0800
@@ -1 +1 @@
-From e8ffd7c26637b9119694368f16d2eb1341767fc6 Mon Sep 17 00:00:00 2001
+From 10061b4047bb006039807526ffec813ae5ead193 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit e8ffd7c26637b9119694368f16d2eb1341767fc6 ]
@@ -21 +23,0 @@
-Cc: stable at dpdk.org
@@ -30 +32 @@
-index 3a894f894a..faa38a9f95 100644
+index 4d8818924a..41f6e0a727 100644


More information about the stable mailing list