patch 'net/mlx5: fix MPESW PF probe for any number of ports' has been queued to stable release 23.11.7
Shani Peretz
shperetz at nvidia.com
Tue Mar 31 08:24:20 CEST 2026
Hi,
FYI, your patch has been queued to stable release 23.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 04/05/26. 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/shanipr/dpdk-stable
This queued commit can be viewed at:
https://github.com/shanipr/dpdk-stable/commit/a9c5e6fd5bba71648202fd50cea4cab9a90910eb
Thanks.
Shani
---
>From a9c5e6fd5bba71648202fd50cea4cab9a90910eb Mon Sep 17 00:00:00 2001
From: Gregory Etelson <getelson at nvidia.com>
Date: Mon, 5 Jan 2026 15:29:41 +0200
Subject: [PATCH] net/mlx5: fix MPESW PF probe for any number of ports
[ upstream commit a3ad6bace70cc229698f4e9b14cb713937d02fa3 ]
Current MPESW PF probe was designed for interfaces with up to 2 ports.
The patch can handle interfaces with any number of ports.
Fixes: 11c73de9ef63 ("net/mlx5: probe multi-port E-Switch device")
Signed-off-by: Gregory Etelson <getelson at nvidia.com>
Reviewed-by: Bing Zhao <bingz at nvidia.com>
Acked-by: Dariusz Sosnowski <dsosnowski at nvidia.com>
Signed-off-by: Bing Zhao <bingz at nvidia.com>
---
drivers/net/mlx5/mlx5_ethdev.c | 47 +++++++++++++++++++---------------
1 file changed, 26 insertions(+), 21 deletions(-)
diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
index 39506680a2..e7b5d3767c 100644
--- a/drivers/net/mlx5/mlx5_ethdev.c
+++ b/drivers/net/mlx5/mlx5_ethdev.c
@@ -485,8 +485,9 @@ mlx5_representor_info_get(struct rte_eth_dev *dev,
struct rte_eth_representor_info *info)
{
struct mlx5_priv *priv = dev->data->dev_private;
- int n_type = 5; /* Representor types: PF, VF, HPF at VF, SF and HPF at SF. */
- int n_pf = 2; /* Number of PFs. */
+ /* Representor types: PF, VF, HPF at VF, SF and HPF at SF, total 5. */
+ int n_type = RTE_ETH_REPRESENTOR_PF + 2; /* Maximal type + 2 for HPFs. */
+ int n_pf = 8; /* Maximal number of PFs. */
int i = 0, pf;
int n_entries;
@@ -501,25 +502,29 @@ mlx5_representor_info_get(struct rte_eth_dev *dev,
info->pf = 0;
if (mlx5_is_port_on_mpesw_device(priv)) {
info->pf = priv->mpesw_port;
- /* PF range, both ports will show the same information. */
- info->ranges[i].type = RTE_ETH_REPRESENTOR_PF;
- info->ranges[i].controller = 0;
- info->ranges[i].pf = priv->mpesw_owner + 1;
- info->ranges[i].vf = 0;
- /*
- * The representor indexes should be the values set of "priv->mpesw_port".
- * In the real case now, only 1 PF/UPLINK representor is supported.
- * The port index will always be the value of "owner + 1".
- */
- info->ranges[i].id_base =
- MLX5_REPRESENTOR_ID(priv->mpesw_owner, info->ranges[i].type,
- info->ranges[i].pf);
- info->ranges[i].id_end =
- MLX5_REPRESENTOR_ID(priv->mpesw_owner, info->ranges[i].type,
- info->ranges[i].pf);
- snprintf(info->ranges[i].name, sizeof(info->ranges[i].name),
- "pf%d", info->ranges[i].pf);
- i++;
+ for (i = 0; i < n_pf; i++) {
+ /* PF range, both ports will show the same information. */
+ info->ranges[i].type = RTE_ETH_REPRESENTOR_PF;
+ info->ranges[i].controller = 0;
+ info->ranges[i].pf = priv->mpesw_owner + i + 1;
+ info->ranges[i].vf = 0;
+ /*
+ * The representor indexes should be the values set of "priv->mpesw_port".
+ * In the real case now, only 1 PF/UPLINK representor is supported.
+ * The port index will always be the value of "owner + 1".
+ */
+ info->ranges[i].id_base =
+ MLX5_REPRESENTOR_ID(priv->mpesw_owner,
+ info->ranges[i].type,
+ info->ranges[i].pf);
+ info->ranges[i].id_end =
+ MLX5_REPRESENTOR_ID(priv->mpesw_owner,
+ info->ranges[i].type,
+ info->ranges[i].pf);
+ snprintf(info->ranges[i].name,
+ sizeof(info->ranges[i].name),
+ "pf%d", info->ranges[i].pf);
+ }
} else if (priv->pf_bond >= 0)
info->pf = priv->pf_bond;
for (pf = 0; pf < n_pf; ++pf) {
--
2.43.0
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2026-03-31 00:32:34.471512585 +0300
+++ 0061-net-mlx5-fix-MPESW-PF-probe-for-any-number-of-ports.patch 2026-03-31 00:32:29.119400000 +0300
@@ -1 +1 @@
-From a3ad6bace70cc229698f4e9b14cb713937d02fa3 Mon Sep 17 00:00:00 2001
+From a9c5e6fd5bba71648202fd50cea4cab9a90910eb Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit a3ad6bace70cc229698f4e9b14cb713937d02fa3 ]
+
@@ -11 +12,0 @@
-Cc: stable at dpdk.org
@@ -22 +23 @@
-index 7747b0c869..c93a7ac4f2 100644
+index 39506680a2..e7b5d3767c 100644
@@ -25 +26 @@
-@@ -493,8 +493,9 @@ mlx5_representor_info_get(struct rte_eth_dev *dev,
+@@ -485,8 +485,9 @@ mlx5_representor_info_get(struct rte_eth_dev *dev,
@@ -37 +38 @@
-@@ -509,25 +510,29 @@ mlx5_representor_info_get(struct rte_eth_dev *dev,
+@@ -501,25 +502,29 @@ mlx5_representor_info_get(struct rte_eth_dev *dev,
More information about the stable
mailing list