[Intel-wired-lan] [intel-next PATCH 04/14] ice: move VF overflow message count into struct ice_mbx_vf_info
Szlosek, Marek
marek.szlosek at intel.com
Fri Mar 10 13:16:18 UTC 2023
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces at osuosl.org> On Behalf Of
> Jacob Keller
> Sent: środa, 22 lutego 2023 18:09
> To: Intel Wired LAN <intel-wired-lan at lists.osuosl.org>
> Cc: Nguyen, Anthony L <anthony.l.nguyen at intel.com>; Brandeburg, Jesse
> <jesse.brandeburg at intel.com>
> Subject: [Intel-wired-lan] [intel-next PATCH 04/14] ice: move VF overflow
> message count into struct ice_mbx_vf_info
>
> 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: Jacob Keller <jacob.e.keller at intel.com>
> Reviewed-by: Michal Swiatkowski <michal.swiatkowski at linux.intel.com>
> ---
> drivers/net/ethernet/intel/ice/ice_sriov.c | 9 +-
> drivers/net/ethernet/intel/ice/ice_type.h | 18 +--
> drivers/net/ethernet/intel/ice/ice_vf_lib.c | 7 +-
> drivers/net/ethernet/intel/ice/ice_vf_mbx.c | 167 +++++++-------------
> drivers/net/ethernet/intel/ice/ice_vf_mbx.h | 8 +-
> 5 files changed, 69 insertions(+), 140 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/ice/ice_sriov.c
> b/drivers/net/ethernet/intel/ice/ice_sriov.c
> index 44b94276df91..8820f269bfdf 100644
> --- a/drivers/net/ethernet/intel/ice/ice_sriov.c
> +++ b/drivers/net/ethernet/intel/ice/ice_sriov.c
Tested-by: Marek Szlosek <marek.szlosek at intel.com>
More information about the Intel-wired-lan
mailing list