Skip to content

Commit c793f8e

Browse files
bcreeley13anguy11
authored andcommitted
ice: Fix disabling Rx VLAN filtering with port VLAN enabled
If the user turns on the vf-true-promiscuous-support flag, then Rx VLAN filtering will be disabled if the VF requests to enable promiscuous mode. When the VF is in a port VLAN, this is the incorrect behavior because it will allow the VF to receive traffic outside of its port VLAN domain. Fortunately this only resulted in the VF(s) receiving broadcast traffic outside of the VLAN domain because all of the VLAN promiscuous rules are based on the port VLAN ID. Fix this by setting the .disable_rx_filtering VLAN op to a no-op when a port VLAN is enabled on the VF. Also, make sure to make this fix for both Single VLAN Mode and Double VLAN Mode enabled devices. Fixes: c31af68 ("ice: Add outer_vlan_ops and VSI specific VLAN ops implementations") Signed-off-by: Brett Creeley <[email protected]> Signed-off-by: Karen Ostrowska <[email protected]> Tested-by: Marek Szlosek <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent b2dbde3 commit c793f8e

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

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

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,17 @@ void ice_vf_vsi_init_vlan_ops(struct ice_vsi *vsi)
4444

4545
/* outer VLAN ops regardless of port VLAN config */
4646
vlan_ops->add_vlan = ice_vsi_add_vlan;
47-
vlan_ops->dis_rx_filtering = ice_vsi_dis_rx_vlan_filtering;
4847
vlan_ops->ena_tx_filtering = ice_vsi_ena_tx_vlan_filtering;
4948
vlan_ops->dis_tx_filtering = ice_vsi_dis_tx_vlan_filtering;
5049

5150
if (ice_vf_is_port_vlan_ena(vf)) {
5251
/* setup outer VLAN ops */
5352
vlan_ops->set_port_vlan = ice_vsi_set_outer_port_vlan;
53+
/* all Rx traffic should be in the domain of the
54+
* assigned port VLAN, so prevent disabling Rx VLAN
55+
* filtering
56+
*/
57+
vlan_ops->dis_rx_filtering = noop_vlan;
5458
vlan_ops->ena_rx_filtering =
5559
ice_vsi_ena_rx_vlan_filtering;
5660

@@ -63,6 +67,9 @@ void ice_vf_vsi_init_vlan_ops(struct ice_vsi *vsi)
6367
vlan_ops->ena_insertion = ice_vsi_ena_inner_insertion;
6468
vlan_ops->dis_insertion = ice_vsi_dis_inner_insertion;
6569
} else {
70+
vlan_ops->dis_rx_filtering =
71+
ice_vsi_dis_rx_vlan_filtering;
72+
6673
if (!test_bit(ICE_FLAG_VF_VLAN_PRUNING, pf->flags))
6774
vlan_ops->ena_rx_filtering = noop_vlan;
6875
else
@@ -96,7 +103,14 @@ void ice_vf_vsi_init_vlan_ops(struct ice_vsi *vsi)
96103
vlan_ops->set_port_vlan = ice_vsi_set_inner_port_vlan;
97104
vlan_ops->ena_rx_filtering =
98105
ice_vsi_ena_rx_vlan_filtering;
106+
/* all Rx traffic should be in the domain of the
107+
* assigned port VLAN, so prevent disabling Rx VLAN
108+
* filtering
109+
*/
110+
vlan_ops->dis_rx_filtering = noop_vlan;
99111
} else {
112+
vlan_ops->dis_rx_filtering =
113+
ice_vsi_dis_rx_vlan_filtering;
100114
if (!test_bit(ICE_FLAG_VF_VLAN_PRUNING, pf->flags))
101115
vlan_ops->ena_rx_filtering = noop_vlan;
102116
else

0 commit comments

Comments
 (0)