Intel-Wired-Lan Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-wired-lan] [PATCH iwl-net] ice: Fix VLAN pruning in switchdev mode
@ 2024-11-04 18:49 Marcin Szycik
  2024-11-22 13:17 ` Buvaneswaran, Sujai
  0 siblings, 1 reply; 2+ messages in thread
From: Marcin Szycik @ 2024-11-04 18:49 UTC (permalink / raw)
  To: intel-wired-lan; +Cc: netdev, Marcin Szycik, Michal Swiatkowski

In switchdev mode the uplink VSI should receive all unmatched packets,
including VLANs. Therefore, VLAN pruning should be disabled if uplink is
in switchdev mode. It is already being done in ice_eswitch_setup_env(),
however the addition of ice_up() in commit 44ba608db509 ("ice: do
switchdev slow-path Rx using PF VSI") caused VLAN pruning to be
re-enabled after disabling it.

Add a check to ice_set_vlan_filtering_features() to ensure VLAN
filtering will not be enabled if uplink is in switchdev mode. Note that
ice_is_eswitch_mode_switchdev() is being used instead of
ice_is_switchdev_running(), as the latter would only return true after
the whole switchdev setup completes.

Fixes: 44ba608db509 ("ice: do switchdev slow-path Rx using PF VSI")
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Signed-off-by: Marcin Szycik <marcin.szycik@linux.intel.com>
---
 drivers/net/ethernet/intel/ice/ice_main.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
index b1e7727b8677..8f2e758c3942 100644
--- a/drivers/net/ethernet/intel/ice/ice_main.c
+++ b/drivers/net/ethernet/intel/ice/ice_main.c
@@ -6361,10 +6361,12 @@ ice_set_vlan_filtering_features(struct ice_vsi *vsi, netdev_features_t features)
 	int err = 0;
 
 	/* support Single VLAN Mode (SVM) and Double VLAN Mode (DVM) by checking
-	 * if either bit is set
+	 * if either bit is set. In switchdev mode Rx filtering should never be
+	 * enabled.
 	 */
-	if (features &
-	    (NETIF_F_HW_VLAN_CTAG_FILTER | NETIF_F_HW_VLAN_STAG_FILTER))
+	if ((features &
+	     (NETIF_F_HW_VLAN_CTAG_FILTER | NETIF_F_HW_VLAN_STAG_FILTER)) &&
+	     !ice_is_eswitch_mode_switchdev(vsi->back))
 		err = vlan_ops->ena_rx_filtering(vsi);
 	else
 		err = vlan_ops->dis_rx_filtering(vsi);
-- 
2.45.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Intel-wired-lan] [PATCH iwl-net] ice: Fix VLAN pruning in switchdev mode
  2024-11-04 18:49 [Intel-wired-lan] [PATCH iwl-net] ice: Fix VLAN pruning in switchdev mode Marcin Szycik
@ 2024-11-22 13:17 ` Buvaneswaran, Sujai
  0 siblings, 0 replies; 2+ messages in thread
From: Buvaneswaran, Sujai @ 2024-11-22 13:17 UTC (permalink / raw)
  To: Marcin Szycik, intel-wired-lan@lists.osuosl.org
  Cc: netdev@vger.kernel.org, Michal Swiatkowski, Singh, PriyaX

> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> Marcin Szycik
> Sent: Tuesday, November 5, 2024 12:19 AM
> To: intel-wired-lan@lists.osuosl.org
> Cc: netdev@vger.kernel.org; Marcin Szycik <marcin.szycik@linux.intel.com>;
> Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
> Subject: [Intel-wired-lan] [PATCH iwl-net] ice: Fix VLAN pruning in switchdev
> mode
> 
> In switchdev mode the uplink VSI should receive all unmatched packets,
> including VLANs. Therefore, VLAN pruning should be disabled if uplink is in
> switchdev mode. It is already being done in ice_eswitch_setup_env(),
> however the addition of ice_up() in commit 44ba608db509 ("ice: do
> switchdev slow-path Rx using PF VSI") caused VLAN pruning to be re-enabled
> after disabling it.
> 
> Add a check to ice_set_vlan_filtering_features() to ensure VLAN filtering will
> not be enabled if uplink is in switchdev mode. Note that
> ice_is_eswitch_mode_switchdev() is being used instead of
> ice_is_switchdev_running(), as the latter would only return true after the
> whole switchdev setup completes.
> 
> Fixes: 44ba608db509 ("ice: do switchdev slow-path Rx using PF VSI")
> Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
> Signed-off-by: Marcin Szycik <marcin.szycik@linux.intel.com>
> ---
>  drivers/net/ethernet/intel/ice/ice_main.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)

Tested-by: Singh, PriyaX <priyax.singh@intel.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-11-22 13:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-04 18:49 [Intel-wired-lan] [PATCH iwl-net] ice: Fix VLAN pruning in switchdev mode Marcin Szycik
2024-11-22 13:17 ` Buvaneswaran, Sujai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox