[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230409104055.GP14869@unreal>
Date: Sun, 9 Apr 2023 13:40:55 +0300
From: Leon Romanovsky <leon@...nel.org>
To: Tony Nguyen <anthony.l.nguyen@...el.com>
Cc: davem@...emloft.net, kuba@...nel.org, pabeni@...hat.com,
edumazet@...gle.com, netdev@...r.kernel.org,
Ahmed Zaki <ahmed.zaki@...el.com>,
Rafal Romanowski <rafal.romanowski@...el.com>
Subject: Re: [PATCH net v2 2/2] iavf: remove active_cvlans and active_svlans
bitmaps
On Fri, Apr 07, 2023 at 02:07:30PM -0700, Tony Nguyen wrote:
> From: Ahmed Zaki <ahmed.zaki@...el.com>
>
> 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: 48ccc43ecf10 ("iavf: Add support VIRTCHNL_VF_OFFLOAD_VLAN_V2 during netdev config")
> Signed-off-by: Ahmed Zaki <ahmed.zaki@...el.com>
> Tested-by: Rafal Romanowski <rafal.romanowski@...el.com>
> Signed-off-by: Tony Nguyen <anthony.l.nguyen@...el.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(-)
>
Thanks,
Reviewed-by: Leon Romanovsky <leonro@...dia.com>
Powered by blists - more mailing lists