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 3ADDB432DA for ; Wed, 8 Nov 2023 20:27:17 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 365C242E3B; Wed, 8 Nov 2023 20:27:17 +0100 (CET) Received: from mail-lj1-f178.google.com (mail-lj1-f178.google.com [209.85.208.178]) by mails.dpdk.org (Postfix) with ESMTP id 5BF2A40395 for ; Wed, 8 Nov 2023 20:27:16 +0100 (CET) Received: by mail-lj1-f178.google.com with SMTP id 38308e7fff4ca-2c59a4dd14cso97739491fa.2 for ; Wed, 08 Nov 2023 11:27:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699471636; x=1700076436; 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=pU1qBpY2Eiq0Xo04yDp+pAYxRfAcDHyJt+Dm1B1N600=; b=LEqBElLoiq7HuHvUn5plsoigGKlhqca2qpvlQyUIf5DnQC0SbbAa9sFybqdjjunryB D7wj1czgsxHw8kOAJ8QyBgm/QpYscdiTK2SD8uXvUuzVVYYy6TXnFBvnIR0Do2cvf7WA J77pWSPdpNmgqigeF7Rp9k44rP38Q8aH2IRulMQ35JjKwr6YBl1hzkbNy3scvdr8O3E8 veaLhYymsKdR9OOj9VFzk9KccAIeqiYi0zQcgUQNjGFlfpfm68bxACXrAtpYW89wm5QR w2IXcTiB0T+TuqOzTD//BmEVkL3RybCSs/I527Uz8eaowwO6IEntT07Z8th4Zvz+GsiW 9cdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699471636; x=1700076436; 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=pU1qBpY2Eiq0Xo04yDp+pAYxRfAcDHyJt+Dm1B1N600=; b=P0UrCS1Bf3WiGanwA/BORmk8Dii5B9dPtJbwxuzMocS70iN6cv5gEmsY/PLOChB2nP KIPgVnuw8YyZuxnwlXchHg/qegW1+J9VPVYbvB9ijaQjsNJKpplRMk6mLKdst81PXKmF zQEmxwKtu1+p7omTARHBT7g8mwSq0fNvAMUG1zC/1zzMiQmhyVfXB8WT04Cj7sSAZzU4 438AWUCvOI4eXDUCEaprp4WGeKhyVvUpQPn5dlknykoFInCPFnPWgSKYoEFxhKfHc4M3 mDBPbZU4tcsWnGJHGCE9dAKlyjGVuAfnxRJhwi8FAh91EivqKIVKlu9D4sRQCmaPZ2Kt t7jg== X-Gm-Message-State: AOJu0YyXJigYgRdfSgPVZCOHQQcd5xwAk8tFcWv0thWvn/bpMFpc5orl zbOvr7uMTwrGpvfqej4TuX0= X-Google-Smtp-Source: AGHT+IGvPITYoH48g5Bjr/CmsxYZwMPyhfs78EkZsYycYrBU58qqwBqIFpYzZYkJ/uRD28qBvE5BGg== X-Received: by 2002:a05:651c:1a21:b0:2c4:fe0a:dc3e with SMTP id by33-20020a05651c1a2100b002c4fe0adc3emr3135152ljb.36.1699471635682; Wed, 08 Nov 2023 11:27:15 -0800 (PST) Received: from localhost ([2a01:4b00:d307:1000:f1d3:eb5e:11f4:a7d9]) by smtp.gmail.com with ESMTPSA id u6-20020a05600c210600b003fe23b10fdfsm19607504wml.36.2023.11.08.11.27.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Nov 2023 11:27:15 -0800 (PST) From: luca.boccassi@gmail.com To: Dariusz Sosnowski Cc: Viacheslav Ovsiienko , dpdk stable Subject: patch 'common/mlx5: fix controller index parsing' has been queued to stable release 20.11.10 Date: Wed, 8 Nov 2023 19:25:30 +0000 Message-Id: <20231108192535.922238-32-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231108192535.922238-1-luca.boccassi@gmail.com> References: <20231018235930.3144-41-luca.boccassi@gmail.com> <20231108192535.922238-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 20.11.10 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/10/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/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/a623fc032e26bb47b6848e82f0dba59b1afd04b7 Thanks. Luca Boccassi --- >From a623fc032e26bb47b6848e82f0dba59b1afd04b7 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 96e036fc66..507a0e3873 100644 --- a/drivers/common/mlx5/linux/mlx5_common_os.c +++ b/drivers/common/mlx5/linux/mlx5_common_os.c @@ -100,10 +100,11 @@ mlx5_translate_port_name(const char *port_name_in, char ctrl = 0, pf_c1, pf_c2, vf_c1, vf_c2, eol; 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", port_info_out->ctrl_num); -- 2.39.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-11-08 19:23:53.498864182 +0000 +++ 0032-common-mlx5-fix-controller-index-parsing.patch 2023-11-08 19:23:51.821397286 +0000 @@ -1 +1 @@ -From 3cd5e500b5cb1b72ee182be4043018f22a5f8a3b Mon Sep 17 00:00:00 2001 +From a623fc032e26bb47b6848e82f0dba59b1afd04b7 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 96e036fc66..507a0e3873 100644 @@ -35 +36 @@ -@@ -96,10 +96,11 @@ mlx5_translate_port_name(const char *port_name_in, +@@ -100,10 +100,11 @@ mlx5_translate_port_name(const char *port_name_in,