Skip to contentSkip to conversation

ice: Fixes for double vlan promiscuous mode

PATCH Superseded Grzegorz Siwik 3 participants 11 messages Jul 7, 2022 – Jul 29, 2022

Subsystems (2)

v1 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

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.
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.

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_lib.c    |  8 +++++++-
 drivers/net/ethernet/intel/ice/ice_main.c   | 13 ++++++++++++-
 drivers/net/ethernet/intel/ice/ice_switch.c |  9 ++++++++-
 3 files changed, 27 insertions(+), 3 deletions(-)
Signature · 6 lines
1.8.3.1

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
#1 lore raw

PATCH 1/3 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.

Fixes 5eda8afd6bcc ("ice: Add support for PF/VF promiscuous mode")

Link:
https://lore.kernel.org/all/CAK8fFZ7m-KR57M_rYX6xZN39K89O=LGooYkKsu6HKt0Bs+x6xQ@mail.gmail.com/

---
 drivers/net/ethernet/intel/ice/ice_switch.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/net/ethernet/intel/ice/ice_switch.c +7 -0
index 8d8f3ee..8a60052 100644
@@ -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
#2 lore raw

Re: [Intel-wired-lan] [PATCH net v1 1/3] ice: Fix double VLAN error when entering promisc mode

Quoted 24 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Grzegorz Siwik
Sent: Thursday, July 7, 2022 6:46 PM
To: [email protected]
Cc: Siwik, Grzegorz <[email protected]>
Subject: [Intel-wired-lan] [PATCH net v1 1/3] 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.

Fixes 5eda8afd6bcc ("ice: Add support for PF/VF promiscuous mode")
Quoted 7 lines

Link:
https://lore.kernel.org/all/CAK8fFZ7m-
[email protected]/

---
 drivers/net/ethernet/intel/ice/ice_switch.c | 7 +++++++
 1 file changed, 7 insertions(+)

I could still observe the issue when the ice driver has been removed from the system once after executing creating bridge over bond and then double vlan
_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

#3 lore raw

Re: [Intel-wired-lan] [PATCH net v1 1/3] ice: Fix double VLAN error when entering promisc mode

G, GurucharanX píše v Út 26. 07. 2022 v 05:33 +0000:

Quoted 40 lines
Quoted 32 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of
Grzegorz Siwik
Sent: Thursday, July 7, 2022 6:46 PM
To: [email protected]
Cc: Siwik, Grzegorz <[email protected]>
Subject: [Intel-wired-lan] [PATCH net v1 1/3] 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.

Fixes 5eda8afd6bcc ("ice: Add support for PF/VF promiscuous mode")
Quoted 7 lines

Link:
https://lore.kernel.org/all/CAK8fFZ7m-
[email protected]/
---
 drivers/net/ethernet/intel/ice/ice_switch.c | 7 +++++++

 1 file changed, 7 insertions(+)
Quoted 3 lines

I could still observe the issue when the ice driver has been removed from the system once after executing
creating bridge over bond and then double vlan

Hi,

Is it regression introduced by this patch or this fix is partial and mentioned issue is unfixed regression from past. I asking because promisc mode issues is very pain for us and in second case will be (maybe) good to move this forward and mentioned issue will fix in next patch.

Many thanks,
Petr

Quoted 5 lines

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

#4 lore raw

Re: [Intel-wired-lan] [PATCH net v1 1/3] ice: Fix double VLAN error when entering promisc mode

Quoted 38 lines

G, GurucharanX píše v Út 26. 07. 2022 v 05:33 +0000:

Quoted 33 lines
Quoted 25 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Grzegorz Siwik
Sent: Thursday, July 7, 2022 6:46 PM
To: [email protected]
Cc: Siwik, Grzegorz <[email protected]>
Subject: [Intel-wired-lan] [PATCH net v1 1/3] 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.

Fixes 5eda8afd6bcc ("ice: Add support for PF/VF promiscuous mode")
Quoted 7 lines

Link:
https://lore.kernel.org/all/CAK8fFZ7m-
[email protected]/

---
 drivers/net/ethernet/intel/ice/ice_switch.c | 7 +++++++
 1 file changed, 7 insertions(+)
Quoted 3 lines

I could still observe the issue when the ice driver has been removed from the system once after executing creating bridge over bond and then double vlan

Quoted 7 lines

Hi,

Is it regression introduced by this patch or this fix is partial and mentioned issue is unfixed regression from past. I asking because promisc mode issues is very pain for us and in second case will be (maybe) good to move this forward and mentioned issue will fix in next patch.

Many thanks,
Petr

Hi,
We are currently investigating what is wrong with that - it is possible that i have something missed in upstreaming one of these patches. We let know when we find what is wrong.

Best Regards,
Grzegorz

Quoted 4 lines
Quoted 4 lines

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

#5 lore raw

Re: [Intel-wired-lan] [PATCH net v1 1/3] ice: Fix double VLAN error when entering promisc mode

Quoted 46 lines
Quoted 46 lines

G, GurucharanX píše v Út 26. 07. 2022 v 05:33 +0000:

Quoted 34 lines
Quoted 26 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Grzegorz Siwik
Sent: Thursday, July 7, 2022 6:46 PM
To: [email protected]
Cc: Siwik, Grzegorz <[email protected]>
Subject: [Intel-wired-lan] [PATCH net v1 1/3] 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.

Fixes 5eda8afd6bcc ("ice: Add support for PF/VF promiscuous

mode")

Quoted 7 lines

Link:
https://lore.kernel.org/all/CAK8fFZ7m-
[email protected]/

---
 drivers/net/ethernet/intel/ice/ice_switch.c | 7 +++++++
 1 file changed, 7 insertions(+)
Quoted 3 lines

I could still observe the issue when the ice driver has been removed from the system once after executing creating bridge over bond and then double vlan

Hi,

Is it regression introduced by this patch or this fix is partial and mentioned issue is unfixed regression from past. I asking because promisc mode issues is very pain for us and in second case will be (maybe) good to move this forward and mentioned issue will fix in next patch.

Quoted 8 lines
Quoted 2 lines

Many thanks,
Petr

Hi,
We are currently investigating what is wrong with that - it is possible that i have something missed in upstreaming one of these patches. We let know when we find what is wrong.

Best Regards,
Grzegorz

Hi Guys,

We found what is wrong - we have not backported one of the patch from RedHat - so i didn't know that this problem could exist. Soon we will send fix for reported issues.

Best Regards,
Grzegorz

Quoted 5 lines
Quoted 4 lines
Quoted 4 lines

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

#6 lore raw

PATCH 2/3 ice: Ignore ERR_ALREADY_EXISTS when setting promisc mode

In reply to Grzegorz Siwik

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.
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")

Link:
https://lore.kernel.org/all/CAK8fFZ7m-KR57M_rYX6xZN39K89O=LGooYkKsu6HKt0Bs+x6xQ@mail.gmail.com/

---
 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
index 8a60052..0aa4871 100644
@@ -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
Tested-by on v1 2/3
#7 lore raw

Re: [Intel-wired-lan] [PATCH net v1 2/3] ice: Ignore ERR_ALREADY_EXISTS when setting promisc mode

Quoted 21 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Grzegorz Siwik
Sent: Thursday, July 7, 2022 6:46 PM
To: [email protected]
Cc: Siwik, Grzegorz <[email protected]>
Subject: [Intel-wired-lan] [PATCH net v1 2/3] ice: Ignore ERR_ALREADY_EXISTS when setting promisc mode

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.
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")
Quoted 7 lines

Link:
https://lore.kernel.org/all/CAK8fFZ7m-
[email protected]/

---
 drivers/net/ethernet/intel/ice/ice_switch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

#8 lore raw

PATCH 3/3 ice: Fix clearing of promisc mode with bridge over bond

In reply to 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!
Fixes c31af68a1b94 ("ice: Add outer_vlan_ops and VSI specific VLAN ops implementations")

Link:
https://lore.kernel.org/all/CAK8fFZ7m-KR57M_rYX6xZN39K89O=LGooYkKsu6HKt0Bs+x6xQ@mail.gmail.com/

---
 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
index f7f9c97..251012d 100644
@@ -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
index c1ac2f7..c4f89c1 100644
@@ -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
Tested-by on v1 3/3
#9 lore raw

Re: [Intel-wired-lan] [PATCH net v1 3/3] ice: Fix clearing of promisc mode with bridge over bond

Quoted 36 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Grzegorz Siwik
Sent: Thursday, July 7, 2022 6:46 PM
To: [email protected]
Cc: Brandeburg, Jesse <[email protected]>; Siwik, Grzegorz <[email protected]>
Subject: [Intel-wired-lan] [PATCH net v1 3/3] ice: Fix clearing of promisc mode with bridge over bond

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!

Fixes c31af68a1b94 ("ice: Add outer_vlan_ops and VSI specific VLAN ops

implementations")

Quoted 8 lines

Link:
https://lore.kernel.org/all/CAK8fFZ7m-
[email protected]/

---
 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(-)

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

Tested-by on the v1 series
#10 lore raw
In reply to Grzegorz Siwik

Grzegorz Siwik píše v Čt 07. 07. 2022 v 15:15 +0200:

Quoted 21 lines

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.
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.

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

Quoted 5 lines

 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 ++++++++-

 3 files changed, 27 insertions(+), 3 deletions(-)

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan