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

luca.boccassi at gmail.com luca.boccassi at gmail.com
Thu Mar 7 02:31:54 CET 2024


Hi,

FYI, your patch has been queued to stable release 22.11.5

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/09/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://github.com/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/77d9b5e6d694a461fc200b5fe1dbf73464418c7c

Thanks.

Luca Boccassi

---
>From 77d9b5e6d694a461fc200b5fe1dbf73464418c7c 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

[ 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 9fdca2fecc..c570323fa8 100644
--- a/drivers/common/mlx5/mlx5_devx_cmds.c
+++ b/drivers/common/mlx5/mlx5_devx_cmds.c
@@ -902,18 +902,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);
@@ -937,6 +925,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 =
@@ -998,8 +989,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.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-07 01:05:42.977792763 +0000
+++ 0097-common-mlx5-fix-duplicate-read-of-general-capabiliti.patch	2024-03-07 01:05:35.066945704 +0000
@@ -1 +1 @@
-From e8ffd7c26637b9119694368f16d2eb1341767fc6 Mon Sep 17 00:00:00 2001
+From 77d9b5e6d694a461fc200b5fe1dbf73464418c7c Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit e8ffd7c26637b9119694368f16d2eb1341767fc6 ]
+
@@ -21 +22,0 @@
-Cc: stable at dpdk.org
@@ -30 +31 @@
-index 3a894f894a..faa38a9f95 100644
+index 9fdca2fecc..c570323fa8 100644
@@ -33 +34 @@
-@@ -966,18 +966,6 @@ mlx5_devx_cmd_query_hca_attr(void *ctx,
+@@ -902,18 +902,6 @@ mlx5_devx_cmd_query_hca_attr(void *ctx,
@@ -52 +53 @@
-@@ -1001,6 +989,9 @@ mlx5_devx_cmd_query_hca_attr(void *ctx,
+@@ -937,6 +925,9 @@ mlx5_devx_cmd_query_hca_attr(void *ctx,
@@ -62 +63 @@
-@@ -1074,8 +1065,7 @@ mlx5_devx_cmd_query_hca_attr(void *ctx,
+@@ -998,8 +989,7 @@ mlx5_devx_cmd_query_hca_attr(void *ctx,


More information about the stable mailing list