diff options
| author | Moshe Shemesh <moshe@nvidia.com> | 2026-07-02 14:17:26 +0300 |
|---|---|---|
| committer | Paolo Abeni <pabeni@redhat.com> | 2026-07-08 11:23:49 +0200 |
| commit | a49ea2e042af96a7f028ef0972f03589df134eba (patch) | |
| tree | 86e19c3050f3f843bd4f76a20b86b411bb04537d | |
| parent | f6ec46b7e2b227499200fb071752ea653f145f3d (diff) | |
| download | linux-a49ea2e042af96a7f028ef0972f03589df134eba.tar.gz linux-a49ea2e042af96a7f028ef0972f03589df134eba.zip | |
net/mlx5: Set satellite PF devlink ports as non-external
Satellite PFs are local to the DPU and are not on an external host.
Set their devlink port external attribute to false to reflect this.
For satellite PF SFs, distinguish them from host PF SFs by comparing
the SF controller number against the host PF controller
(hpf_host_number + 1). Only SFs whose controller matches the host PF
are marked external, since their PF resides on an external host.
Signed-off-by: Moshe Shemesh <moshe@nvidia.com>
Reviewed-by: Parav Pandit <parav@nvidia.com>
Reviewed-by: Shay Drori <shayd@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20260702111726.816985-3-tariqt@nvidia.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
| -rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/esw/devlink_port.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/esw/devlink_port.c b/drivers/net/ethernet/mellanox/mlx5/core/esw/devlink_port.c index 8c27a33f9d7b..36b00a856bc2 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/esw/devlink_port.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/esw/devlink_port.c @@ -74,7 +74,7 @@ static void mlx5_esw_offloads_pf_vf_devlink_port_attrs_set(struct mlx5_eswitch * memcpy(dl_port->attrs.switch_id.id, ppid.id, ppid.id_len); dl_port->attrs.switch_id.id_len = ppid.id_len; devlink_port_attrs_pci_pf_set(dl_port, controller_num, pfnum, - true); + false); } } @@ -134,13 +134,16 @@ static void mlx5_esw_offloads_sf_devlink_port_attrs_set(struct mlx5_eswitch *esw { struct mlx5_core_dev *dev = esw->dev; struct netdev_phys_item_id ppid = {}; + u32 hpf_ctrl; u16 pfnum; pfnum = mlx5_esw_sf_controller_to_pfnum(dev, controller); + hpf_ctrl = mlx5_esw_get_hpf_host_number(dev) + 1; mlx5_esw_get_port_parent_id(dev, &ppid); memcpy(dl_port->attrs.switch_id.id, &ppid.id[0], ppid.id_len); dl_port->attrs.switch_id.id_len = ppid.id_len; - devlink_port_attrs_pci_sf_set(dl_port, controller, pfnum, sfnum, !!controller); + devlink_port_attrs_pci_sf_set(dl_port, controller, pfnum, sfnum, + controller == hpf_ctrl); } int mlx5_esw_offloads_sf_devlink_port_init(struct mlx5_eswitch *esw, struct mlx5_vport *vport, |
