diff mbox series

[v2] iavf: do not track VLAN 0 filters

Message ID 20230307214738.2468357-1-ahmed.zaki@intel.com
State Superseded
Delegated to: Anthony Nguyen
Headers show
Series [v2] iavf: do not track VLAN 0 filters | expand

Commit Message

Ahmed Zaki March 7, 2023, 9:47 p.m. UTC
When an interface with the maximum number of VLAN filters is brought up,
a spurious error is logged:

    [257.483082] 8021q: adding VLAN 0 to HW filter on device enp0s3
    [257.483094] iavf 0000:00:03.0 enp0s3: Max allowed VLAN filters 8. Remove existing VLANs or disable filtering via Ethtool if supported.

The VF driver complains that it cannot add the VLAN 0 filter.

On the other hand, the PF driver always adds VLAN 0 filter on VF
initialization. The VF does not need to ask the PF for that filter at
all.

Fix the error by not tracking VLAN 0 filters altogether. With that, the
check added by commit 0e710a3ffd0c ("iavf: Fix VF driver counting VLAN 0
filters") in iavf_virtchnl.c is useless and might be confusing if left as
it suggests that we track VLAN 0.

Fixes: 0e710a3ffd0c ("iavf: Fix VF driver counting VLAN 0 filters")
Signed-off-by: Ahmed Zaki <ahmed.zaki@intel.com>
Reviewed-by: Michal Kubiak <michal.kubiak@intel.com>
---
v1 -> v2: Added indentation and fixed typo in commit  message. Also,
          clarified the comment in iavf_vlan_rx_add_vid()
---
 drivers/net/ethernet/intel/iavf/iavf_main.c     | 4 ++++
 drivers/net/ethernet/intel/iavf/iavf_virtchnl.c | 2 --
 2 files changed, 4 insertions(+), 2 deletions(-)

Comments

Romanowski, Rafal March 13, 2023, 3:02 p.m. UTC | #1
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> Ahmed Zaki
> Sent: wtorek, 7 marca 2023 22:48
> To: intel-wired-lan@lists.osuosl.org
> Cc: Jaron, MichalX <michalx.jaron@intel.com>; Kubiak, Michal
> <michal.kubiak@intel.com>
> Subject: [Intel-wired-lan] [PATCH v2] iavf: do not track VLAN 0 filters
> 
> When an interface with the maximum number of VLAN filters is brought up,
> a spurious error is logged:
> 
>     [257.483082] 8021q: adding VLAN 0 to HW filter on device enp0s3
>     [257.483094] iavf 0000:00:03.0 enp0s3: Max allowed VLAN filters 8. Remove
> existing VLANs or disable filtering via Ethtool if supported.
> 
> The VF driver complains that it cannot add the VLAN 0 filter.
> 
> On the other hand, the PF driver always adds VLAN 0 filter on VF initialization.
> The VF does not need to ask the PF for that filter at all.
> 
> Fix the error by not tracking VLAN 0 filters altogether. With that, the check
> added by commit 0e710a3ffd0c ("iavf: Fix VF driver counting VLAN 0
> filters") in iavf_virtchnl.c is useless and might be confusing if left as it
> suggests that we track VLAN 0.
> 
> Fixes: 0e710a3ffd0c ("iavf: Fix VF driver counting VLAN 0 filters")
> Signed-off-by: Ahmed Zaki <ahmed.zaki@intel.com>
> Reviewed-by: Michal Kubiak <michal.kubiak@intel.com>
> ---
> v1 -> v2: Added indentation and fixed typo in commit  message. Also,
>           clarified the comment in iavf_vlan_rx_add_vid()
> ---
>  drivers/net/ethernet/intel/iavf/iavf_main.c     | 4 ++++
>  drivers/net/ethernet/intel/iavf/iavf_virtchnl.c | 2 --
>  2 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c
> b/drivers/net/ethernet/intel/iavf/iavf_main.c
> index 3273aeb8fa67..eb8f944276ff 100644
> --- a/drivers/net/ethernet/intel/iavf/iavf_main.c
> +++ b/drivers/net/ethernet/intel/iavf/iavf_main.c


Tested-by: Rafal Romanowski <rafal.romanowski@intel.com>
diff mbox series

Patch

diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c b/drivers/net/ethernet/intel/iavf/iavf_main.c
index 3273aeb8fa67..eb8f944276ff 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_main.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_main.c
@@ -893,6 +893,10 @@  static int iavf_vlan_rx_add_vid(struct net_device *netdev,
 {
 	struct iavf_adapter *adapter = netdev_priv(netdev);
 
+	/* Do not track VLAN 0 filter, always added by the PF on VF init */
+	if (!vid)
+		return 0;
+
 	if (!VLAN_FILTERING_ALLOWED(adapter))
 		return -EIO;
 
diff --git a/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c b/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
index 6d23338604bb..4e17d006c52d 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
@@ -2446,8 +2446,6 @@  void iavf_virtchnl_completion(struct iavf_adapter *adapter,
 		list_for_each_entry(f, &adapter->vlan_filter_list, list) {
 			if (f->is_new_vlan) {
 				f->is_new_vlan = false;
-				if (!f->vlan.vid)
-					continue;
 				if (f->vlan.tpid == ETH_P_8021Q)
 					set_bit(f->vlan.vid,
 						adapter->vsi.active_cvlans);