Skip to content

Commit 761e0be

Browse files
Marcin Szycikanguy11
authored andcommitted
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 44ba608 ("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: 44ba608 ("ice: do switchdev slow-path Rx using PF VSI") Reviewed-by: Michal Swiatkowski <[email protected]> Signed-off-by: Marcin Szycik <[email protected]> Tested-by: Priya Singh <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent 9ee87d2 commit 761e0be

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

drivers/net/ethernet/intel/ice/ice_main.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6408,10 +6408,12 @@ ice_set_vlan_filtering_features(struct ice_vsi *vsi, netdev_features_t features)
64086408
int err = 0;
64096409

64106410
/* support Single VLAN Mode (SVM) and Double VLAN Mode (DVM) by checking
6411-
* if either bit is set
6411+
* if either bit is set. In switchdev mode Rx filtering should never be
6412+
* enabled.
64126413
*/
6413-
if (features &
6414-
(NETIF_F_HW_VLAN_CTAG_FILTER | NETIF_F_HW_VLAN_STAG_FILTER))
6414+
if ((features &
6415+
(NETIF_F_HW_VLAN_CTAG_FILTER | NETIF_F_HW_VLAN_STAG_FILTER)) &&
6416+
!ice_is_eswitch_mode_switchdev(vsi->back))
64156417
err = vlan_ops->ena_rx_filtering(vsi);
64166418
else
64176419
err = vlan_ops->dis_rx_filtering(vsi);

0 commit comments

Comments
 (0)