• Jacob Keller's avatar
    ice: move VF overflow message count into struct ice_mbx_vf_info · 8cd8a6b1
    Jacob Keller authored
    The ice driver has some logic in ice_vf_mbx.c used to detect potentially
    malicious VF behavior with regards to overflowing the PF mailbox. This
    logic currently stores message counts in struct ice_mbx_vf_counter.vf_cntr
    as an array. This array is allocated during initialization with
    ice_mbx_init_snapshot.
    
    This logic makes sense for SR-IOV where all VFs are allocated at once up
    front. However, in the future with Scalable IOV this logic will not work.
    VFs can be added and removed dynamically. We could try to keep the vf_cntr
    array for the maximum possible number of VFs, but this is a waste of
    memory.
    
    Use the recently introduced struct ice_mbx_vf_info structure to store the
    message count. Pass a pointer to the mbx_info for a VF instead of using its
    VF ID. Replace the array of VF message counts with a linked list that
    tracks all currently active mailbox tracking info structures.
    Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
    Reviewed-by: default avatarMichal Swiatkowski <michal.swiatkowski@linux.intel.com>
    Tested-by: default avatarMarek Szlosek <marek.szlosek@intel.com>
    Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
    8cd8a6b1
ice_vf_lib.c 33.1 KB