ice: Fixes for double vlan promiscuous mode
Subsystems (2)
v2 cover ice: Fixes for double vlan promiscuous mode
This series fixes known issues related to double vlan promiscuous mode. When at least two interfaces are bonded and a bridge is enabled on the bond, an error can occur when the bridge is removed and re-added. The reason for the error is because promiscuous mode was not fully cleared from the VLAN VSI in the hardware.
Ignore ERR_ALREADY_EXISTS error when setting promiscuous mode. This fix is needed because the driver could set promiscuous mode when it still has not cleared properly.
If the requested promiscuous mode setting already exists,
an -EEXIST error message would be printed.
This is incorrect because promiscuous mode is
either on/off and shouldn't print an error when the requested configuration is already set.
Avoid enabling or disabling vlan 0 when trying to set promiscuous vlan mode if double vlan mode is enabled. This fix is needed because the driver tries to add the vlan 0 filter twice (once for inner and once for outer) when double VLAN mode is enabled.
---
v2: Fixed error message when setting same promiscuous mode
---
Benjamin Mikailenko (1):
ice: Ignore error message when setting same promiscuous mode
Grzegorz Siwik (3):
ice: Fix double VLAN error when entering promisc mode
ice: Ignore ERR_ALREADY_EXISTS when setting promisc mode
ice: Fix clearing of promisc mode with bridge over bond
drivers/net/ethernet/intel/ice/ice_fltr.c | 8 ++++---- drivers/net/ethernet/intel/ice/ice_lib.c | 8 +++++++- drivers/net/ethernet/intel/ice/ice_main.c | 13 ++++++++++++- drivers/net/ethernet/intel/ice/ice_switch.c | 9 ++++++++- 4 files changed, 31 insertions(+), 7 deletions(-)
Signature · 6 lines
1.8.3.1 _______________________________________________ Intel-wired-lan mailing list [email protected] https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
PATCH v2 1/4 ice: Fix double VLAN error when entering promisc mode
Avoid enabling or disabling vlan 0 when trying to set promiscuous vlan mode if double vlan mode is enabled. This fix is needed because the driver tries to add the vlan 0 filter twice (once for inner and once for outer) when double VLAN mode is enabled. The filter program is rejected by the firmware when double vlan is enabled, because the promiscuous filter only needs to be set once.
This issue was missed in the initial implementation of double vlan mode.
Link:
https://lore.kernel.org/all/CAK8fFZ7m-KR57M_rYX6xZN39K89O=LGooYkKsu6HKt0Bs+x6xQ@mail.gmail.com/
---
v2: Fixed error message when setting same promiscuous mode
--- drivers/net/ethernet/intel/ice/ice_switch.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/net/ethernet/intel/ice/ice_switch.c +7 -0
@@ -4414,6 +4414,13 @@ static u8 ice_determine_promisc_mask(struct ice_fltr_info *fi) goto free_fltr_list;list_for_each_entry (list_itr, &vsi_list_head, list_entry) { +/* Avoid enabling or disabling vlan zero twice when in double +* vlan mode +*/ +if (ice_is_dvm_ena (hw) && + list_itr->fltr_info.l_data.vlan.tpid ==0 ) +continue ; + vlan_id = list_itr->fltr_info.l_data.vlan.vlan_id;if (rm_vlan_promisc) status = ice_clear_vsi_promisc(hw, vsi_handle,
Signature · 6 lines
1.8.3.1 _______________________________________________ Intel-wired-lan mailing list [email protected] https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
PATCH v2 2/4 ice: Ignore ERR_ALREADY_EXISTS when setting promisc mode
In reply to Grzegorz SiwikIgnore ERR_ALREADY_EXISTS error when setting promiscuous mode. This fix is needed because the driver could set promiscuous mode when it still has not cleared properly.
Promiscuous mode could be set only once, so setting it second time will be rejected.
Link:
https://lore.kernel.org/all/CAK8fFZ7m-KR57M_rYX6xZN39K89O=LGooYkKsu6HKt0Bs+x6xQ@mail.gmail.com/
---
v2: Fixed error message when setting same promiscuous mode
--- drivers/net/ethernet/intel/ice/ice_switch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/ice/ice_switch.c +1 -1
@@ -4428,7 +4428,7 @@ static u8 ice_determine_promisc_mask(struct ice_fltr_info *fi)else status =ice_set_vsi_promisc (hw, vsi_handle, promisc_mask, vlan_id); -if (status) +if (status && status != -EEXIST )break ; }
Signature · 6 lines
1.8.3.1 _______________________________________________ Intel-wired-lan mailing list [email protected] https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
Tony Nguyen
maintainerRe: [Intel-wired-lan] [PATCH net v2 2/4] ice: Ignore ERR_ALREADY_EXISTS when setting promisc mode
Quoted 1 line · Grzegorz Siwik
Ignore
ERR_ALREADY_EXISTSerror when setting promiscuous mode.
Isn't this EEXIST, not ERR_ALREADY_EXISTS?
Quoted 9 lines
This fix is needed because the driver could set promiscuous mode when it still has not cleared properly.
Promiscuous mode could be set only once, so setting it second time will be rejected.Fixes 5eda8afd6bcc ("ice: Add support for PF/VF promiscuous mode")Signed-off-by Grzegorz Siwik <[email protected]>Link:
https://lore.kernel.org/all/CAK8fFZ7m-KR57M_rYX6xZN39K89O=LGooYkKsu6HKt0Bs+x6xQ@mail.gmail.com/
Please, no newline after Link:, keep it all on the same line. Same comment for all the other patches as well.
Quoted 11 lines
---
v2: Fixed error message when setting same promiscuous mode--- drivers/net/ethernet/intel/ice/ice_switch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/ethernet/intel/ice/ice_switch.c +0
-0
drivers/net/ethernet/intel/ice/ice_switch.c static u8 ice_determine_promisc_mask(struct ice_fltr_info *fi) · line 4434
Quoted 8 lines
drivers/net/ethernet/intel/ice/ice_switch.c +1
-1@@ -4428,7 +4428,7 @@ static u8 ice_determine_promisc_mask(struct ice_fltr_info *fi)else status =ice_set_vsi_promisc (hw, vsi_handle, promisc_mask, vlan_id); -if (status) +if (status && status != -EEXIST )break ; }
_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
PATCH v2 3/4 ice: Fix clearing of promisc mode with bridge over bond
In reply to Grzegorz SiwikWhen at least two interfaces are bonded and a bridge is enabled on the bond, an error can occur when the bridge is removed and re-added. The reason for the error is because promiscuous mode was not fully cleared from the VLAN VSI in the hardware. With this change, promiscuous mode is properly removed when the bridge disconnects from bonding.
[ 1033.676359] bond1: link status definitely down for interface enp95s0f0, disabling it [ 1033.676366] bond1: making interface enp175s0f0 the new active one [ 1033.676369] device enp95s0f0 left promiscuous mode [ 1033.676522] device enp175s0f0 entered promiscuous mode [ 1033.676901] ice 0000:af:00.0 enp175s0f0: Error setting Multicast promiscuous mode on VSI 6 [ 1041.795662] ice 0000:af:00.0 enp175s0f0: Error setting Multicast promiscuous mode on VSI 6 [ 1041.944826] bond1: link status definitely down for interface enp175s0f0, disabling it [ 1041.944874] device enp175s0f0 left promiscuous mode [ 1041.944918] bond1: now running without any active interface!
Testing Hints (required if no HSD): Create bonding and
add bridge to bond. Test VLAN add/removal and make sure VLAN works correctly. Test combinations of bridge module and VLAN, bridge and bond, and bridge over the PF.
Link:
https://lore.kernel.org/all/CAK8fFZ7m-KR57M_rYX6xZN39K89O=LGooYkKsu6HKt0Bs+x6xQ@mail.gmail.com/
---
v2: Fixed error message when setting same promiscuous mode
--- drivers/net/ethernet/intel/ice/ice_lib.c | 8 +++++++- drivers/net/ethernet/intel/ice/ice_main.c | 13 ++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/ice/ice_lib.c +7 -1
@@ -4078,7 +4078,13 @@ int ice_vsi_del_vlan_zero(struct ice_vsi *vsi)if (err && err != -EEXIST )return err; -return 0 ; +/* when deleting the last VLAN filter, make sure to disable the VLAN +* promisc mode so the filter isn't left by accident +*/ + err =ice_clear_vsi_promisc (&vsi->back->hw, vsi->idx, +ICE_MCAST_VLAN_PROMISC_BITS ,0 ); + +return err; }/**
drivers/net/ethernet/intel/ice/ice_main.c +12 -1
@@ -267,8 +267,10 @@ static int ice_set_promisc(struct ice_vsi *vsi, u8 promisc_m) status =ice_fltr_set_vsi_promisc (&vsi->back->hw, vsi->idx, promisc_m,0 ); } +if (status && status != -EEXIST ) +return status; -return status; +return 0 ; }/**
@@ -3572,6 +3574,15 @@ struct ice_vsi *while (test_and_set_bit (ICE_CFG_BUSY , vsi->state))usleep_range (1000 ,2000 ); + ret =ice_clear_vsi_promisc (&vsi->back->hw, vsi->idx, +ICE_MCAST_VLAN_PROMISC_BITS , vid); + +if (ret) { +netdev_err (netdev,"Error clearing multicast promiscuous mode on VSI %i\n" , + vsi->vsi_num); + vsi->current_netdev_flags |=IFF_ALLMULTI ; + } + vlan_ops =ice_get_compat_vsi_vlan_ops (vsi);/* Make sure VLAN delete is successful before updating VLAN
Signature · 6 lines
1.8.3.1 _______________________________________________ Intel-wired-lan mailing list [email protected] https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
Tony Nguyen
maintainerRe: [Intel-wired-lan] [PATCH net v2 3/4] ice: Fix clearing of promisc mode with bridge over bond
Quoted 16 lines · Grzegorz Siwik
When at least two interfaces are bonded and a bridge is enabled on the bond, an error can occur when the bridge is removed and re-added. The reason for the error is because promiscuous mode was not fully cleared from the VLAN VSI in the hardware. With this change, promiscuous mode is properly removed when the bridge disconnects from bonding.
[ 1033.676359] bond1: link status definitely down for interface enp95s0f0, disabling it [ 1033.676366] bond1: making interface enp175s0f0 the new active one [ 1033.676369] device enp95s0f0 left promiscuous mode [ 1033.676522] device enp175s0f0 entered promiscuous mode [ 1033.676901] ice 0000:af:00.0 enp175s0f0: Error setting Multicast promiscuous mode on VSI 6 [ 1041.795662] ice 0000:af:00.0 enp175s0f0: Error setting Multicast promiscuous mode on VSI 6 [ 1041.944826] bond1: link status definitely down for interface enp175s0f0, disabling it [ 1041.944874] device enp175s0f0 left promiscuous mode [ 1041.944918] bond1: now running without any active interface!
Quoted 1 line
Testing Hints (required if no HSD): Create bonding and
HSD?
Quoted 22 lines
add bridge to bond. Test VLAN add/removal and make sure VLAN works correctly. Test combinations of bridge module and VLAN, bridge and bond, and bridge over the PF.
Fixes c31af68a1b94 ("ice: Add outer_vlan_ops and VSI specific VLAN ops implementations")Signed-off-by Grzegorz Siwik <[email protected]>Co-developed-by Jesse Brandeburg <[email protected]>Signed-off-by Jesse Brandeburg <[email protected]>Link:
https://lore.kernel.org/all/CAK8fFZ7m-KR57M_rYX6xZN39K89O=LGooYkKsu6HKt0Bs+x6xQ@mail.gmail.com/
---
v2: Fixed error message when setting same promiscuous mode--- drivers/net/ethernet/intel/ice/ice_lib.c | 8 +++++++- drivers/net/ethernet/intel/ice/ice_main.c | 13 ++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-)drivers/net/ethernet/intel/ice/ice_lib.c +0
-0
drivers/net/ethernet/intel/ice/ice_lib.c int ice_vsi_del_vlan_zero(struct ice_vsi *vsi) · line 4085
Quoted 9 lines
drivers/net/ethernet/intel/ice/ice_lib.c +5
-1@@ -4078,7 +4078,13 @@ int ice_vsi_del_vlan_zero(struct ice_vsi *vsi)if (err && err != -EEXIST )return err; -return 0 ; +/* when deleting the last VLAN filter, make sure to disable the VLAN +* promisc mode so the filter isn't left by accident +*/ + err =ice_clear_vsi_promisc (&vsi->back->hw, vsi->idx, +ICE_MCAST_VLAN_PROMISC_BITS ,0 );
This can be returned directly, not need to assign it to return in next line.
Quoted 22 lines
drivers/net/ethernet/intel/ice/ice_lib.c +2
-0+ +return err; }/** drivers/net/ethernet/intel/ice/ice_main.c +3
-1@@ -267,8 +267,10 @@ static int ice_set_promisc(struct ice_vsi *vsi, u8 promisc_m) status =ice_fltr_set_vsi_promisc (&vsi->back->hw, vsi->idx, promisc_m,0 ); } +if (status && status != -EEXIST ) +return status; -return status; +return 0 ; }/**
drivers/net/ethernet/intel/ice/ice_main.c struct ice_vsi * · line 3580
Quoted 7 lines
drivers/net/ethernet/intel/ice/ice_main.c +4
-0@@ -3572,6 +3574,15 @@ struct ice_vsi *while (test_and_set_bit (ICE_CFG_BUSY , vsi->state))usleep_range (1000 ,2000 ); + ret =ice_clear_vsi_promisc (&vsi->back->hw, vsi->idx, +ICE_MCAST_VLAN_PROMISC_BITS , vid); + +if (ret) {
No newline between error check and the call.
drivers/net/ethernet/intel/ice/ice_main.c struct ice_vsi * · line 3588
Quoted 8 lines
drivers/net/ethernet/intel/ice/ice_main.c +5
-0+netdev_err (netdev,"Error clearing multicast promiscuous mode on VSI %i\n" , + vsi->vsi_num); + vsi->current_netdev_flags |=IFF_ALLMULTI ; + } + vlan_ops =ice_get_compat_vsi_vlan_ops (vsi);/* Make sure VLAN delete is successful before updating VLAN
_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
PATCH v2 4/4 ice: Ignore error message when setting same promiscuous mode
In reply to Grzegorz SiwikFrom: Benjamin Mikailenko <[email protected]>
Commit 1273f89578f2 ("ice-linux: Fix broken IFF_ALLMULTI handling") introduced new checks when setting/clearing promiscuous mode. But if the requested promiscuous mode setting already exists, an -EEXIST error message would be printed. This is incorrect because promiscuous mode is either on/off and shouldn't print an error when the requested configuration is already set.
This can happen when removing a bridge with two bonded interfaces and promiscuous most isn't fully cleared from VLAN VSI in hardware.
Fix this by ignoring cases where requested promiscuous mode exists.
Link:
https://lore.kernel.org/all/CAK8fFZ7m-KR57M_rYX6xZN39K89O=LGooYkKsu6HKt0Bs+x6xQ@mail.gmail.com/
---
v2: Fixed error message when setting same promiscuous mode
--- drivers/net/ethernet/intel/ice/ice_fltr.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/net/ethernet/intel/ice/ice_fltr.c +4 -4
@@ -62,7 +62,7 @@ void ice_fltr_free_list(struct device *dev, struct list_head *h)int result; result =ice_set_vlan_vsi_promisc (hw, vsi->idx, promisc_mask, false); -if (result) +if (result && result != -EEXIST )dev_err (ice_pf_to_dev (pf),"Error setting promisc mode on VSI %i (rc=%d)\n" , vsi->vsi_num, result);
@@ -86,7 +86,7 @@ void ice_fltr_free_list(struct device *dev, struct list_head *h)int result; result =ice_set_vlan_vsi_promisc (hw, vsi->idx, promisc_mask, true); -if (result) +if (result && result != -EEXIST )dev_err (ice_pf_to_dev (pf),"Error clearing promisc mode on VSI %i (rc=%d)\n" , vsi->vsi_num, result);
@@ -109,7 +109,7 @@ void ice_fltr_free_list(struct device *dev, struct list_head *h)int result; result =ice_clear_vsi_promisc (hw, vsi_handle, promisc_mask, vid); -if (result) +if (result && result != -EEXIST )dev_err (ice_pf_to_dev (pf),"Error clearing promisc mode on VSI %i for VID %u (rc=%d)\n" ,ice_get_hw_vsi_num (hw, vsi_handle), vid, result);
@@ -132,7 +132,7 @@ void ice_fltr_free_list(struct device *dev, struct list_head *h)int result; result =ice_set_vsi_promisc (hw, vsi_handle, promisc_mask, vid); -if (result) +if (result && result != -EEXIST )dev_err (ice_pf_to_dev (pf),"Error setting promisc mode on VSI %i for VID %u (rc=%d)\n" ,ice_get_hw_vsi_num (hw, vsi_handle), vid, result);
Signature · 6 lines
1.8.3.1 _______________________________________________ Intel-wired-lan mailing list [email protected] https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
Tony Nguyen
maintainerRe: [Intel-wired-lan] [PATCH net v2 4/4] ice: Ignore error message when setting same promiscuous mode
Quoted 3 lines · Grzegorz Siwik
From: Benjamin Mikailenko <[email protected]>
Commit
1273f89578f2("ice-linux: Fix brokenIFF_ALLMULTIhandling")
ice-linux? Isn't this just "ice"?
Quoted 6 lines
introduced new checks when setting/clearing promiscuous mode. But if the requested promiscuous mode setting already exists, an
-EEXISTerror message would be printed. This is incorrect because promiscuous mode is either on/off and shouldn't print an error when the requested configuration is already set.
Quoted 6 lines
This can happen when removing a bridge with two bonded interfaces and promiscuous most isn't fully cleared from VLAN VSI in hardware.
Fix this by ignoring cases where requested promiscuous mode exists.
Fixes 1273f89578f2 ("ice-linux: Fix broken IFF_ALLMULTI handling")
Which is also incorrect here:
Fixes tag: Fixes: 1273f89578f2 ("ice-linux: Fix broken IFF_ALLMULTI handling")
Has these problem(s):
- Subject does not match target commit subject
Quoted 2 lines
Signed-off-by Benjamin Mikailenko <[email protected]>Signed-off-by Grzegorz Siwik <[email protected]>
_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan