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 5C12E43345 for ; Thu, 16 Nov 2023 14:24:49 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5495740DF6; Thu, 16 Nov 2023 14:24:49 +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 85883402DD for ; Thu, 16 Nov 2023 14:24:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700141086; 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=bfEcuAbgaezB91RxvZNp7IS9SnKha/oiNZvtXoMaq2U=; b=jGnL0LqW9iq6UnH3vD7nmF8XXXk1uoWuDIS4cik+u8j5P7iGs/yrTyW0WDDCfCnxdraHql crJGEkARrxK4d+cnT78NhxhUlsYWWRAFwuxBWWhJSuXA/CN09nP21cSoxdFbxdpm/Psw6k xbMOMX4tS0dM2eUBj/R7KhUfcLqOLzc= 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-562-XGkfn8IqNAWGjtpW43R-dA-1; Thu, 16 Nov 2023 08:24:44 -0500 X-MC-Unique: XGkfn8IqNAWGjtpW43R-dA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (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 9A2DE38157A2; Thu, 16 Nov 2023 13:24:44 +0000 (UTC) Received: from rh.Home (unknown [10.39.194.169]) by smtp.corp.redhat.com (Postfix) with ESMTP id C8D422166B27; Thu, 16 Nov 2023 13:24:43 +0000 (UTC) From: Kevin Traynor To: Dariusz Sosnowski Cc: Viacheslav Ovsiienko , dpdk stable Subject: patch 'common/mlx5: fix controller index parsing' has been queued to stable release 21.11.6 Date: Thu, 16 Nov 2023 13:23:15 +0000 Message-ID: <20231116132348.557257-33-ktraynor@redhat.com> In-Reply-To: <20231116132348.557257-1-ktraynor@redhat.com> References: <20231116132348.557257-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.6 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.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/21/23. 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/981460d10107103b0fa2d6b858ecaa0ae45184fc Thanks. Kevin --- >From 981460d10107103b0fa2d6b858ecaa0ae45184fc Mon Sep 17 00:00:00 2001 From: Dariusz Sosnowski Date: Tue, 31 Oct 2023 16:27:27 +0200 Subject: [PATCH] common/mlx5: fix controller index parsing [ upstream commit 3cd5e500b5cb1b72ee182be4043018f22a5f8a3b ] When probing the Linux kernel network interfaces attached to E-Switch, mlx5 PMD decides the representor type and represented entity using phys_port_name exposed by the mlx5 kernel driver in sysfs. mlx5 PMD first checks this name for multihost controller index. In multihost scenarios, phys_port_name is prefixed with "c[0-9]+" string. Included integer is the controller index. Assuming that phys_port_name contains a string representing a physical port, i.e. "p[0-9]+" string, the parsing logic is incorrect. Both "p[0-9]+" and "c[0-9]+" match the formatting string used to parse phys_port_name, but controller index is still filled out. This patch fixes this behavior by storing the parsed index in a temporary variable and setting controller index if and only if phys_port_name matches multihost controller syntax. Fixes: 59df97f1a832 ("common/mlx5: support sub-function representor parsing") Signed-off-by: Dariusz Sosnowski Acked-by: Viacheslav Ovsiienko --- drivers/common/mlx5/linux/mlx5_common_os.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/common/mlx5/linux/mlx5_common_os.c b/drivers/common/mlx5/linux/mlx5_common_os.c index eeb583a553..9fd6c1b5f0 100644 --- a/drivers/common/mlx5/linux/mlx5_common_os.c +++ b/drivers/common/mlx5/linux/mlx5_common_os.c @@ -96,8 +96,9 @@ mlx5_translate_port_name(const char *port_name_in, char *end; int sc_items; + int32_t ctrl_num = -1; - sc_items = sscanf(port_name_in, "%c%d", - &ctrl, &port_info_out->ctrl_num); + sc_items = sscanf(port_name_in, "%c%d", &ctrl, &ctrl_num); if (sc_items == 2 && ctrl == 'c') { + port_info_out->ctrl_num = ctrl_num; port_name_in++; /* 'c' */ port_name_in += snprintf(NULL, 0, "%d", -- 2.41.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-11-16 13:21:53.360178683 +0000 +++ 0033-common-mlx5-fix-controller-index-parsing.patch 2023-11-16 13:21:52.483946471 +0000 @@ -1 +1 @@ -From 3cd5e500b5cb1b72ee182be4043018f22a5f8a3b Mon Sep 17 00:00:00 2001 +From 981460d10107103b0fa2d6b858ecaa0ae45184fc Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 3cd5e500b5cb1b72ee182be4043018f22a5f8a3b ] + @@ -23 +24,0 @@ -Cc: stable@dpdk.org @@ -32 +33 @@ -index 7260c1a19f..41345e1597 100644 +index eeb583a553..9fd6c1b5f0 100644 @@ -35 +36 @@ -@@ -97,8 +97,9 @@ mlx5_translate_port_name(const char *port_name_in, +@@ -96,8 +96,9 @@ mlx5_translate_port_name(const char *port_name_in,