Skip to content

Commit 285ed9a

Browse files
danielj-mellanoxgregkh
authored andcommitted
net/mlx5: Base ECVF devlink port attrs from 0
[ Upstream commit bc17455 ] Adjust the vport number by the base ECVF vport number so the port attributes start at 0. Previously the port attributes would start 1 after the maximum number of host VFs. Fixes: dc13180 ("net/mlx5: Enable devlink port for embedded cpu VF vports") Signed-off-by: Daniel Jurgens <danielj@nvidia.com> Reviewed-by: Parav Pandit <parav@nvidia.com> Reviewed-by: Saeed Mahameed <saeedm@nvidia.com> Signed-off-by: Tariq Toukan <tariqt@nvidia.com> Signed-off-by: Mark Bloch <mbloch@nvidia.com> Link: https://patch.msgid.link/20250820133209.389065-2-mbloch@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 1c120fe commit 285ed9a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/net/ethernet/mellanox/mlx5/core/esw/devlink_port.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,12 @@ static void mlx5_esw_offloads_pf_vf_devlink_port_attrs_set(struct mlx5_eswitch *
4747
devlink_port_attrs_pci_vf_set(dl_port, controller_num, pfnum,
4848
vport_num - 1, external);
4949
} else if (mlx5_core_is_ec_vf_vport(esw->dev, vport_num)) {
50+
u16 base_vport = mlx5_core_ec_vf_vport_base(dev);
51+
5052
memcpy(dl_port->attrs.switch_id.id, ppid.id, ppid.id_len);
5153
dl_port->attrs.switch_id.id_len = ppid.id_len;
5254
devlink_port_attrs_pci_vf_set(dl_port, 0, pfnum,
53-
vport_num - 1, false);
55+
vport_num - base_vport, false);
5456
}
5557
}
5658

0 commit comments

Comments
 (0)