Skip to content

Commit bbc8222

Browse files
paravmellanoxSaeed Mahameed
authored andcommitted
net/mlx5: E-Switch, Read PF mac address
External controller PF's MAC address is not read from the device during vport setup. Fail to read this results in showing all zeros to user while the factory programmed MAC is a valid value. $ devlink port show eth1 -jp { "port": { "pci/0000:03:00.0/196608": { "type": "eth", "netdev": "eth1", "flavour": "pcipf", "controller": 1, "pfnum": 0, "splittable": false, "function": { "hw_addr": "00:00:00:00:00:00" } } } } Hence, read it when enabling a vport. After the fix, $ devlink port show eth1 -jp { "port": { "pci/0000:03:00.0/196608": { "type": "eth", "netdev": "eth1", "flavour": "pcipf", "controller": 1, "pfnum": 0, "splittable": false, "function": { "hw_addr": "98:03:9b:a0:60:11" } } } } Fixes: f099fde ("net/mlx5: E-switch, Support querying port function mac address") Signed-off-by: Bodong Wang <[email protected]> Signed-off-by: Parav Pandit <[email protected]> Reviewed-by: Alaa Hleihel <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent 2058cc9 commit bbc8222

File tree

1 file changed

+6
-0
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core

1 file changed

+6
-0
lines changed

drivers/net/ethernet/mellanox/mlx5/core/eswitch.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,6 +1054,12 @@ int mlx5_esw_vport_enable(struct mlx5_eswitch *esw, u16 vport_num,
10541054
goto err_vhca_mapping;
10551055
}
10561056

1057+
/* External controller host PF has factory programmed MAC.
1058+
* Read it from the device.
1059+
*/
1060+
if (mlx5_core_is_ecpf(esw->dev) && vport_num == MLX5_VPORT_PF)
1061+
mlx5_query_nic_vport_mac_address(esw->dev, vport_num, true, vport->info.mac);
1062+
10571063
esw_vport_change_handle_locked(vport);
10581064

10591065
esw->enabled_vports++;

0 commit comments

Comments
 (0)