• Parav Pandit's avatar
    net/mlx5: SF, Add auxiliary device driver · 1958fc2f
    Parav Pandit authored
    Add auxiliary device driver for mlx5 subfunction auxiliary device.
    
    A mlx5 subfunction is similar to PCI PF and VF. For a subfunction
    an auxiliary device is created.
    
    As a result, when mlx5 SF auxiliary device binds to the driver,
    its netdev and rdma device are created, they appear as
    
    $ ls -l /sys/bus/auxiliary/devices/
    mlx5_core.sf.4 -> ../../../devices/pci0000:00/0000:00:03.0/0000:06:00.0/mlx5_core.sf.4
    
    $ ls -l /sys/class/net/eth1/device
    /sys/class/net/eth1/device -> ../../../mlx5_core.sf.4
    
    $ cat /sys/bus/auxiliary/devices/mlx5_core.sf.4/sfnum
    88
    
    $ devlink dev show
    pci/0000:06:00.0
    auxiliary/mlx5_core.sf.4
    
    $ devlink port show auxiliary/mlx5_core.sf.4/1
    auxiliary/mlx5_core.sf.4/1: type eth netdev p0sf88 flavour virtual port 0 splittable false
    
    $ rdma link show mlx5_0/1
    link mlx5_0/1 state ACTIVE physical_state LINK_UP netdev p0sf88
    
    $ rdma dev show
    8: rocep6s0f1: node_type ca fw 16.29.0550 node_guid 248a:0703:00b3:d113 sys_image_guid 248a:0703:00b3:d112
    13: mlx5_0: node_type ca fw 16.29.0550 node_guid 0000:00ff:fe00:8888 sys_image_guid 248a:0703:00b3:d112
    
    In future, devlink device instance name will adapt to have sfnum
    annotation using either an alias or as devlink instance name described
    in RFC [1].
    
    [1] https://lore.kernel.org/netdev/20200519092258.GF4655@nanopsycho/Signed-off-by: default avatarParav Pandit <parav@nvidia.com>
    Reviewed-by: default avatarVu Pham <vuhuong@nvidia.com>
    Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
    1958fc2f
devlink.c 11.1 KB