From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1F23C43835 for ; Tue, 5 Mar 2024 16:36:33 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D399442E6E; Tue, 5 Mar 2024 16:36:28 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 65C8142E51 for ; Tue, 5 Mar 2024 16:36:27 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1709652987; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/7pL0gCJRVIpyfb4peRSacQlV87ht7zDI00wzWQKSpY=; b=MjaZzckfJAVu5fmJhxCizctWttTD497USzqLSq/65KadKSfctTsD+82w1hqfy+2GCzRi81 Ilqi0IPRtrfkvd8Uzo2ipv9dAvqJImgr+DwQ28q6o4oZ15UI4lhbqhjIs+e3dPF9SrG5/N trzIj6uqQ/fX9leRELJCapBxdQOIQdM= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-296-V3qDoKaOMqGej06SkaV0vA-1; Tue, 05 Mar 2024 10:36:21 -0500 X-MC-Unique: V3qDoKaOMqGej06SkaV0vA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5E8A43C02543; Tue, 5 Mar 2024 15:36:21 +0000 (UTC) Received: from rh.redhat.com (unknown [10.39.194.197]) by smtp.corp.redhat.com (Postfix) with ESMTP id BA39A2022EDB; Tue, 5 Mar 2024 15:36:20 +0000 (UTC) From: Kevin Traynor To: Michael Baum Cc: Suanming Mou , dpdk stable Subject: patch 'common/mlx5: fix duplicate read of general capabilities' has been queued to stable release 21.11.7 Date: Tue, 5 Mar 2024 15:34:41 +0000 Message-ID: <20240305153449.263666-68-ktraynor@redhat.com> In-Reply-To: <20240305153449.263666-1-ktraynor@redhat.com> References: <20240305153449.263666-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 21.11.7 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/11/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/kevintraynor/dpdk-stable This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable/commit/83738589f715441c8d9673b1ce41f01aa814d6dc Thanks. Kevin --- >From 83738589f715441c8d9673b1ce41f01aa814d6dc Mon Sep 17 00:00:00 2001 From: Michael Baum 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 Acked-by: Suanming Mou --- 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 70a430f134..d9585bf3a9 100644 --- a/drivers/common/mlx5/mlx5_devx_cmds.c +++ b/drivers/common/mlx5/mlx5_devx_cmds.c @@ -869,16 +869,4 @@ mlx5_devx_cmd_query_hca_attr(void *ctx, 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); @@ -904,4 +892,7 @@ mlx5_devx_cmd_query_hca_attr(void *ctx, 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); @@ -966,6 +957,5 @@ mlx5_devx_cmd_query_hca_attr(void *ctx, if (attr->crypto) attr->aes_xts = MLX5_GET(cmd_hca_cap, hcattr, aes_xts); - 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); -- 2.43.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-03-05 14:08:56.271626890 +0000 +++ 0068-common-mlx5-fix-duplicate-read-of-general-capabiliti.patch 2024-03-05 14:08:54.753521038 +0000 @@ -1 +1 @@ -From e8ffd7c26637b9119694368f16d2eb1341767fc6 Mon Sep 17 00:00:00 2001 +From 83738589f715441c8d9673b1ce41f01aa814d6dc Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit e8ffd7c26637b9119694368f16d2eb1341767fc6 ] + @@ -21 +22,0 @@ -Cc: stable@dpdk.org @@ -30 +31 @@ -index 3a894f894a..faa38a9f95 100644 +index 70a430f134..d9585bf3a9 100644 @@ -33 +34 @@ -@@ -967,16 +967,4 @@ mlx5_devx_cmd_query_hca_attr(void *ctx, +@@ -869,16 +869,4 @@ mlx5_devx_cmd_query_hca_attr(void *ctx, @@ -50 +51 @@ -@@ -1002,4 +990,7 @@ mlx5_devx_cmd_query_hca_attr(void *ctx, +@@ -904,4 +892,7 @@ mlx5_devx_cmd_query_hca_attr(void *ctx, @@ -58,3 +59,3 @@ -@@ -1075,6 +1066,5 @@ mlx5_devx_cmd_query_hca_attr(void *ctx, - attr->wait_on_time = MLX5_GET(cmd_hca_cap, hcattr, wait_on_time); - attr->crypto = MLX5_GET(cmd_hca_cap, hcattr, crypto); +@@ -966,6 +957,5 @@ mlx5_devx_cmd_query_hca_attr(void *ctx, + if (attr->crypto) + attr->aes_xts = MLX5_GET(cmd_hca_cap, hcattr, aes_xts);