• Simon Horman's avatar
    nfp: add phys_switch_id support · 8f15df60
    Simon Horman authored
    Add phys_switch_id support by allowing lookup of
    SWITCHDEV_ATTR_ID_PORT_PARENT_ID via the nfp_repr_port_attr_get
    switchdev operation.
    
    This is visible to user-space in the phys_switch_id attribute
    of a netdev.
    
    e.g.
    
    cd /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0
    find . -name phys_switch_id | xargs grep .
    ./net/eth3/phys_switch_id:00154d1300bd
    ./net/eth4/phys_switch_id:00154d1300bd
    ./net/eth2/phys_switch_id:00154d1300bd
    grep: ./net/eth5/phys_switch_id: Operation not supported
    
    In the above eth2 and eth3 and representor netdevs for the first and second
    physical port. eth4 is the representor for the PF. And eth5 is the PF netdev.
    Signed-off-by: default avatarSimon Horman <simon.horman@netronome.com>
    Reviewed-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    8f15df60
nfp_port.c 5.16 KB