Skip to content

Commit 6804b63

Browse files
getelson-at-mellanoxshemminger
authored andcommitted
net/mlx5: support PF representor suppression
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 <[email protected]>
1 parent c64dae6 commit 6804b63

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

drivers/net/mlx5/linux/mlx5_os.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2284,6 +2284,12 @@ mlx5_device_mpesw_pci_match(struct ibv_device *ibv,
22842284
return -1;
22852285
}
22862286

2287+
static inline bool
2288+
mlx5_ignore_pf_representor(const struct rte_eth_devargs *eth_da)
2289+
{
2290+
return (eth_da->flags & RTE_ETH_DEVARG_REPRESENTOR_IGNORE_PF) != 0;
2291+
}
2292+
22872293
/**
22882294
* Register a PCI device within bonding.
22892295
*
@@ -2592,6 +2598,8 @@ mlx5_os_pci_probe_pf(struct mlx5_common_device *cdev,
25922598
if (list[ns].info.port_name == mpesw) {
25932599
list[ns].info.master = 1;
25942600
list[ns].info.representor = 0;
2601+
} else if (mlx5_ignore_pf_representor(&eth_da)) {
2602+
continue;
25952603
} else {
25962604
list[ns].info.master = 0;
25972605
list[ns].info.representor = 1;

0 commit comments

Comments
 (0)