All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gregory Etelson <getelson@nvidia.com>
To: <dev@dpdk.org>
Cc: <getelson@nvidia.com>, <mkashani@nvidia.com>,
	<rasland@nvidia.com>, <thomas@monjalon.net>,
	Dariusz Sosnowski <dsosnowski@nvidia.com>,
	"Viacheslav Ovsiienko" <viacheslavo@nvidia.com>,
	Bing Zhao <bingz@nvidia.com>, Ori Kam <orika@nvidia.com>,
	Suanming Mou <suanmingm@nvidia.com>,
	Matan Azrad <matan@nvidia.com>
Subject: [PATCH v3 2/2] net/mlx5: support PF representor suppression in multi-port E-Switch
Date: Wed, 5 Nov 2025 19:48:38 +0200	[thread overview]
Message-ID: <20251105174839.323085-2-getelson@nvidia.com> (raw)
In-Reply-To: <20251105174839.323085-1-getelson@nvidia.com>

In multi-port E-Switch setup, the MLX5 PMD always added
PF representor port.
For example, `representor=pf1vf[0,1]` implicitly added PF1 representor
port:

```
Port     Name
0        p0
1        p1
2        representor_c0pf1vf0
3        representor_c0pf1vf1
```

The patch adds support for the new representor format that suppresses
PF representor attachment:

Example: `representor=(pf1)vf[0,1]`

```
Port     Name
0        p0
1        representor_c0pf1vf0
2        representor_c0pf1vf1
```

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
---
v2: Use updated rte_eth_devargs::flags.
v3: Fix typo in comment.
---
 drivers/net/mlx5/linux/mlx5_os.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c
index c742e0f282..fe80773d49 100644
--- a/drivers/net/mlx5/linux/mlx5_os.c
+++ b/drivers/net/mlx5/linux/mlx5_os.c
@@ -2284,6 +2284,12 @@ mlx5_device_mpesw_pci_match(struct ibv_device *ibv,
 	return -1;
 }
 
+static inline bool
+mlx5_ignore_pf_representor(const struct rte_eth_devargs *eth_da)
+{
+	return (eth_da->flags & RTE_ETH_DEVARG_IGNORE_PF_REPRESENTOR) != 0;
+}
+
 /**
  * Register a PCI device within bonding.
  *
@@ -2592,6 +2598,8 @@ mlx5_os_pci_probe_pf(struct mlx5_common_device *cdev,
 					if (list[ns].info.port_name == mpesw) {
 						list[ns].info.master = 1;
 						list[ns].info.representor = 0;
+					} else if (mlx5_ignore_pf_representor(&eth_da)) {
+						continue;
 					} else {
 						list[ns].info.master = 0;
 						list[ns].info.representor = 1;
-- 
2.51.0


  reply	other threads:[~2025-11-05 17:50 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-28  9:58 [PATCH 1/2] ethdev: make representor parameter more explicit Gregory Etelson
2025-10-28  9:58 ` [PATCH 2/2] net/mlx5: support PF representor suppresion in multi-port E-Switch Gregory Etelson
2025-11-05 17:37 ` [PATCH v2 1/2] ethdev: make representor parameter more explicit Gregory Etelson
2025-11-05 17:37   ` [PATCH v2 2/2] net/mlx5: support PF representor suppresion in multi-port E-Switch Gregory Etelson
2025-11-05 17:48 ` [PATCH v3 1/2] ethdev: make representor parameter more explicit Gregory Etelson
2025-11-05 17:48   ` Gregory Etelson [this message]
2025-11-05 19:20   ` Stephen Hemminger
2025-11-05 21:17     ` Thomas Monjalon
2025-11-06  5:52 ` [PATCH v4 " Gregory Etelson
2025-11-06  5:52   ` [PATCH v4 2/2] net/mlx5: support PF representor suppression in multi-port E-Switch Gregory Etelson
2025-11-12 10:12     ` Dariusz Sosnowski
2025-11-09 14:42   ` [PATCH v4 1/2] ethdev: make representor parameter more explicit Andrew Rybchenko
2025-11-12 10:24     ` Thomas Monjalon
2025-11-12 15:02   ` Stephen Hemminger
2025-11-13 16:41   ` Stephen Hemminger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251105174839.323085-2-getelson@nvidia.com \
    --to=getelson@nvidia.com \
    --cc=bingz@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=dsosnowski@nvidia.com \
    --cc=matan@nvidia.com \
    --cc=mkashani@nvidia.com \
    --cc=orika@nvidia.com \
    --cc=rasland@nvidia.com \
    --cc=suanmingm@nvidia.com \
    --cc=thomas@monjalon.net \
    --cc=viacheslavo@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.