]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5: E-Switch, Read PF mac address
authorParav Pandit <parav@nvidia.com>
Tue, 8 Jun 2021 16:14:08 +0000 (19:14 +0300)
committerSaeed Mahameed <saeedm@nvidia.com>
Wed, 16 Jun 2021 22:36:38 +0000 (15:36 -0700)
commitc2219198a04204b6f347d6b6e949e53bce74e2b2
treec85aac456a1b3c999f79d979df1d7c6f4d880341
parent6993a1052a04e679e9f2d033ec87dc78ef813d02
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: 41e6e1c6c4b6 ("net/mlx5: E-switch, Support querying port function mac address")
Signed-off-by: Bodong Wang <bodong@nvidia.com>
Signed-off-by: Parav Pandit <parav@nvidia.com>
Reviewed-by: Alaa Hleihel <alaa@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c