• Parav Pandit's avatar
    net/devlink: Support querying hardware address of port function · 2a916ecc
    Parav Pandit authored
    PCI PF and VF devlink port can manage the function represented by
    a devlink port.
    
    Enable users to query port function's hardware address.
    
    Example of a PCI VF port which supports a port function:
    $ devlink port show pci/0000:06:00.0/2
    pci/0000:06:00.0/2: type eth netdev enp6s0pf0vf1 flavour pcivf pfnum 0 vfnum 1
      function:
        hw_addr 00:11:22:33:44:66
    
    $ devlink port show pci/0000:06:00.0/2 -jp
    {
        "port": {
            "pci/0000:06:00.0/2": {
                "type": "eth",
                "netdev": "enp6s0pf0vf1",
                "flavour": "pcivf",
                "pfnum": 0,
                "vfnum": 1,
                "function": {
                    "hw_addr": "00:11:22:33:44:66"
                }
            }
        }
    }
    Signed-off-by: default avatarParav Pandit <parav@mellanox.com>
    Reviewed-by: default avatarJiri Pirko <jiri@mellanox.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    2a916ecc
devlink.c 240 KB