public inbox for dev@dpdk.org
 help / color / mirror / Atom feed
From: Dariusz Sosnowski <dsosnowski@nvidia.com>
To: 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>
Cc: <dev@dpdk.org>, Raslan Darawsheh <rasland@nvidia.com>
Subject: [PATCH] net/mlx5: fix ignoring PF representor
Date: Wed, 11 Mar 2026 08:53:51 +0100	[thread overview]
Message-ID: <20260311075352.266692-1-dsosnowski@nvidia.com> (raw)

Whenever a new set of representors are probed by mlx5 driver
on Multiport E-Switch setup using these device arguments:

	0000:08:00.0,dv_flow_en=2,representor=(pf1)vf1

mlx5 driver should create 2 DPDK ports.
One for 1st physical port (transfer proxy) and another for
PF1VF1 representor. Parentheses are used in representor argument
to indicate that physical port related to PF1VF1 should be ignored.

Offending patch has introduced a regression to ignore logic.
Whenever mlx5 driver checked if related physical port should be probed
and if representor_match_uplink() returned false (as it should),
this result was ignored and probing continued.
If requested VF/SF index matched PF index, physical port was probed.

This patch fixes that by adding explicit rejection of spawning physical
ports for VF/SF representors if checked port is a physical port and
driver have not already spawned it.

Fixes: f363bbe2c036 ("net/mlx5: fix probing to allow BlueField Socket Direct")

Signed-off-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
Acked-by: Bing Zhao <bingz@nvidia.com>
---
 drivers/net/mlx5/linux/mlx5_os.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c
index 57a6ce7458..a717191002 100644
--- a/drivers/net/mlx5/linux/mlx5_os.c
+++ b/drivers/net/mlx5/linux/mlx5_os.c
@@ -1184,6 +1184,10 @@ representor_match_port(const struct mlx5_dev_spawn_data *spawn,
 		    representor_match_uplink(spawn, spawn->info.pf_num, eth_da, pf_num))
 			return true;
 
+		/* Uplink ports should not be matched against representor_ports. */
+		if (spawn->info.name_type == MLX5_PHYS_PORT_NAME_TYPE_UPLINK)
+			return false;
+
 		for (uint16_t f = 0; f < eth_da->nb_representor_ports; ++f) {
 			uint16_t port_num = eth_da->representor_ports[f];
 			bool pf_num_match;
-- 
2.47.3


             reply	other threads:[~2026-03-11  7:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-11  7:53 Dariusz Sosnowski [this message]
2026-03-11 12:15 ` [PATCH] net/mlx5: fix ignoring PF representor Raslan Darawsheh

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=20260311075352.266692-1-dsosnowski@nvidia.com \
    --to=dsosnowski@nvidia.com \
    --cc=bingz@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=matan@nvidia.com \
    --cc=orika@nvidia.com \
    --cc=rasland@nvidia.com \
    --cc=suanmingm@nvidia.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox