From: Leon Romanovsky <leon@kernel.org>
To: Tony Nguyen <anthony.l.nguyen@intel.com>
Cc: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
edumazet@google.com, netdev@vger.kernel.org,
Ahmed Zaki <ahmed.zaki@intel.com>,
Rafal Romanowski <rafal.romanowski@intel.com>
Subject: Re: [PATCH net v2 2/2] iavf: remove active_cvlans and active_svlans bitmaps
Date: Sun, 9 Apr 2023 13:40:55 +0300 [thread overview]
Message-ID: <20230409104055.GP14869@unreal> (raw)
In-Reply-To: <20230407210730.3046149-3-anthony.l.nguyen@intel.com>
On Fri, Apr 07, 2023 at 02:07:30PM -0700, Tony Nguyen wrote:
> From: Ahmed Zaki <ahmed.zaki@intel.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@intel.com>
> Tested-by: Rafal Romanowski <rafal.romanowski@intel.com>
> Signed-off-by: Tony Nguyen <anthony.l.nguyen@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(-)
>
Thanks,
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
next prev parent reply other threads:[~2023-04-09 10:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-07 21:07 [PATCH net v2 0/2][pull request] iavf: fix racing in VLANs Tony Nguyen
2023-04-07 21:07 ` [PATCH net v2 1/2] iavf: refactor VLAN filter states Tony Nguyen
2023-04-09 10:40 ` Leon Romanovsky
2023-04-07 21:07 ` [PATCH net v2 2/2] iavf: remove active_cvlans and active_svlans bitmaps Tony Nguyen
2023-04-09 10:40 ` Leon Romanovsky [this message]
2023-04-12 4:40 ` [PATCH net v2 0/2][pull request] iavf: fix racing in VLANs patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230409104055.GP14869@unreal \
--to=leon@kernel.org \
--cc=ahmed.zaki@intel.com \
--cc=anthony.l.nguyen@intel.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=rafal.romanowski@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).