[Intel-wired-lan] [PATCH net 2/2] iavf: remove active_cvlans and active_svlans bitmaps

Romanowski, Rafal rafal.romanowski at intel.com
Mon Apr 3 10:15:15 UTC 2023


> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces at osuosl.org> On Behalf Of
> Ahmed Zaki
> Sent: niedziela, 26 marca 2023 17:27
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [PATCH net 2/2] iavf: remove active_cvlans and
> active_svlans bitmaps
> 
> The VLAN filters info is currently being held in a list and 2 bitmaps
> (active_cvlans and active_svlans). We are experiencing some racing where
> data is not in sync in the list and bitmaps. For example, the VLAN is initially
> added to the list but only when the PF replies, it is added to the bitmap. If a
> user adds many V2 VLANS before the PF responds:
> 
>     while [ $((i++)) ]
>         ip l add l eth0 name eth0.$i type vlan id $i
> 
> we might end up with more VLAN list entries than the designated limit.
> Also, The "ip link show" will show more links added than the PF limit.
> 
> On the other and, the bitmaps are only used to check the number of VLAN
> filters and to re-enable the filters when the interface goes from DOWN to
> UP.
> 
> This patch gets rid of the bitmaps and uses the list only. To do that, the states
> of the VLAN filter are modified:
> 1 - IAVF_VLAN_REMOVE: the entry needs to be totally removed after
> informing
>   the PF. This is the "ip link del eth0.$i" path.
> 2 - IAVF_VLAN_DISABLE: (new) the netdev went down. The filter needs to
> be
>   removed from the PF and then marked INACTIVE.
> 3 - IAVF_VLAN_INACTIVE: (new) no PF filter exists, but the user did not
>   delete the VLAN.
> 
> Fixes: 48ccc43ecf109 ("iavf: Add support VIRTCHNL_VF_OFFLOAD_VLAN_V2
> during netdev config")
> Signed-off-by: Ahmed Zaki <ahmed.zaki at intel.com>
> ---
>  drivers/net/ethernet/intel/iavf/iavf.h        |  7 +--
>  drivers/net/ethernet/intel/iavf/iavf_main.c   | 40 +++++++----------
>  .../net/ethernet/intel/iavf/iavf_virtchnl.c   | 45 ++++++++++---------
>  3 files changed, 45 insertions(+), 47 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/iavf/iavf.h
> b/drivers/net/ethernet/intel/iavf/iavf.h
> index 00262f721761..7ff9e6210772 100644
> --- a/drivers/net/ethernet/intel/iavf/iavf.h
> +++ b/drivers/net/ethernet/intel/iavf/iavf.h


Tested-by: Rafal Romanowski <rafal.romanowski at intel.com>





More information about the Intel-wired-lan mailing list