Skip to content

Commit 8edfc7a

Browse files
orospanguy11
authored andcommitted
ice: fix enabling RX VLAN filtering
ice_port_vlan_on/off() was introduced in commit 2946204 ("ice: implement bridge port vlan"). But ice_port_vlan_on() incorrectly assigns ena_rx_filtering to inner_vlan_ops in DVM mode. This causes an error when rx_filtering cannot be enabled in legacy mode. Reproducer: echo 1 > /sys/class/net/$PF/device/sriov_numvfs ip link set $PF vf 0 spoofchk off trust on vlan 3 dmesg: ice 0000:41:00.0: failed to enable Rx VLAN filtering for VF 0 VSI 9 during VF rebuild, error -95 Fixes: 2946204 ("ice: implement bridge port vlan") Signed-off-by: Petr Oros <[email protected]> Reviewed-by: Michal Swiatkowski <[email protected]> Tested-by: Rafal Romanowski <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent 90ca695 commit 8edfc7a

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

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

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,24 +26,22 @@ static void ice_port_vlan_on(struct ice_vsi *vsi)
2626
struct ice_vsi_vlan_ops *vlan_ops;
2727
struct ice_pf *pf = vsi->back;
2828

29-
if (ice_is_dvm_ena(&pf->hw)) {
30-
vlan_ops = &vsi->outer_vlan_ops;
31-
32-
/* setup outer VLAN ops */
33-
vlan_ops->set_port_vlan = ice_vsi_set_outer_port_vlan;
34-
vlan_ops->clear_port_vlan = ice_vsi_clear_outer_port_vlan;
29+
/* setup inner VLAN ops */
30+
vlan_ops = &vsi->inner_vlan_ops;
3531

36-
/* setup inner VLAN ops */
37-
vlan_ops = &vsi->inner_vlan_ops;
32+
if (ice_is_dvm_ena(&pf->hw)) {
3833
vlan_ops->add_vlan = noop_vlan_arg;
3934
vlan_ops->del_vlan = noop_vlan_arg;
4035
vlan_ops->ena_stripping = ice_vsi_ena_inner_stripping;
4136
vlan_ops->dis_stripping = ice_vsi_dis_inner_stripping;
4237
vlan_ops->ena_insertion = ice_vsi_ena_inner_insertion;
4338
vlan_ops->dis_insertion = ice_vsi_dis_inner_insertion;
44-
} else {
45-
vlan_ops = &vsi->inner_vlan_ops;
4639

40+
/* setup outer VLAN ops */
41+
vlan_ops = &vsi->outer_vlan_ops;
42+
vlan_ops->set_port_vlan = ice_vsi_set_outer_port_vlan;
43+
vlan_ops->clear_port_vlan = ice_vsi_clear_outer_port_vlan;
44+
} else {
4745
vlan_ops->set_port_vlan = ice_vsi_set_inner_port_vlan;
4846
vlan_ops->clear_port_vlan = ice_vsi_clear_inner_port_vlan;
4947
}

0 commit comments

Comments
 (0)