OSDN Git Service

fm10k: setup VLANs for l2 accelerated macvlan interfaces
authorJacob Keller <jacob.e.keller@intel.com>
Thu, 12 Apr 2018 18:15:54 +0000 (11:15 -0700)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Wed, 9 May 2018 14:12:03 +0000 (07:12 -0700)
commit3c6a67dd6697e25bfec0b85a008ec4a3c482d993
treeae3a893f5e6ce86d75f6a3e007416d085581a3b6
parent53a7bdfb2a2756cce8003b90817f8a6fb4d830d9
fm10k: setup VLANs for l2 accelerated macvlan interfaces

We have support for accelerating macvlan devices via the
.ndo_dfwd_add_station() netdev op. These accelerated macvlan MAC
addresses are stored in the l2_accel structure, separate from the
unicast or multicast address lists.

If a VLAN is added on top of the macvlan device by the stack, traffic
will not properly flow to the macvlan. This occurs because we fail to
setup the VLANs for l2_accel MAC addresses.

In the non-offloaded case the MAC address is added to the unicast
address list, and thus the normal setup for enabling VLANs works as
expected.

We also need to add VLANs marked from .ndo_vlan_rx_add_vid() into the
l2_accel MAC addresses. Otherwise, VLAN traffic will not properly be
received by the VLAN devices attached to the offloaded macvlan devices.

Fix this by adding necessary logic to setup VLANs not only for the
unicast and multicast addresses, but also the l2_accel list. We need
similar logic in dfwd_add_station, dfwd_del_station, fm10k_update_vid,
and fm10k_restore_rx_state.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Krishneil Singh <krishneil.k.singh@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/fm10k/fm10k_netdev.c