mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-31 02:21:39 -04:00
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>
This commit is contained in:
committed by
Paolo Abeni
parent
f6ec46b7e2
commit
a49ea2e042
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user