• Dmytro Linkin's avatar
    netdevsim: Implement port types and indexing · 814b9ce6
    Dmytro Linkin authored
    Define type of ports, which netdevsim driver currently operates with as
    PF. Define new port type - VF, which will be implemented in following
    patches. Add helper functions to distinguish them. Add helper function
    to get VF index from port index.
    
    Add port indexing logic where PFs' indexes starts from 0, VFs' - from
    NSIM_DEV_VF_PORT_INDEX_BASE.
    All ports uses same index pool, which means that PF port may be created
    with index from VFs' indexes range.
    Maximum number of VFs, which the driver can allocate, is limited by
    UINT_MAX - BASE.
    Signed-off-by: default avatarDmytro Linkin <dlinkin@nvidia.com>
    Reviewed-by: default avatarJiri Pirko <jiri@nvidia.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    814b9ce6
bus.c 11.1 KB