Skip to contentSkip to conversation

ixgbe: fix promiscuous mode on VF

PATCH In review Olivier Matz 4 participants 10 messages Apr 6, 2022 – Jun 6, 2022

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

v2 cover ixgbe: fix promiscuous mode on VF

These 2 patches fix issues related to the promiscuous mode on VF.

Comments are welcome,
Olivier

Cc stable at vger.kernel.org
Cc Nicolas Dichtel <[email protected]>

Changes since v1:
- resend with CC intel-wired-lan
- remove CC Hiroshi Shimamoto (address does not exist anymore)

Olivier Matz (2):
ixgbe: fix bcast packets Rx on VF after promisc removal
ixgbe: fix unexpected VLAN Rx in promisc mode on VF

 drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
Signature · 1 line
2.30.2
#1 lore raw

PATCH v2 1/2 ixgbe: fix bcast packets Rx on VF after promisc removal

After a VF requested to remove the promiscuous flag on an interface, the broadcast packets are not received anymore. This breaks some protocols like ARP.

In ixgbe_update_vf_xcast_mode(), we should keep the IXGBE_VMOLR_BAM bit (Broadcast Accept) on promiscuous removal.

This flag is already set by default in ixgbe_set_vmolr() on VF reset.

Fixes 8443c1a4b192 ("ixgbe, ixgbevf: Add new mbox API xcast mode")
Cc stable at vger.kernel.org
Cc Nicolas Dichtel <[email protected]>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c +2 -2
index 7f11c0a8e7a9..8d108a78941b 100644
@@ -1184,9 +1184,9 @@ static int ixgbe_update_vf_xcast_mode(struct ixgbe_adapter *adapter,
 
 	switch (xcast_mode) {
 	case IXGBEVF_XCAST_MODE_NONE:
-		disable = IXGBE_VMOLR_BAM | IXGBE_VMOLR_ROMPE |
+		disable = IXGBE_VMOLR_ROMPE |
 			  IXGBE_VMOLR_MPE | IXGBE_VMOLR_UPE | IXGBE_VMOLR_VPE;
-		enable = 0;
+		enable = IXGBE_VMOLR_BAM;
 		break;
 	case IXGBEVF_XCAST_MODE_MULTI:
 		disable = IXGBE_VMOLR_MPE | IXGBE_VMOLR_UPE | IXGBE_VMOLR_VPE;
Signature · 1 line
2.30.2
Tested-by on v2 1/2
#2 lore raw

RE: [Intel-wired-lan] [PATCH net v2 1/2] ixgbe: fix bcast packets Rx on VF after promisc removal

drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c static int ixgbe_update_vf_xcast_mode(struct

Quoted 37 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Olivier Matz
Sent: Wednesday, April 6, 2022 11:53 AM
To: [email protected]
Cc: Paul Menzel <[email protected]>; [email protected]; [email protected]; Jakub Kicinski <[email protected]>; Nicolas Dichtel <[email protected]>; Paolo Abeni <[email protected]>; David S . Miller <[email protected]>
Subject: [Intel-wired-lan] [PATCH net v2 1/2] ixgbe: fix bcast packets Rx on VF after promisc removal

After a VF requested to remove the promiscuous flag on an interface, the broadcast packets are not received anymore. This breaks some protocols like ARP.

In ixgbe_update_vf_xcast_mode(), we should keep the IXGBE_VMOLR_BAM bit (Broadcast Accept) on promiscuous removal.

This flag is already set by default in ixgbe_set_vmolr() on VF reset.

Fixes 8443c1a4b192 ("ixgbe, ixgbevf: Add new mbox API xcast mode")
Cc Nicolas Dichtel <[email protected]>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c +0 -0
index 7f11c0a8e7a9..8d108a78941b 100644
@@ -1184,9 +1184,9 @@ static int ixgbe_update_vf_xcast_mode(struct

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

#3 lore raw

PATCH v2 2/2 ixgbe: fix unexpected VLAN Rx in promisc mode on VF

In reply to Olivier Matz

When the promiscuous mode is enabled on a VF, the IXGBE_VMOLR_VPE bit (VLAN Promiscuous Enable) is set. This means that the VF will receive packets whose VLAN is not the same than the VLAN of the VF.

For instance, in this situation:

??????????    ??????????    ??????????
?        ?    ?        ?    ?        ?
?        ?    ?        ?    ?        ?
?     VF0??????VF1  VF2??????VF3     ?
?        ?    ?        ?    ?        ?
??????????    ??????????    ??????????

VM1 VM2 VM3

vf 0:  vlan 1000
vf 1:  vlan 1000
vf 2:  vlan 1001
vf 3:  vlan 1001

If we tcpdump on VF3, we see all the packets, even those transmitted on vlan 1000.

This behavior prevents to bridge VF1 and VF2 in VM2, because it will create a loop: packets transmitted on VF1 will be received by VF2 and vice-versa, and bridged again through the software bridge.

This patch remove the activation of VLAN Promiscuous when a VF enables the promiscuous mode. However, the IXGBE_VMOLR_UPE bit (Unicast Promiscuous) is kept, so that a VF receives all packets that has the same VLAN, whatever the destination MAC address.

Fixes 8443c1a4b192 ("ixgbe, ixgbevf: Add new mbox API xcast mode")
Cc stable at vger.kernel.org
Cc Nicolas Dichtel <[email protected]>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c +2 -2
index 8d108a78941b..d4e63f0644c3 100644
@@ -1208,9 +1208,9 @@ static int ixgbe_update_vf_xcast_mode(struct ixgbe_adapter *adapter,
 			return -EPERM;
 		}
 
-		disable = 0;
+		disable = IXGBE_VMOLR_VPE;
 		enable = IXGBE_VMOLR_BAM | IXGBE_VMOLR_ROMPE |
-			 IXGBE_VMOLR_MPE | IXGBE_VMOLR_UPE | IXGBE_VMOLR_VPE;
+			 IXGBE_VMOLR_MPE | IXGBE_VMOLR_UPE;
 		break;
 	default:
 		return -EOPNOTSUPP;
Signature · 1 line
2.30.2
Tested-by on v2 2/2
#4 lore raw

RE: [Intel-wired-lan] [PATCH net v2 2/2] ixgbe: fix unexpected VLAN Rx in promisc mode on VF

drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c static int ixgbe_update_vf_xcast_mode(struct

Quoted 59 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Olivier Matz
Sent: Wednesday, April 6, 2022 11:53 AM
To: [email protected]
Cc: Paul Menzel <[email protected]>; [email protected]; [email protected]; Jakub Kicinski <[email protected]>; Nicolas Dichtel <[email protected]>; Paolo Abeni <[email protected]>; David S . Miller <[email protected]>
Subject: [Intel-wired-lan] [PATCH net v2 2/2] ixgbe: fix unexpected VLAN Rx in promisc mode on VF

When the promiscuous mode is enabled on a VF, the IXGBE_VMOLR_VPE bit (VLAN Promiscuous Enable) is set. This means that the VF will receive packets whose VLAN is not the same than the VLAN of the VF.

For instance, in this situation:

┌────────┐    ┌────────┐    ┌────────┐
│        │    │        │    │        │
│        │    │        │    │        │
│     VF0├────┤VF1  VF2├────┤VF3     │
│        │    │        │    │        │
└────────┘    └────────┘    └────────┘
   VM1           VM2           VM3
vf 0:  vlan 1000
vf 1:  vlan 1000
vf 2:  vlan 1001
vf 3:  vlan 1001

If we tcpdump on VF3, we see all the packets, even those transmitted on vlan 1000.

This behavior prevents to bridge VF1 and VF2 in VM2, because it will create a
loop: packets transmitted on VF1 will be received by VF2 and vice-versa, and bridged again through the software bridge.

This patch remove the activation of VLAN Promiscuous when a VF enables the promiscuous mode. However, the IXGBE_VMOLR_UPE bit (Unicast Promiscuous) is kept, so that a VF receives all packets that has the same VLAN, whatever the destination MAC address.

Fixes 8443c1a4b192 ("ixgbe, ixgbevf: Add new mbox API xcast mode")
Cc Nicolas Dichtel <[email protected]>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c +0 -0
index 8d108a78941b..d4e63f0644c3 100644
@@ -1208,9 +1208,9 @@ static int ixgbe_update_vf_xcast_mode(struct
#5 lore raw
In reply to Olivier Matz

Hi,

Quoted 12 lines · Olivier Matz

These 2 patches fix issues related to the promiscuous mode on VF.

Comments are welcome,
Olivier

Cc stable at vger.kernel.org
Cc Nicolas Dichtel <[email protected]>

Changes since v1:
- resend with CC intel-wired-lan
- remove CC Hiroshi Shimamoto (address does not exist anymore)

Quoted 6 lines

Olivier Matz (2):
ixgbe: fix bcast packets Rx on VF after promisc removal
ixgbe: fix unexpected VLAN Rx in promisc mode on VF

 drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Any feedback about this patchset?
Comments are welcome.

Thanks,
Olivier

#6 lore raw

Hi,

Quoted 19 lines · Olivier Matz

Hi,

Quoted 16 lines · Olivier Matz

These 2 patches fix issues related to the promiscuous mode on VF.

Comments are welcome,
Olivier

Cc stable at vger.kernel.org
Cc Nicolas Dichtel <[email protected]>

Changes since v1:
- resend with CC intel-wired-lan
- remove CC Hiroshi Shimamoto (address does not exist anymore)

Olivier Matz (2):
ixgbe: fix bcast packets Rx on VF after promisc removal
ixgbe: fix unexpected VLAN Rx in promisc mode on VF

Quoted 5 lines
Quoted 2 lines
 drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Any feedback about this patchset?
Comments are welcome.

I didn't get feedback for this patchset until now. Am I doing things correctly? Am I targeting the appropriate mailing lists and people?

Please let me know if I missed something.

Thanks,
Olivier

maintainer
#7 lore raw
Quoted 21 lines · On Tue, 24 May 2022 09:37:52 +0200 Olivier Matz wrote:
Quoted 20 lines · Olivier Matz
Quoted 18 lines · Olivier Matz

These 2 patches fix issues related to the promiscuous mode on VF.

Comments are welcome,
Olivier

Cc stable at vger.kernel.org
Cc Nicolas Dichtel <[email protected]>

Changes since v1:
- resend with CC intel-wired-lan
- remove CC Hiroshi Shimamoto (address does not exist anymore)

Olivier Matz (2):
ixgbe: fix bcast packets Rx on VF after promisc removal
ixgbe: fix unexpected VLAN Rx in promisc mode on VF

 drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)  
Quoted 7 lines
Quoted 2 lines

Any feedback about this patchset?
Comments are welcome.

I didn't get feedback for this patchset until now. Am I doing things correctly? Am I targeting the appropriate mailing lists and people?

Please let me know if I missed something.

You are doing this correctly.. adding a couple more Intel folks.

#8 lore raw

v2 cover ixgbe: fix promiscuous mode on VF

In reply to Olivier Matz
Quoted 23 lines · Olivier Matz
Quoted 22 lines

Hi,

Quoted 18 lines · Olivier Matz

These 2 patches fix issues related to the promiscuous mode on VF.

Comments are welcome,
Olivier

Cc Nicolas Dichtel <[email protected]>

Changes since v1:
- resend with CC intel-wired-lan
- remove CC Hiroshi Shimamoto (address does not exist anymore)

Olivier Matz (2):
ixgbe: fix bcast packets Rx on VF after promisc removal
ixgbe: fix unexpected VLAN Rx in promisc mode on VF

 drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
Quoted 7 lines
Quoted 2 lines

Any feedback about this patchset?
Comments are welcome.

I didn't get feedback for this patchset until now. Am I doing things correctly? Am I targeting the appropriate mailing lists and people?

Please let me know if I missed something.

Hi Olivier,

Sorry for the late reply,
We had to analyze it internally and it took us some time. After reviewing, we decided that the proposed patches could be accepted.

ACK for series.

Thanks,
Piotr

#9 lore raw

Hi Piotr,

Quoted 31 lines · Piotr Skajewski
Quoted 23 lines · Olivier Matz
Quoted 22 lines

Hi,

Quoted 18 lines · Olivier Matz

These 2 patches fix issues related to the promiscuous mode on VF.

Comments are welcome,
Olivier

Cc stable at vger.kernel.org
Cc Nicolas Dichtel <[email protected]>

Changes since v1:
- resend with CC intel-wired-lan
- remove CC Hiroshi Shimamoto (address does not exist anymore)

Olivier Matz (2):
ixgbe: fix bcast packets Rx on VF after promisc removal
ixgbe: fix unexpected VLAN Rx in promisc mode on VF

 drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
Quoted 7 lines
Quoted 2 lines

Any feedback about this patchset?
Comments are welcome.

I didn't get feedback for this patchset until now. Am I doing things correctly? Am I targeting the appropriate mailing lists and people?

Please let me know if I missed something.

Quoted 7 lines

Hi Olivier,

Sorry for the late reply,
We had to analyze it internally and it took us some time. After reviewing, we decided that the proposed patches could be accepted.

ACK for series.

No problem for the delay.
Thank you!

Olivier