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 <[email protected]> Reviewed-by: Parav Pandit <[email protected]> Reviewed-by: Saeed Mahameed <[email protected]> Signed-off-by: Tariq Toukan <[email protected]> Signed-off-by: Mark Bloch <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 1c120fe commit 285ed9a

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

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)