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 8C2F043C60 for ; Thu, 7 Mar 2024 02:37:47 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7886642F2F; Thu, 7 Mar 2024 02:37:47 +0100 (CET) Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) by mails.dpdk.org (Postfix) with ESMTP id 32FF142F0D for ; Thu, 7 Mar 2024 02:37:46 +0100 (CET) Received: by mail-wr1-f47.google.com with SMTP id ffacd0b85a97d-33dcd8dec88so152231f8f.1 for ; Wed, 06 Mar 2024 17:37:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709775466; x=1710380266; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4gPs/kFmTwwfCGGjaLHmrl/EtBk+EKUCCcBDXseZCos=; b=PlOYg/D51oVm1lsqlaeZWJFqjsxujhGOttGgPYHDkGX5RFdZcVTQcIrvainPW8wOj5 W778lJyCJwglIRrBuYraVi/O8S3kNtUf4i0LmBp+Kn/+qol0wCCCMY7KNRYCRKczhA54 qVKxBkUuTuKW/Xoq6r7O8M/yz7JlMisgGfsnsZVSpR7AnX/TNCAi9eST4Tt8qOrfkLCC BeQbQvihbCj6xOTCUTyzD0oy5oncZz+ftqAG3PcPn7uh7WfruaCtqMcfiyyg60SFC34l kfgvqqauxfhX8GB47FpNoiClFjSz+XQZH3jDbJ17EXU+mHxfjRlpjwMwMsAZBL4tysS4 FnOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709775466; x=1710380266; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4gPs/kFmTwwfCGGjaLHmrl/EtBk+EKUCCcBDXseZCos=; b=BKCLlIDqWoJI3QcEKF8DKydM1I6KiGuW5dZW6RHEHyd2eI8EeidiEgzC4zjDTaAUnG 6iPVM1F5EaPNy4UwDJW02Vnq9zuc4kXe251iSDviz8w/hheL6KHi7Y6EJw71Y9FUYLmy l9KV+O+Jn+gLKYhS4lD2wUy3zAnHg0/5z22oZqar9ZYevPycSjKXu/HnxNTwb6ejFiFe 1IVvSgyI9zjOhzyG/7C9TiLLWCstXbZ9tHftU0uZkZvuHxLkxjh9bSIKAJI7xgqBaG2a UtSeExj3XY2y5md4bPWHzgdgbUiOy5no3u/KQijzAG5eYMO5Lj7OhsauMkP8xuVEBPjO IaVA== X-Forwarded-Encrypted: i=1; AJvYcCWUPTjFWaJx+LjHGHuzyljaREiBPtr/TCOUhlLbcV7MHAf4B8Uhu8o5wHFU4ALdxnnGXoTI2IQNkzVM41q3ONA= X-Gm-Message-State: AOJu0Yxu3WbFOgHW4w8I03cXRFXvaz5nQmunMOkmvwZ6iP4TKofeT2qF Yt/RR+JA6Qo8HT21XfP97gvnvx4pQ/vRABE5lSWsa/wJwJjjH4mK1mNPEDNcnwk= X-Google-Smtp-Source: AGHT+IFS6rDMgsLNVR9S1WiM/VYrVqdVAdATpflw7CWSGj1qhr0f2l0QvtqfYRzk0vPJM4x5phDUjA== X-Received: by 2002:a05:6000:2c5:b0:33d:14a7:c4b with SMTP id o5-20020a05600002c500b0033d14a70c4bmr14918460wry.40.1709775465780; Wed, 06 Mar 2024 17:37:45 -0800 (PST) Received: from localhost ([2a01:4b00:d036:ae00:7aef:1aaa:3dff:d546]) by smtp.gmail.com with ESMTPSA id az7-20020adfe187000000b0033e433cb471sm3042758wrb.79.2024.03.06.17.37.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Mar 2024 17:37:45 -0800 (PST) From: luca.boccassi@gmail.com To: Michael Baum Cc: Suanming Mou , dpdk stable Subject: patch 'common/mlx5: fix duplicate read of general capabilities' has been queued to stable release 22.11.5 Date: Thu, 7 Mar 2024 01:31:54 +0000 Message-Id: <20240307013159.1735343-97-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240307013159.1735343-1-luca.boccassi@gmail.com> References: <20240307013159.1735343-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 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 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 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@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,