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 4E835A034E for ; Mon, 21 Feb 2022 16:37:54 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4A3F240E5A; Mon, 21 Feb 2022 16:37:54 +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 605DD410F7 for ; Mon, 21 Feb 2022 16:37:52 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645457871; 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=KBzjoKbkeXHdi/mmsLxai5bUiH1jmAxA3OqAwhWaJ/A=; b=igEzzwzeOCKedkGMQh9K5X3nJJVgTqsgonGyxkUs6NGeHqEePA0F2WMle5JOpUW39cj64F cyBSMoFgXyBIN/HPTj4cGMe1ZeBr8k3lkHRASmcWIrrhDs3S0bkAzAgkc1kU5QRJ8N+rir mOmt+O5SgmDRWG3kq+7l3LD7zq4/3Qw= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-462-TSgiAV6SMEKSGTbdbRny6w-1; Mon, 21 Feb 2022 10:37:48 -0500 X-MC-Unique: TSgiAV6SMEKSGTbdbRny6w-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C666E1091DA0; Mon, 21 Feb 2022 15:37:47 +0000 (UTC) Received: from rh.Home (unknown [10.39.195.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8A81B7E131; Mon, 21 Feb 2022 15:37:46 +0000 (UTC) From: Kevin Traynor To: Michael Baum Cc: Matan Azrad , dpdk stable Subject: patch 'common/mlx5: add minimum WQE size for striding RQ' has been queued to stable release 21.11.1 Date: Mon, 21 Feb 2022 15:33:39 +0000 Message-Id: <20220221153625.152324-30-ktraynor@redhat.com> In-Reply-To: <20220221153625.152324-1-ktraynor@redhat.com> References: <20220221153625.152324-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ktraynor@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" 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.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 02/26/22. 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/f873364dfe365f912edf67764fbe3f8473804761 Thanks. Kevin --- >From f873364dfe365f912edf67764fbe3f8473804761 Mon Sep 17 00:00:00 2001 From: Michael Baum Date: Tue, 23 Nov 2021 20:38:03 +0200 Subject: [PATCH] common/mlx5: add minimum WQE size for striding RQ [ upstream commit 10599cf83ebe768fe5ebe3e430c2a3c4250aafca ] Some devices have a WQE size limit for striding RQ. On some newer devices, this limitation is smaller and information on its size is provided by the firmware. This patch adds the attribute query from firmware: the minimum required size of WQE buffer for striding RQ in granularity of Bytes. Signed-off-by: Michael Baum Acked-by: Matan Azrad --- drivers/common/mlx5/mlx5_devx_cmds.c | 16 ++++++++++++++++ drivers/common/mlx5/mlx5_devx_cmds.h | 1 + drivers/common/mlx5/mlx5_prm.h | 11 +++++++++-- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/drivers/common/mlx5/mlx5_devx_cmds.c b/drivers/common/mlx5/mlx5_devx_cmds.c index 7cd3d4fa98..2e807a0829 100644 --- a/drivers/common/mlx5/mlx5_devx_cmds.c +++ b/drivers/common/mlx5/mlx5_devx_cmds.c @@ -824,4 +824,5 @@ mlx5_devx_cmd_query_hca_attr(void *ctx, uint32_t in[MLX5_ST_SZ_DW(query_hca_cap_in)] = {0}; uint32_t out[MLX5_ST_SZ_DW(query_hca_cap_out)] = {0}; + bool hca_cap_2_sup; uint64_t general_obj_types_supported = 0; void *hcattr; @@ -833,4 +834,5 @@ mlx5_devx_cmd_query_hca_attr(void *ctx, if (!hcattr) return rc; + hca_cap_2_sup = MLX5_GET(cmd_hca_cap, hcattr, hca_cap_2); attr->max_wqe_sz_sq = MLX5_GET(cmd_hca_cap, hcattr, max_wqe_sz_sq); attr->flow_counter_bulk_alloc_bitmap = @@ -968,4 +970,18 @@ mlx5_devx_cmd_query_hca_attr(void *ctx, MLX5_GENERAL_OBJ_TYPES_CAP_CONN_TRACK_OFFLOAD); attr->rq_delay_drop = MLX5_GET(cmd_hca_cap, hcattr, rq_delay_drop); + if (hca_cap_2_sup) { + hcattr = mlx5_devx_get_hca_cap(ctx, in, out, &rc, + MLX5_GET_HCA_CAP_OP_MOD_GENERAL_DEVICE_2 | + MLX5_HCA_CAP_OPMOD_GET_CUR); + if (!hcattr) { + DRV_LOG(DEBUG, + "Failed to query DevX HCA capabilities 2."); + return rc; + } + attr->log_min_stride_wqe_sz = MLX5_GET(cmd_hca_cap_2, hcattr, + log_min_stride_wqe_sz); + } + if (attr->log_min_stride_wqe_sz == 0) + attr->log_min_stride_wqe_sz = MLX5_MPRQ_LOG_MIN_STRIDE_WQE_SIZE; if (attr->qos.sup) { hcattr = mlx5_devx_get_hca_cap(ctx, in, out, &rc, diff --git a/drivers/common/mlx5/mlx5_devx_cmds.h b/drivers/common/mlx5/mlx5_devx_cmds.h index d7f71646a3..37821b493e 100644 --- a/drivers/common/mlx5/mlx5_devx_cmds.h +++ b/drivers/common/mlx5/mlx5_devx_cmds.h @@ -252,4 +252,5 @@ struct mlx5_hca_attr { uint32_t umr_modify_entity_size_disabled:1; uint32_t umr_indirect_mkey_disabled:1; + uint32_t log_min_stride_wqe_sz:5; uint16_t max_wqe_sz_sq; }; diff --git a/drivers/common/mlx5/mlx5_prm.h b/drivers/common/mlx5/mlx5_prm.h index 982a53ffbe..495b63191a 100644 --- a/drivers/common/mlx5/mlx5_prm.h +++ b/drivers/common/mlx5/mlx5_prm.h @@ -265,4 +265,7 @@ #define MLX5_MAX_LOG_RQ_SEGS 5u +/* Log 2 of the default size of a WQE for Multi-Packet RQ. */ +#define MLX5_MPRQ_LOG_MIN_STRIDE_WQE_SIZE 14U + /* The alignment needed for WQ buffer. */ #define MLX5_WQE_BUF_ALIGNMENT rte_mem_page_size() @@ -1343,5 +1346,7 @@ enum { struct mlx5_ifc_cmd_hca_cap_bits { - u8 reserved_at_0[0x30]; + u8 reserved_at_0[0x20]; + u8 hca_cap_2[0x1]; + u8 reserved_at_21[0xf]; u8 vhca_id[0x10]; u8 reserved_at_40[0x20]; @@ -1910,5 +1915,6 @@ struct mlx5_ifc_cmd_hca_cap_2_bits { u8 max_reformat_remove_size[0x8]; u8 max_reformat_remove_offset[0x8]; /* End of DW6. */ - u8 aso_conntrack_reg_id[0x8]; + u8 reserved_at_c0[0x3]; + u8 log_min_stride_wqe_sz[0x5]; u8 reserved_at_c8[0x3]; u8 log_conn_track_granularity[0x5]; @@ -1923,4 +1929,5 @@ struct mlx5_ifc_cmd_hca_cap_2_bits { union mlx5_ifc_hca_cap_union_bits { struct mlx5_ifc_cmd_hca_cap_bits cmd_hca_cap; + struct mlx5_ifc_cmd_hca_cap_2_bits cmd_hca_cap_2; struct mlx5_ifc_per_protocol_networking_offload_caps_bits per_protocol_networking_offload_caps; -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-02-21 15:22:45.302202732 +0000 +++ 0030-common-mlx5-add-minimum-WQE-size-for-striding-RQ.patch 2022-02-21 15:22:44.062704060 +0000 @@ -1 +1 @@ -From 10599cf83ebe768fe5ebe3e430c2a3c4250aafca Mon Sep 17 00:00:00 2001 +From f873364dfe365f912edf67764fbe3f8473804761 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 10599cf83ebe768fe5ebe3e430c2a3c4250aafca ] + @@ -12,2 +13,0 @@ - -Cc: stable@dpdk.org