ice: Fix VF not able to send tagged traffic with no VLAN filters
Subsystems (2)
PATCH v2 1/1 ice: Fix VF not able to send tagged traffic with no VLAN filters
From: Sylwester Dziedziuch <[email protected]>
VF was not able to send tagged traffic when it didn't have any VLAN interfaces and VLAN anti-spoofing was enabled. Fix this by allowing VFs with no VLAN filters to send tagged traffic. After VF adds a VLAN interface it will be able to send tagged traffic matching VLAN filters only.
Testing hints:
1. Spawn VF
2. Send tagged packet from a VF
3. The packet should be sent out and not dropped
4. Add a VLAN interface on VF
5. Send tagged packet on that VLAN interface
6. Packet should be sent out and not dropped
7. Send tagged packet with id different than VLAN interface
8. Packet should be dropped
---
v2: Removed Unnecessary parentheses around 'vsi->type != ICE_VSI_VF'
Unfortunetly some lines must be over 80 char to make the code more readable
--- drivers/net/ethernet/intel/ice/ice_vf_lib.c | 11 ++-- drivers/net/ethernet/intel/ice/ice_virtchnl.c | 57 ++++++++++++++++--- 2 files changed, 57 insertions(+), 11 deletions(-)
drivers/net/ethernet/intel/ice/ice_vf_lib.c +7 -4
@@ -707,13 +707,16 @@ static int ice_cfg_mac_antispoof(struct ice_vsi *vsi, bool enable)static int ice_vsi_ena_spoofchk (struct ice_vsi *vsi) {struct ice_vsi_vlan_ops *vlan_ops; -int err; +int err =0 ; vlan_ops =ice_get_compat_vsi_vlan_ops (vsi); - err = vlan_ops->ena_tx_filtering (vsi); -if (err) -return err; +/* Allow VF with VLAN 0 only to send all tagged traffic */ +if (vsi->type !=ICE_VSI_VF ||ice_vsi_has_non_zero_vlans (vsi)) { + err = vlan_ops->ena_tx_filtering (vsi); +if (err) +return err; + }return ice_cfg_mac_antispoof (vsi, true); }
drivers/net/ethernet/intel/ice/ice_virtchnl.c +50 -7
94 lines not on this page · raw message
Signature · 6 lines
2.27.0 _______________________________________________ Intel-wired-lan mailing list [email protected] https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
drivers/net/ethernet/intel/ice/ice_vf_lib.c static int ice_cfg_mac_antispoof(struct ice_vsi *vsi,
Quoted 45 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Mateusz Palczewski
Sent: Wednesday, August 3, 2022 10:43 AM
To: [email protected]
Cc: Dziedziuch, SylwesterX <[email protected]>
Subject: [Intel-wired-lan] [PATCH net v2] ice: Fix VF not able to send tagged traffic with no VLAN filtersFrom: Sylwester Dziedziuch <[email protected]>
VF was not able to send tagged traffic when it didn't have any VLAN interfaces and VLAN anti-spoofing was enabled.
Fix this by allowing VFs with no VLAN filters to send tagged traffic. After VF adds a VLAN interface it will be able to send tagged traffic matching VLAN filters only.Testing hints:
1. Spawn VF
2. Send tagged packet from a VF
3. The packet should be sent out and not dropped 4. Add a VLAN interface on VF 5. Send tagged packet on that VLAN interface 6. Packet should be sent out and not dropped 7. Send tagged packet with id different than VLAN interface
8. Packet should be droppedFixes daf4dd16438b ("ice: Refactor spoofcheck configuration functions")Signed-off-by Sylwester Dziedziuch <[email protected]>Signed-off-by Mateusz Palczewski <[email protected]>---
v2: Removed Unnecessary parentheses around 'vsi->type!=ICE_VSI_VF'
Unfortunetly some lines must be over 80 char to make the code more
readable--- drivers/net/ethernet/intel/ice/ice_vf_lib.c | 11 ++-- drivers/net/ethernet/intel/ice/ice_virtchnl.c | 57 ++++++++++++++++--- 2 files changed, 57 insertions(+), 11 deletions(-)drivers/net/ethernet/intel/ice/ice_vf_lib.c +0
-0@@ -707,13 +707,16 @@ static int ice_cfg_mac_antispoof(struct ice_vsi *vsi,
_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan