Skip to contentSkip to conversation

net/mlx5: fix ignoring PF representor

PATCH In review Dariusz Sosnowski 2 participants 2 messages Mar 11 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/mlx5: fix ignoring PF representor

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")
---
 drivers/net/mlx5/linux/mlx5_os.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/net/mlx5/linux/mlx5_os.c +4 -0
index 57a6ce7458..a717191002 100644
@@ -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;
Signature · 1 line
2.47.3
#1 lore raw

Hi,

Quoted 16 lines · Dariusz Sosnowski

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.

Quoted 8 lines

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")

Patch squashed into relevant commit in next-net-mlx,

Kindest regards
Raslan Darawsheh