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 <[email protected]>
Acked-by: Bing Zhao <[email protected]>
---
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