• Michal Swiatkowski's avatar
    ice: introduce VF port representor · 37165e3f
    Michal Swiatkowski authored
    Port representor is used to manage VF from host side. To allow
    it each created representor registers netdevice with random hw
    address. Also devlink port is created for all representors.
    
    Port representor name is created based on switch id or managed
    by devlink core if devlink port was registered with success.
    
    Open and stop ndo ops are implemented to allow managing the VF
    link state. Link state is tracked in VF struct.
    
    Struct ice_netdev_priv is extended by pointer to representor
    field. This is needed to get correct representor from netdev
    struct mostly used in ndo calls.
    
    Implement helper functions to check if given netdev is netdev of
    port representor (ice_is_port_repr_netdev) and to get representor
    from netdev (ice_netdev_to_repr).
    
    As driver mostly will create or destroy port representors on all
    VFs instead of on single one, write functions to add and remove
    representor for each VF.
    
    Representor struct contains pointer to source VSI, which is VSI
    configured on VF, backpointer to VF, backpointer to netdev,
    q_vector pointer and metadata_dst which will be used in data path.
    Co-developed-by: default avatarGrzegorz Nitka <grzegorz.nitka@intel.com>
    Signed-off-by: default avatarGrzegorz Nitka <grzegorz.nitka@intel.com>
    Signed-off-by: default avatarMichal Swiatkowski <michal.swiatkowski@linux.intel.com>
    Tested-by: default avatarSandeep Penigalapati <sandeep.penigalapati@intel.com>
    Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
    37165e3f
ice_virtchnl_pf.c 137 KB