bridge: Make the FDB consider inner tag for Q-in-Q
Subsystems (8)
PATCH 1/1 bridge: Make the FDB consider inner tag for Q-in-Q
802.1q networks with IVL (independent VLAN learning) can tolerate duplicate MACs as long as the duplicates reside in different VLANs. Similarly, IVL networks allow for L2 hairpining where different VLANs are used for each side of the hairpin in order to not confuse the intermediate bridge's FDBs.
When these types of networks are inter-connected using 802.1ad or Q-in-Q, only the outer VLAN tag is considered by the 802.1ad bridge during FDB lookup.
While traffic segregation by inner and outer VID works as expected, the inner VLAN's independent VLAN learning can be defeated.
The following example describes the issue in terms of duplicate MACS in different VLANs. But, the same concept described in this example also applies L2 hairpining via different VLANs.
_______________________
| .1ad bridge |
|_______________________|
PVID3| PVID3| PVID3|
| | |
TAGGED: 7| 8| 8|
____|____ _____|___ _____|___
| .1q br 1| |.1q br 2| |.1q br 3|
|_________| |________| |________|
PVID7 | PVID8 | PVID8|
HOST A HOST B HOST CThe above diagram depicts a .1ad bridge that has "pvid 3 untagged" configured for every member port. These member ports are connected to .1q bridges, named 1, 2 and 3. .1q br 1 allows VID 7 tagged on its port facing the .1ad bridge. .1q bridge 2 and 3 allow VID 8 tagged on their ports that face the .1ad bridge. Host A is connected to .1q br 1 via a port that is configured as "pvid 7 untagged". Host B and C are connected to bridges via ports configured as "pvid 8 untagged".
Prior to this change, if host A has the same (duplicate) MAC address as host B, this can disrupt communication between host B and host C. This happens because the .1ad bridge will see the duplicate MAC behind two of its ports within the same VID (3). It's not examining the inner VLAN to know that the hosts are actually reside within in different L2 segments.
With this change, the .1ad bridge uses both the inner and outer VID when looking up the FDB. With this technique, host B and C are able to communicate without disruptions due to the duplicate MAC assigned to host A.
Here is an example FDB dump on a .1ad bridge that is configured like the above diagram:
root@OpenWrt:~# bridge fdb show dynamic f4:a4:54:80:93:2f dev lan3 vlan 3 inner vlan 8 master br-lan f4:a4:54:81:7a:90 dev lan1 vlan 3 inner vlan 7 master br-lan f4:a4:54:81:7a:90 dev lan2 vlan 3 inner vlan 8 master br-lan
Note how duplicate MAC f4:a4:54:81:7a:90 is behind both lan1 and lan2. This FDB dump shows two entries with the same MAC and the same 802.1ad VLAN, 3. Prior to this change, only one fdb entry per MAC/VID would be possible. As such, the bridge would have issues forwarding. After this change, these entries are understood to be distinct as they pertain to different inner vlans, and therefore separate L2 segments.
--- drivers/net/ethernet/intel/i40e/i40e_main.c | 4 +- drivers/net/ethernet/intel/ice/ice_main.c | 6 +- drivers/net/ethernet/intel/igb/igb_main.c | 4 +- drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 4 +- .../ethernet/mellanox/mlxsw/spectrum_router.c | 4 +- .../ethernet/mellanox/mlxsw/spectrum_span.c | 4 +- .../mellanox/mlxsw/spectrum_switchdev.c | 2 +- drivers/net/ethernet/mscc/ocelot_net.c | 4 +- .../net/ethernet/qlogic/qlcnic/qlcnic_main.c | 8 +- drivers/net/macvlan.c | 4 +- drivers/net/vxlan/vxlan_core.c | 6 +- include/linux/if_bridge.h | 4 +- include/linux/netdevice.h | 6 +- include/linux/rtnetlink.h | 4 +- include/trace/events/bridge.h | 20 ++-- include/uapi/linux/if_link.h | 1 + include/uapi/linux/neighbour.h | 1 + net/bridge/br_arp_nd_proxy.c | 8 +- net/bridge/br_device.c | 11 +- net/bridge/br_fdb.c | 107 ++++++++++-------- net/bridge/br_input.c | 22 ++-- net/bridge/br_netlink.c | 18 ++- net/bridge/br_private.h | 25 ++-- net/bridge/br_vlan.c | 34 +++++- net/core/neighbour.c | 1 + net/core/rtnetlink.c | 58 ++++++---- 26 files changed, 227 insertions(+), 143 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_main.c +2 -2
@@ -13100,7 +13100,7 @@ static int i40e_get_phys_port_id(struct net_device *netdev,*/ static int i40e_ndo_fdb_add (struct ndmsg *ndm,struct nlattr *tb[],struct net_device *dev, -const unsigned char *addr,u16 vid, +const unsigned char *addr,u16 vid,u16 inner_vid,u16 flags,bool *notified,struct netlink_ext_ack *extack) {
@@ -13111,7 +13111,7 @@ static int i40e_ndo_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],if (!test_bit (I40E_FLAG_SRIOV_ENA , pf->flags))return -EOPNOTSUPP ; -if (vid) { +if (vid || inner_vid) {pr_info ("%s: vlans aren't supported yet for dev_uc|mc_add()\n" , dev->name);return -EINVAL ; }
drivers/net/ethernet/intel/ice/ice_main.c +3 -3
@@ -6161,13 +6161,13 @@ ice_set_tx_maxrate(struct net_device *netdev, int queue_index, u32 maxrate)*/ static int ice_fdb_add (struct ndmsg *ndm,struct nlattr __always_unused *tb[], -struct net_device *dev,const unsigned char *addr,u16 vid, +struct net_device *dev,const unsigned char *addr,u16 vid,u16 inner_vid,u16 flags,bool *notified,struct netlink_ext_ack __always_unused *extack) {int err; -if (vid) { +if (vid || inner_vid) {netdev_err (dev,"VLANs aren't supported yet for dev_uc|mc_add()\n" );return -EINVAL ; }
@@ -6203,7 +6203,7 @@ ice_fdb_add(struct ndmsg *ndm, struct nlattr __always_unused *tb[],static int ice_fdb_del (struct ndmsg *ndm,__always_unused struct nlattr *tb[],struct net_device *dev,const unsigned char *addr, -__always_unused u16 vid,bool *notified, +__always_unused u16 vid,__always_unused u16 inner_vid,bool *notified,struct netlink_ext_ack *extack) {int err;
drivers/net/ethernet/intel/igb/igb_main.c +2 -2
@@ -2485,7 +2485,7 @@ static int igb_set_features(struct net_device *netdev,static int igb_ndo_fdb_add (struct ndmsg *ndm,struct nlattr *tb[],struct net_device *dev, -const unsigned char *addr,u16 vid, +const unsigned char *addr,u16 vid,u16 inner_vid,u16 flags,bool *notified,struct netlink_ext_ack *extack) {
@@ -2498,7 +2498,7 @@ static int igb_ndo_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],return -ENOMEM ; } -return ndo_dflt_fdb_add (ndm, tb, dev, addr, vid, flags); +return ndo_dflt_fdb_add (ndm, tb, dev, addr, vid, inner_vid, flags); }#define IGB_MAX_MAC_HDR_LEN 127
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +2 -2
@@ -9954,7 +9954,7 @@ static int ixgbe_set_features(struct net_device *netdev,static int ixgbe_ndo_fdb_add (struct ndmsg *ndm,struct nlattr *tb[],struct net_device *dev, -const unsigned char *addr,u16 vid, +const unsigned char *addr,u16 vid,u16 inner_vid,u16 flags,bool *notified,struct netlink_ext_ack *extack) {
@@ -9967,7 +9967,7 @@ static int ixgbe_ndo_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],return -ENOMEM ; } -return ndo_dflt_fdb_add (ndm, tb, dev, addr, vid, flags); +return ndo_dflt_fdb_add (ndm, tb, dev, addr, vid, inner_vid, flags); }/**
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +2 -2
@@ -10609,7 +10609,7 @@ static void mlxsw_sp_rif_fid_fdb_del(struct mlxsw_sp_rif *rif, const char *mac)struct switchdev_notifier_fdb_info info = {};struct net_device *dev; - dev =br_fdb_find_port (mlxsw_sp_rif_dev (rif), mac,0 ); + dev =br_fdb_find_port (mlxsw_sp_rif_dev (rif), mac,0 ,0 );if (!dev)return ;
@@ -10657,7 +10657,7 @@ static void mlxsw_sp_rif_vlan_fdb_del(struct mlxsw_sp_rif *rif, const char *mac)struct net_device *dev; br_dev =is_vlan_dev (rif_dev) ?vlan_dev_real_dev (rif_dev) : rif_dev; - dev =br_fdb_find_port (br_dev, mac, vid); + dev =br_fdb_find_port (br_dev, mac, vid,0 );if (!dev)return ;
drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c +2 -2
@@ -273,7 +273,7 @@ mlxsw_sp_span_entry_bridge_8021q(const struct net_device *br_dev, !(vinfo.flags & BRIDGE_VLAN_INFO_BRENTRY))return NULL ; - edev =br_fdb_find_port (br_dev, dmac, vid); + edev =br_fdb_find_port (br_dev, dmac, vid,0 );if (!edev)return NULL ;
@@ -290,7 +290,7 @@ static struct net_device * mlxsw_sp_span_entry_bridge_8021d(const struct net_device *br_dev, unsigned char *dmac) { - return br_fdb_find_port(br_dev, dmac, 0); + return br_fdb_find_port(br_dev, dmac, 0, 0); } static struct net_device *
drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c +1 -1
@@ -3583,7 +3583,7 @@ mlxsw_sp_switchdev_vxlan_fdb_add(struct mlxsw_sp *mlxsw_sp,* device in the bridge's FDB table */ vid = bridge_device->ops->fid_vid (bridge_device, fid); -if (br_fdb_find_port (br_dev, vxlan_fdb_info->eth_addr, vid) != dev) +if (br_fdb_find_port (br_dev, vxlan_fdb_info->eth_addr, vid,0 ) != dev) goto err_br_fdb_find; err = mlxsw_sp_port_fdb_tunnel_uc_op(mlxsw_sp, vxlan_fdb_info->eth_addr,
drivers/net/ethernet/mscc/ocelot_net.c +2 -2
@@ -730,7 +730,7 @@ static void ocelot_get_stats64(struct net_device *dev,static int ocelot_port_fdb_add (struct ndmsg *ndm,struct nlattr *tb[],struct net_device *dev,const unsigned char *addr, -u16 vid,u16 flags,bool *notified, +u16 vid,u16 inner_vid,u16 flags,bool *notified,struct netlink_ext_ack *extack) {struct ocelot_port_private *priv =netdev_priv (dev);
@@ -743,7 +743,7 @@ static int ocelot_port_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],static int ocelot_port_fdb_del (struct ndmsg *ndm,struct nlattr *tb[],struct net_device *dev, -const unsigned char *addr,u16 vid, +const unsigned char *addr,u16 vid,u16 inner_vid,bool *notified,struct netlink_ext_ack *extack) {struct ocelot_port_private *priv =netdev_priv (dev);
drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c +4 -4
@@ -367,14 +367,14 @@ static int qlcnic_set_mac(struct net_device *netdev, void *p)static int qlcnic_fdb_del (struct ndmsg *ndm,struct nlattr *tb[],struct net_device *netdev, -const unsigned char *addr,u16 vid,bool *notified, +const unsigned char *addr,u16 vid,u16 inner_vid,bool *notified,struct netlink_ext_ack *extack) {struct qlcnic_adapter *adapter =netdev_priv (netdev);int err = -EOPNOTSUPP ;if (!adapter->fdb_mac_learn) -return ndo_dflt_fdb_del (ndm, tb, netdev, addr, vid); +return ndo_dflt_fdb_del (ndm, tb, netdev, addr, vid, inner_vid);if ((adapter->flags &QLCNIC_ESWITCH_ENABLED ) ||qlcnic_sriov_check (adapter)) {
@@ -393,14 +393,14 @@ static int qlcnic_fdb_del(struct ndmsg *ndm, struct nlattr *tb[],static int qlcnic_fdb_add (struct ndmsg *ndm,struct nlattr *tb[],struct net_device *netdev, -const unsigned char *addr,u16 vid,u16 flags, +const unsigned char *addr,u16 vid,u16 inner_vid,u16 flags,bool *notified,struct netlink_ext_ack *extack) {struct qlcnic_adapter *adapter =netdev_priv (netdev);int err =0 ;if (!adapter->fdb_mac_learn) -return ndo_dflt_fdb_add (ndm, tb, netdev, addr, vid, flags); +return ndo_dflt_fdb_add (ndm, tb, netdev, addr, vid, inner_vid, flags);if (!(adapter->flags &QLCNIC_ESWITCH_ENABLED ) && !qlcnic_sriov_check (adapter)) {
drivers/net/macvlan.c +2 -2
@@ -1023,7 +1023,7 @@ static int macvlan_vlan_rx_kill_vid(struct net_device *dev,static int macvlan_fdb_add (struct ndmsg *ndm,struct nlattr *tb[],struct net_device *dev, -const unsigned char *addr,u16 vid, +const unsigned char *addr,u16 vid,u16 inner_vid,u16 flags,bool *notified,struct netlink_ext_ack *extack) {
@@ -1049,7 +1049,7 @@ static int macvlan_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],static int macvlan_fdb_del (struct ndmsg *ndm,struct nlattr *tb[],struct net_device *dev, -const unsigned char *addr,u16 vid,bool *notified, +const unsigned char *addr,u16 vid,u16 inner_vid,bool *notified,struct netlink_ext_ack *extack) {struct macvlan_dev *vlan =netdev_priv (dev);
drivers/net/vxlan/vxlan_core.c +3 -3
@@ -1240,7 +1240,7 @@ static int vxlan_fdb_parse(struct nlattr *tb[], struct vxlan_dev *vxlan,/* Add static entry (via netlink) */ static int vxlan_fdb_add (struct ndmsg *ndm,struct nlattr *tb[],struct net_device *dev, -const unsigned char *addr,u16 vid,u16 flags, +const unsigned char *addr,u16 vid,u16 inner_vid,u16 flags,bool *notified,struct netlink_ext_ack *extack) {struct vxlan_dev *vxlan =netdev_priv (dev);
@@ -1319,7 +1319,7 @@ int __vxlan_fdb_delete(struct vxlan_dev *vxlan,/* Delete entry (via netlink) */ static int vxlan_fdb_delete (struct ndmsg *ndm,struct nlattr *tb[],struct net_device *dev, -const unsigned char *addr,u16 vid,bool *notified, +const unsigned char *addr,u16 vid,u16 inner_vid,bool *notified,struct netlink_ext_ack *extack) {struct vxlan_dev *vxlan =netdev_priv (dev);
@@ -1407,7 +1407,7 @@ static int vxlan_fdb_get(struct sk_buff *skb,struct nlattr *tb[], struct net_device *dev, const unsigned char *addr, - u16 vid, u32 portid, u32 seq, + u16 vid, u16 inner_vid, u32 portid, u32 seq, struct netlink_ext_ack *extack) { struct vxlan_dev *vxlan = netdev_priv(dev);
include/linux/if_bridge.h +2 -2
@@ -177,7 +177,7 @@ static inline int br_mst_get_state(const struct net_device *dev, u16 msti,#if IS_ENABLED (CONFIG_BRIDGE )struct net_device *br_fdb_find_port (const struct net_device *br_dev,const unsigned char *addr, -__u16 vid); +__u16 vid,__u16 inner_vid);void br_fdb_clear_offload (const struct net_device *dev,u16 vid);bool br_port_flag_is_set (const struct net_device *dev,unsigned long flag);u8 br_port_get_stp_state (const struct net_device *dev);
@@ -186,7 +186,7 @@ clock_t br_get_ageing_time(const struct net_device *br_dev);static inline struct net_device *br_fdb_find_port (const struct net_device *br_dev,const unsigned char *addr, -__u16 vid) +__u16 vid,__u16 inner_vid) {return NULL ; }
include/linux/netdevice.h +3 -3
@@ -1528,7 +1528,7 @@ struct net_device_ops {struct nlattr *tb[], struct net_device *dev, const unsigned char *addr, - u16 vid, + u16 vid, u16 inner_vid, u16 flags, bool *notified, struct netlink_ext_ack *extack);
@@ -1536,7 +1536,7 @@ struct net_device_ops {struct nlattr *tb[], struct net_device *dev, const unsigned char *addr, - u16 vid, + u16 vid, u16 inner_vid, bool *notified, struct netlink_ext_ack *extack); int (*ndo_fdb_del_bulk)(struct nlmsghdr *nlh,
@@ -1551,7 +1551,7 @@ struct net_device_ops {struct nlattr *tb[], struct net_device *dev, const unsigned char *addr, - u16 vid, u32 portid, u32 seq, + u16 vid, u16 inner_vid, u32 portid, u32 seq, struct netlink_ext_ack *extack); int (*ndo_mdb_add)(struct net_device *dev, struct nlattr *tb[],
include/linux/rtnetlink.h +3 -1
@@ -188,12 +188,14 @@ extern int ndo_dflt_fdb_add(struct ndmsg *ndm,struct net_device *dev, const unsigned char *addr, u16 vid, + u16 inner_vid, u16 flags);extern int ndo_dflt_fdb_del (struct ndmsg *ndm,struct nlattr *tb[],struct net_device *dev,const unsigned char *addr, -u16 vid); +u16 vid, +u16 inner_vid); extern int ndo_dflt_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq, struct net_device *dev, u16 mode,
include/trace/events/bridge.h +12 -8
@@ -12,15 +12,16 @@ TRACE_EVENT(br_fdb_add, TP_PROTO(struct ndmsg *ndm, struct net_device *dev, - const unsigned char *addr, u16 vid, u16 nlh_flags), + const unsigned char *addr, u16 vid, u16 inner_vid, u16 nlh_flags), - TP_ARGS(ndm, dev, addr, vid, nlh_flags), + TP_ARGS(ndm, dev, addr, vid, inner_vid, nlh_flags), TP_STRUCT__entry( __field(u8, ndm_flags) __string(dev, dev->name) __array(unsigned char, addr, ETH_ALEN) __field(u16, vid) + __field(u16, inner_vid) __field(u16, nlh_flags) ),
@@ -28,14 +29,15 @@ TRACE_EVENT(br_fdb_add,__assign_str (dev);memcpy (__entry->addr, addr,ETH_ALEN ); __entry->vid = vid; + __entry->inner_vid = inner_vid; __entry->nlh_flags = nlh_flags; __entry->ndm_flags = ndm->ndm_flags; ), -TP_printk ("dev %s addr %02x:%02x:%02x:%02x:%02x:%02x vid %u nlh_flags %04x ndm_flags %02x" , +TP_printk ("dev %s addr %02x:%02x:%02x:%02x:%02x:%02x vid %u inner_vid %u nlh_flags %04x ndm_flags %02x" ,__get_str (dev), __entry->addr[0 ], __entry->addr[1 ], __entry->addr[2 ], __entry->addr[3 ], __entry->addr[4 ], - __entry->addr[5 ], __entry->vid, + __entry->addr[5 ], __entry->vid, __entry->inner_vid, __entry->nlh_flags, __entry->ndm_flags) );
@@ -95,15 +97,16 @@ TRACE_EVENT(fdb_delete, TRACE_EVENT(br_fdb_update, TP_PROTO(struct net_bridge *br, struct net_bridge_port *source, - const unsigned char *addr, u16 vid, unsigned long flags), + const unsigned char *addr, u16 vid, u16 inner_vid, unsigned long flags), - TP_ARGS(br, source, addr, vid, flags), + TP_ARGS(br, source, addr, vid, inner_vid, flags), TP_STRUCT__entry( __string(br_dev, br->dev->name) __string(dev, source->dev->name) __array(unsigned char, addr, ETH_ALEN) __field(u16, vid) + __field(u16, inner_vid) __field(unsigned long, flags) ),
@@ -112,13 +115,14 @@ TRACE_EVENT(br_fdb_update,__assign_str (dev);memcpy (__entry->addr, addr,ETH_ALEN ); __entry->vid = vid; + __entry->inner_vid = inner_vid; __entry->flags = flags; ), -TP_printk ("br_dev %s source %s addr %02x:%02x:%02x:%02x:%02x:%02x vid %u flags 0x%lx" , +TP_printk ("br_dev %s source %s addr %02x:%02x:%02x:%02x:%02x:%02x vid %u inner_vid %u flags 0x%lx" ,__get_str (br_dev),__get_str (dev), __entry->addr[0 ], __entry->addr[1 ], __entry->addr[2 ], __entry->addr[3 ], - __entry->addr[4 ], __entry->addr[5 ], __entry->vid, + __entry->addr[4 ], __entry->addr[5 ], __entry->vid, __entry->inner_vid, __entry->flags) );
include/uapi/linux/if_link.h +1 -0
@@ -793,6 +793,7 @@ enum {IFLA_BR_MCAST_QUERIER_STATE ,IFLA_BR_FDB_N_LEARNED ,IFLA_BR_FDB_MAX_LEARNED , +IFLA_BR_FDB_INNER_VLAN_ENABLED , __IFLA_BR_MAX, };
include/uapi/linux/neighbour.h +1 -0
@@ -34,6 +34,7 @@ enum {NDA_FLAGS_EXT ,NDA_NDM_STATE_MASK ,NDA_NDM_FLAGS_MASK , +NDA_INNER_VLAN , __NDA_MAX };
net/bridge/br_arp_nd_proxy.c +4 -4
@@ -123,7 +123,7 @@ static bool br_is_local_ip(struct net_device *dev, __be32 ip) }void br_do_proxy_suppress_arp (struct sk_buff *skb,struct net_bridge *br, -u16 vid,struct net_bridge_port *p) +u16 vid,u16 inner_vid,struct net_bridge_port *p) {struct net_device *dev = br->dev;struct net_device *vlandev = dev;
@@ -197,7 +197,7 @@ void br_do_proxy_suppress_arp(struct sk_buff *skb, struct net_bridge *br,return ; } - f =br_fdb_find_rcu (br, n->ha, vid); + f =br_fdb_find_rcu (br, n->ha, vid, inner_vid);if (f) {bool replied = false;
@@ -397,7 +397,7 @@ static bool br_is_local_ip6(struct net_device *dev, struct in6_addr *addr) }void br_do_suppress_nd (struct sk_buff *skb,struct net_bridge *br, -u16 vid,struct net_bridge_port *p,struct nd_msg *msg) +u16 vid,u16 inner_vid,struct net_bridge_port *p,struct nd_msg *msg) {struct net_device *dev = br->dev;struct net_device *vlandev =NULL ;
@@ -457,7 +457,7 @@ void br_do_suppress_nd(struct sk_buff *skb, struct net_bridge *br,return ; } - f =br_fdb_find_rcu (br, n->ha, vid); + f =br_fdb_find_rcu (br, n->ha, vid, inner_vid);if (f) {bool replied = false;
net/bridge/br_device.c +6 -5
@@ -38,6 +38,7 @@ netdev_tx_t br_dev_xmit(struct sk_buff *skb, struct net_device *dev)struct net_bridge_vlan *vlan;const unsigned char *dest;u16 vid =0 ; +u16 inner_vid =0 ;if (unlikely (reason !=SKB_NOT_DROPPED_YET )) {kfree_skb_reason (skb, reason);
@@ -63,7 +64,7 @@ netdev_tx_t br_dev_xmit(struct sk_buff *skb, struct net_device *dev)skb_reset_mac_header (skb);skb_pull (skb,ETH_HLEN ); -if (!br_allowed_ingress (br,br_vlan_group_rcu (br), skb, &vid, +if (!br_allowed_ingress (br,br_vlan_group_rcu (br), skb, &vid, &inner_vid, &state, &vlan)) goto out;
@@ -71,7 +72,7 @@ netdev_tx_t br_dev_xmit(struct sk_buff *skb, struct net_device *dev) (eth_hdr(skb)->h_proto == htons(ETH_P_ARP) || eth_hdr(skb)->h_proto == htons(ETH_P_RARP)) && br_opt_get(br, BROPT_NEIGH_SUPPRESS_ENABLED)) { -br_do_proxy_suppress_arp (skb, br, vid,NULL ); +br_do_proxy_suppress_arp (skb, br, vid, inner_vid,NULL ); } else if (IS_ENABLED(CONFIG_IPV6) && skb->protocol == htons(ETH_P_IPV6) && br_opt_get(br, BROPT_NEIGH_SUPPRESS_ENABLED) &&
@@ -82,7 +83,7 @@ netdev_tx_t br_dev_xmit(struct sk_buff *skb, struct net_device *dev) msg =br_is_nd_neigh_msg (skb, &_msg);if (msg) -br_do_suppress_nd (skb, br, vid,NULL , msg); +br_do_suppress_nd (skb, br, vid, inner_vid,NULL , msg); } dest =eth_hdr (skb)->h_dest;
@@ -104,7 +105,7 @@ netdev_tx_t br_dev_xmit(struct sk_buff *skb, struct net_device *dev)br_multicast_flood (mdst, skb, brmctx, false, true); elsebr_flood (br ,skb ,BR_PKT_MULTICAST ,false ,true ,vid ); - }else if ((dst =br_fdb_find_rcu (br, dest, vid)) !=NULL ) { + }else if ((dst =br_fdb_find_rcu (br, dest, vid, inner_vid)) !=NULL ) {br_forward (dst->dst, skb, false, true); }else {br_flood (br, skb,BR_PKT_UNICAST , false, true, vid);
@@ -394,7 +395,7 @@ static int br_fill_forward_path(struct net_device_path_ctx *ctx,br_vlan_fill_forward_path_pvid (br, ctx, path); - f =br_fdb_find_rcu (br, ctx->daddr, path->bridge.vlan_id); + f =br_fdb_find_rcu (br, ctx->daddr, path->bridge.vlan_id,0 );if (!f)return -1 ;
net/bridge/br_fdb.c +60 -47
393 lines not on this page · raw message
net/bridge/br_input.c +12 -10
@@ -86,6 +86,7 @@ int br_handle_frame_finish(struct net *net, struct sock *sk, struct sk_buff *skbstruct net_bridge *br;bool promisc;u16 vid =0 ; +u16 inner_vid =0 ;u8 state;if (!p)
@@ -104,13 +105,13 @@ int br_handle_frame_finish(struct net *net, struct sock *sk, struct sk_buff *skb brmctx = &p->br->multicast_ctx; pmctx = &p->multicast_ctx; -if (!br_allowed_ingress (p->br,nbp_vlan_group_rcu (p), skb, &vid, +if (!br_allowed_ingress (p->br,nbp_vlan_group_rcu (p), skb, &vid, &inner_vid, &state, &vlan)) goto out;if (p->flags &BR_PORT_LOCKED ) {struct net_bridge_fdb_entry *fdb_src = -br_fdb_find_rcu (br,eth_hdr (skb)->h_source, vid); +br_fdb_find_rcu (br,eth_hdr (skb)->h_source, vid, inner_vid);if (!fdb_src) {/* FDB miss. Create locked FDB entry if MAB is enabled
@@ -118,7 +119,7 @@ int br_handle_frame_finish(struct net *net, struct sock *sk, struct sk_buff *skb*/ if (p->flags &BR_PORT_MAB )br_fdb_update (br, p,eth_hdr (skb)->h_source, - vid,BIT (BR_FDB_LOCKED )); + vid, inner_vid,BIT (BR_FDB_LOCKED )); goto drop; }else if (READ_ONCE (fdb_src->dst) != p ||test_bit (BR_FDB_LOCAL , &fdb_src->flags)) {
@@ -128,7 +129,7 @@ int br_handle_frame_finish(struct net *net, struct sock *sk, struct sk_buff *skb/* FDB match, but entry is locked. Refresh it and drop * the packet. */ -br_fdb_update (br, p,eth_hdr (skb)->h_source, vid, +br_fdb_update (br, p,eth_hdr (skb)->h_source, vid, inner_vid,BIT (BR_FDB_LOCKED )); goto drop; }
@@ -138,7 +139,7 @@ int br_handle_frame_finish(struct net *net, struct sock *sk, struct sk_buff *skb/* insert into forwarding database after filtering to avoid spoofing */ if (p->flags &BR_LEARNING ) -br_fdb_update (br, p,eth_hdr (skb)->h_source, vid,0 ); +br_fdb_update (br, p,eth_hdr (skb)->h_source, vid, inner_vid,0 ); promisc = !!(br->dev->flags &IFF_PROMISC ); local_rcv = promisc;
@@ -164,7 +165,7 @@ int br_handle_frame_finish(struct net *net, struct sock *sk, struct sk_buff *skbif (IS_ENABLED (CONFIG_INET ) && (skb->protocol ==htons (ETH_P_ARP ) || skb->protocol ==htons (ETH_P_RARP ))) { -br_do_proxy_suppress_arp (skb, br, vid, p); +br_do_proxy_suppress_arp (skb, br, vid, inner_vid, p); } else if (IS_ENABLED(CONFIG_IPV6) && skb->protocol == htons(ETH_P_IPV6) && br_opt_get(br, BROPT_NEIGH_SUPPRESS_ENABLED) &&
@@ -175,7 +176,7 @@ int br_handle_frame_finish(struct net *net, struct sock *sk, struct sk_buff *skb msg =br_is_nd_neigh_msg (skb, &_msg);if (msg) -br_do_suppress_nd (skb, br, vid, p, msg); +br_do_suppress_nd (skb, br, vid, inner_vid, p, msg); }switch (pkt_type) {
@@ -195,7 +196,7 @@ int br_handle_frame_finish(struct net *net, struct sock *sk, struct sk_buff *skb }break ;case BR_PKT_UNICAST : - dst =br_fdb_find_rcu (br,eth_hdr (skb)->h_dest, vid); + dst =br_fdb_find_rcu (br,eth_hdr (skb)->h_dest, vid, inner_vid);break ;default :break ;
@@ -232,13 +233,14 @@ static void __br_handle_local_finish(struct sk_buff *skb) {struct net_bridge_port *p =br_port_get_rcu (skb->dev);u16 vid =0 ; +u16 inner_vid =0 ;/* check if vlan is allowed, to avoid spoofing */ if ((p->flags &BR_LEARNING ) &&nbp_state_should_learn (p) && !br_opt_get (p->br,BROPT_NO_LL_LEARN ) && -br_should_learn (p, skb, &vid)) -br_fdb_update (p->br, p,eth_hdr (skb)->h_source, vid,0 ); +br_should_learn (p, skb, &vid, &inner_vid)) +br_fdb_update (p->br, p,eth_hdr (skb)->h_source, vid, inner_vid,0 ); }/* note: already called with rcu_read_lock */
net/bridge/br_netlink.c +17 -1
@@ -1270,6 +1270,7 @@ static const struct nla_policy br_policy[IFLA_BR_MAX + 1] = { NLA_POLICY_EXACT_LEN(sizeof(struct br_boolopt_multi)), [IFLA_BR_FDB_N_LEARNED] = { .type = NLA_REJECT }, [IFLA_BR_FDB_MAX_LEARNED] = { .type = NLA_U32 }, + [IFLA_BR_FDB_INNER_VLAN_ENABLED] = { .type = NLA_U8 }, }; static int br_changelink(struct net_device *brdev, struct nlattr *tb[],
@@ -1326,9 +1327,22 @@ static int br_changelink(struct net_device *brdev, struct nlattr *tb[], err =br_vlan_filter_toggle (br, vlan_filter, extack);if (err)return err; + +if (!br_opt_get (br,BROPT_VLAN_ENABLED )) +br_opt_toggle (br,BROPT_FDB_INNER_VLAN_ENABLED , false); }#ifdef CONFIG_BRIDGE_VLAN_FILTERING +if (data[IFLA_BR_FDB_INNER_VLAN_ENABLED ]) { +u8 val; + +if (!br_opt_get (br,BROPT_VLAN_ENABLED )) +return -EINVAL ; + + val =nla_get_u8 (data[IFLA_BR_FDB_INNER_VLAN_ENABLED ]); +br_opt_toggle (br,BROPT_FDB_INNER_VLAN_ENABLED , !!val); + } +if (data[IFLA_BR_VLAN_PROTOCOL ]) {__be16 vlan_proto =nla_get_be16 (data[IFLA_BR_VLAN_PROTOCOL ]);
@@ -1693,7 +1707,9 @@ static int br_fill_info(struct sk_buff *skb, const struct net_device *brdev)nla_put_u8 (skb,IFLA_BR_VLAN_STATS_ENABLED ,br_opt_get (br,BROPT_VLAN_STATS_ENABLED )) ||nla_put_u8 (skb,IFLA_BR_VLAN_STATS_PER_PORT , - br_opt_get(br, BROPT_VLAN_STATS_PER_PORT))) +br_opt_get (br,BROPT_VLAN_STATS_PER_PORT )) || +nla_put_u8 (skb,IFLA_BR_FDB_INNER_VLAN_ENABLED , + br_opt_get(br, BROPT_FDB_INNER_VLAN_ENABLED))) return -EMSGSIZE;#endif #ifdef CONFIG_BRIDGE_IGMP_SNOOPING
net/bridge/br_private.h +14 -11
@@ -282,6 +282,7 @@ enum {struct net_bridge_fdb_key {mac_addr addr;u16 vlan_id; +u16 inner_vlan_id; };struct net_bridge_fdb_entry {
@@ -304,6 +305,7 @@ struct net_bridge_fdb_flush_desc {unsigned long flags_mask;int port_ifindex;u16 vlan_id; +u16 inner_vlan_id; };#define MDB_PG_FLAGS_PERMANENT BIT(0)
@@ -483,6 +485,7 @@ enum net_bridge_opts {BROPT_VLAN_BRIDGE_BINDING ,BROPT_MCAST_VLAN_SNOOPING_ENABLED ,BROPT_MST_ENABLED , + BROPT_FDB_INNER_VLAN_ENABLED, }; struct net_bridge {
@@ -842,27 +845,27 @@ void br_fdb_delete_by_port(struct net_bridge *br, const struct net_bridge_port *p, u16 vid, int do_all);struct net_bridge_fdb_entry *br_fdb_find_rcu (struct net_bridge *br,const unsigned char *addr, -__u16 vid); +__u16 vid,__u16 inner_vid);int br_fdb_test_addr (struct net_device *dev,unsigned char *addr);int br_fdb_fillbuf (struct net_bridge *br,void *buf,unsigned long count,unsigned long off);int br_fdb_add_local (struct net_bridge *br,struct net_bridge_port *source,const unsigned char *addr,u16 vid);void br_fdb_update (struct net_bridge *br,struct net_bridge_port *source, -const unsigned char *addr,u16 vid,unsigned long flags); +const unsigned char *addr,u16 vid,u16 inner_vid,unsigned long flags);int br_fdb_delete (struct ndmsg *ndm,struct nlattr *tb[], -struct net_device *dev,const unsigned char *addr,u16 vid, +struct net_device *dev,const unsigned char *addr,u16 vid,u16 inner_vid,bool *notified,struct netlink_ext_ack *extack);int br_fdb_delete_bulk (struct nlmsghdr *nlh,struct net_device *dev,struct netlink_ext_ack *extack);int br_fdb_add (struct ndmsg *nlh,struct nlattr *tb[],struct net_device *dev, -const unsigned char *addr,u16 vid,u16 nlh_flags, +const unsigned char *addr,u16 vid,u16 inner_vid,u16 nlh_flags,bool *notified,struct netlink_ext_ack *extack);int br_fdb_dump (struct sk_buff *skb,struct netlink_callback *cb,struct net_device *dev,struct net_device *fdev,int *idx);int br_fdb_get (struct sk_buff *skb,struct nlattr *tb[],struct net_device *dev, -const unsigned char *addr,u16 vid,u32 portid,u32 seq, +const unsigned char *addr,u16 vid,u16 inner_vid,u32 portid,u32 seq,struct netlink_ext_ack *extack);int br_fdb_sync_static (struct net_bridge *br,struct net_bridge_port *p);void br_fdb_unsync_static (struct net_bridge *br,struct net_bridge_port *p);
@@ -1532,11 +1535,11 @@ br_multicast_ctx_options_equal(const struct net_bridge_mcast *brmctx1,#ifdef CONFIG_BRIDGE_VLAN_FILTERING bool br_allowed_ingress (const struct net_bridge *br,struct net_bridge_vlan_group *vg,struct sk_buff *skb, -u16 *vid,u8 *state, +u16 *vid,u16 *inner_vid,u8 *state,struct net_bridge_vlan **vlan);bool br_allowed_egress (struct net_bridge_vlan_group *vg,const struct sk_buff *skb); -bool br_should_learn (struct net_bridge_port *p,struct sk_buff *skb,u16 *vid); +bool br_should_learn (struct net_bridge_port *p,struct sk_buff *skb,u16 *vid,u16 *inner_vid); struct sk_buff *br_handle_vlan(struct net_bridge *br, const struct net_bridge_port *port, struct net_bridge_vlan_group *vg,
@@ -1645,7 +1648,7 @@ static inline u16 br_vlan_flags(const struct net_bridge_vlan *v, u16 pvid)static inline bool br_allowed_ingress (const struct net_bridge *br,struct net_bridge_vlan_group *vg,struct sk_buff *skb, -u16 *vid,u8 *state, +u16 *vid,u16 *inner_vid,u8 *state,struct net_bridge_vlan **vlan) {
@@ -1660,7 +1663,7 @@ static inline bool br_allowed_egress(struct net_bridge_vlan_group *vg, }static inline bool br_should_learn (struct net_bridge_port *p, -struct sk_buff *skb,u16 *vid) +struct sk_buff *skb,u16 *vid,u16 *inner_vid) {return true; }
@@ -2287,9 +2290,9 @@ static inline void br_switchdev_init(struct net_bridge *br)/* br_arp_nd_proxy.c */ void br_recalculate_neigh_suppress_enabled (struct net_bridge *br);void br_do_proxy_suppress_arp (struct sk_buff *skb,struct net_bridge *br, -u16 vid,struct net_bridge_port *p); +u16 vid,u16 inner_vid,struct net_bridge_port *p);void br_do_suppress_nd (struct sk_buff *skb,struct net_bridge *br, -u16 vid,struct net_bridge_port *p,struct nd_msg *msg); +u16 vid,u16 inner_vid,struct net_bridge_port *p,struct nd_msg *msg);struct nd_msg *br_is_nd_neigh_msg (struct sk_buff *skb,struct nd_msg *m);bool br_is_neigh_suppress_enabled (const struct net_bridge_port *p,u16 vid);#endif
net/bridge/br_vlan.c +28 -6
@@ -530,10 +530,17 @@ struct sk_buff *br_handle_vlan(struct net_bridge *br,return skb; } +static u16 get_inner_vid (struct sk_buff *skb) +{ +struct vlan_hdr *vhdr = (struct vlan_hdr *)skb->data; + +return ntohs (vhdr->h_vlan_TCI) &VLAN_VID_MASK ; +} +/* Called under RCU */ static bool __allowed_ingress (const struct net_bridge *br,struct net_bridge_vlan_group *vg, -struct sk_buff *skb,u16 *vid, +struct sk_buff *skb,u16 *vid,u16 *inner_vid,u8 *state,struct net_bridge_vlan **vlan) {
@@ -565,10 +572,15 @@ static bool __allowed_ingress(const struct net_bridge *br,skb_pull (skb,ETH_HLEN );skb_reset_mac_len (skb); +if (br_opt_get (br,BROPT_FDB_INNER_VLAN_ENABLED )) + *inner_vid = *vid; *vid =0 ; tagged = false; }else { tagged = true; +if (eth_type_vlan (skb->protocol) && +br_opt_get (br,BROPT_FDB_INNER_VLAN_ENABLED )) + *inner_vid =get_inner_vid (skb); } }else {/* Untagged frame */
@@ -640,7 +652,7 @@ static bool __allowed_ingress(const struct net_bridge *br,bool br_allowed_ingress (const struct net_bridge *br,struct net_bridge_vlan_group *vg,struct sk_buff *skb, -u16 *vid,u8 *state, +u16 *vid,u16 *inner_vid,u8 *state,struct net_bridge_vlan **vlan) {/* If VLAN filtering is disabled on the bridge, all packets are
@@ -652,7 +664,7 @@ bool br_allowed_ingress(const struct net_bridge *br,return true; } -return __allowed_ingress (br, vg, skb, vid, state, vlan); +return __allowed_ingress (br, vg, skb, vid, inner_vid, state, vlan); }/* Called under RCU. */
@@ -676,7 +688,7 @@ bool br_allowed_egress(struct net_bridge_vlan_group *vg, }/* Called under RCU */ -bool br_should_learn (struct net_bridge_port *p,struct sk_buff *skb,u16 *vid) +bool br_should_learn (struct net_bridge_port *p,struct sk_buff *skb,u16 *vid,u16 *inner_vid) {struct net_bridge_vlan_group *vg;struct net_bridge *br = p->br;
@@ -690,8 +702,18 @@ bool br_should_learn(struct net_bridge_port *p, struct sk_buff *skb, u16 *vid)if (!vg || !vg->num_vlans)return false; -if (!br_vlan_get_tag (skb, vid) && skb->vlan_proto != br->vlan_proto) - *vid =0 ; +if (!br_vlan_get_tag (skb, vid)) { +/* Tagged frame */ +if (skb->vlan_proto != br->vlan_proto) { +if (br_opt_get (br,BROPT_FDB_INNER_VLAN_ENABLED )) + *inner_vid = *vid; + *vid =0 ; + }else { +if (eth_type_vlan (skb->protocol) && +br_opt_get (br,BROPT_FDB_INNER_VLAN_ENABLED )) + *inner_vid =get_inner_vid (skb); + } + }if (!*vid) { *vid =br_get_pvid (vg);
net/core/neighbour.c +1 -0
@@ -1846,6 +1846,7 @@ const struct nla_policy nda_policy[NDA_MAX+1] = { [NDA_NH_ID] = { .type = NLA_U32 }, [NDA_FLAGS_EXT] = NLA_POLICY_MASK(NLA_U32, NTF_EXT_MASK), [NDA_FDB_EXT_ATTRS] = { .type = NLA_NESTED }, + [NDA_INNER_VLAN] = { .type = NLA_U16 }, }; static int neigh_delete(struct sk_buff *skb, struct nlmsghdr *nlh,
net/core/rtnetlink.c +38 -20
195 lines not on this page · raw message
Signature · 1 line
2.34.1
kernel test robot
build botkernel test robot noticed the following build warnings:
Hi Andy,
kernel test robot noticed the following build warnings:
[auto build test WARNING on net-next/main]
url: https://github.com/intel-lab-lkp/linux/commits/Andy-Strohman/bridge-Make-the-FDB-consider-inner-tag-for-Q-in-Q/20241130-080335 base: net-next/main patch link: https://lore.kernel.org/r/20241130000802.2822146-1-andrew%40andrewstrohman.com patch subject: [PATCH net-next] bridge: Make the FDB consider inner tag for Q-in-Q config: alpha-allyesconfig (https://download.01.org/0day-ci/archive/20241130/[email protected]/config) compiler: alpha-linux-gcc (GCC) 14.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241130/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All warnings (new ones prefixed by >>):
>> drivers/net/ethernet/intel/i40e/i40e_main.c:13106: warning: Function parameter or struct member 'inner_vid' not described in 'i40e_ndo_fdb_add' -- >> drivers/net/ethernet/intel/ice/ice_main.c:6167: warning: Function parameter or struct member 'inner_vid' not described in 'ice_fdb_add' >> drivers/net/ethernet/intel/ice/ice_main.c:6208: warning: Function parameter or struct member 'inner_vid' not described in 'ice_fdb_del'
vim +13106 drivers/net/ethernet/intel/i40e/i40e_main.c
1f224ad2f76028 Neerav Parikh 2014-02-12 13089
2f90ade661b3bd Jesse Brandeburg 2014-11-20 13090 /**
2f90ade661b3bd Jesse Brandeburg 2014-11-20 13091 * i40e_ndo_fdb_add - add an entry to the hardware database
2f90ade661b3bd Jesse Brandeburg 2014-11-20 13092 * @ndm: the input from the stack
2f90ade661b3bd Jesse Brandeburg 2014-11-20 13093 * @tb: pointer to array of nladdr (unused)
2f90ade661b3bd Jesse Brandeburg 2014-11-20 13094 * @dev: the net device pointer
2f90ade661b3bd Jesse Brandeburg 2014-11-20 13095 * @addr: the MAC address entry being added
f5254429e1756a Jacob Keller 2018-04-20 13096 * @vid: VLAN ID
2f90ade661b3bd Jesse Brandeburg 2014-11-20 13097 * @flags: instructions from stack about fdb operation
4b42fbc6bd8f73 Petr Machata 2024-11-14 13098 * @notified: whether notification was emitted
b50f7bca5e83d9 Jesse Brandeburg 2020-09-25 13099 * @extack: netlink extended ack, unused currently
2f90ade661b3bd Jesse Brandeburg 2014-11-20 13100 */
4ba0dea5b17369 Greg Rose 2014-03-06 13101 static int i40e_ndo_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
4ba0dea5b17369 Greg Rose 2014-03-06 13102 struct net_device *dev,
eae5d6a6f80427 Andy Strohman 2024-11-30 13103 const unsigned char *addr, u16 vid, u16 inner_vid,
4b42fbc6bd8f73 Petr Machata 2024-11-14 13104 u16 flags, bool *notified,
87b0984ebfabaf Petr Machata 2019-01-16 13105 struct netlink_ext_ack *extack)
4ba0dea5b17369 Greg Rose 2014-03-06 @13106 {
4ba0dea5b17369 Greg Rose 2014-03-06 13107 struct i40e_netdev_priv *np = netdev_priv(dev);
4ba0dea5b17369 Greg Rose 2014-03-06 13108 struct i40e_pf *pf = np->vsi->back;
4ba0dea5b17369 Greg Rose 2014-03-06 13109 int err = 0;
4ba0dea5b17369 Greg Rose 2014-03-06 13110
70756d0a4727fe Ivan Vecera 2023-11-13 13111 if (!test_bit(I40E_FLAG_SRIOV_ENA, pf->flags))
4ba0dea5b17369 Greg Rose 2014-03-06 13112 return -EOPNOTSUPP;
4ba0dea5b17369 Greg Rose 2014-03-06 13113
eae5d6a6f80427 Andy Strohman 2024-11-30 13114 if (vid || inner_vid) {
65891feac27e26 Or Gerlitz 2014-12-14 13115 pr_info("%s: vlans aren't supported yet for dev_uc|mc_add()\n", dev->name);
65891feac27e26 Or Gerlitz 2014-12-14 13116 return -EINVAL;
65891feac27e26 Or Gerlitz 2014-12-14 13117 }
65891feac27e26 Or Gerlitz 2014-12-14 13118
4ba0dea5b17369 Greg Rose 2014-03-06 13119 /* Hardware does not support aging addresses so if a
4ba0dea5b17369 Greg Rose 2014-03-06 13120 * ndm_state is given only allow permanent addresses
4ba0dea5b17369 Greg Rose 2014-03-06 13121 */
4ba0dea5b17369 Greg Rose 2014-03-06 13122 if (ndm->ndm_state && !(ndm->ndm_state & NUD_PERMANENT)) {
4ba0dea5b17369 Greg Rose 2014-03-06 13123 netdev_info(dev, "FDB only supports static addresses\n");
4ba0dea5b17369 Greg Rose 2014-03-06 13124 return -EINVAL;
4ba0dea5b17369 Greg Rose 2014-03-06 13125 }
4ba0dea5b17369 Greg Rose 2014-03-06 13126
4ba0dea5b17369 Greg Rose 2014-03-06 13127 if (is_unicast_ether_addr(addr) || is_link_local_ether_addr(addr))
4ba0dea5b17369 Greg Rose 2014-03-06 13128 err = dev_uc_add_excl(dev, addr);
4ba0dea5b17369 Greg Rose 2014-03-06 13129 else if (is_multicast_ether_addr(addr))
4ba0dea5b17369 Greg Rose 2014-03-06 13130 err = dev_mc_add_excl(dev, addr);
4ba0dea5b17369 Greg Rose 2014-03-06 13131 else
4ba0dea5b17369 Greg Rose 2014-03-06 13132 err = -EINVAL;
4ba0dea5b17369 Greg Rose 2014-03-06 13133
4ba0dea5b17369 Greg Rose 2014-03-06 13134 /* Only return duplicate errors if NLM_F_EXCL is set */
4ba0dea5b17369 Greg Rose 2014-03-06 13135 if (err == -EEXIST && !(flags & NLM_F_EXCL))
4ba0dea5b17369 Greg Rose 2014-03-06 13136 err = 0;
4ba0dea5b17369 Greg Rose 2014-03-06 13137
4ba0dea5b17369 Greg Rose 2014-03-06 13138 return err;
4ba0dea5b17369 Greg Rose 2014-03-06 13139 }
4ba0dea5b17369 Greg Rose 2014-03-06 13140 Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
Nikolay Aleksandrov
maintainerQuoted 91 lines · Andy Strohman
802.1q networks with IVL (independent VLAN learning) can tolerate duplicate MACs as long as the duplicates reside in different VLANs. Similarly, IVL networks allow for L2 hairpining where different VLANs are used for each side of the hairpin in order to not confuse the intermediate bridge's FDBs.
When these types of networks are inter-connected using 802.1ad or Q-in-Q, only the outer VLAN tag is considered by the 802.1ad bridge during FDB lookup.
While traffic segregation by inner and outer VID works as expected, the inner VLAN's independent VLAN learning can be defeated.
The following example describes the issue in terms of duplicate MACS in different VLANs. But, the same concept described in this example also applies L2 hairpining via different VLANs.
_______________________
| .1ad bridge |
|_______________________|
PVID3| PVID3| PVID3|
| | |TAGGED: 7| 8| 8| ____|____ _____|___ _____|___ | .1q br 1| |.1q br 2| |.1q br 3| |_________| |________| |________| PVID7 | PVID8 | PVID8| HOST A HOST B HOST CThe above diagram depicts a .1ad bridge that has "pvid 3 untagged" configured for every member port. These member ports are connected to .1q bridges, named 1, 2 and 3. .1q br 1 allows VID 7 tagged on its port facing the .1ad bridge. .1q bridge 2 and 3 allow VID 8 tagged on their ports that face the .1ad bridge. Host A is connected to .1q br 1 via a port that is configured as "pvid 7 untagged". Host B and C are connected to bridges via ports configured as "pvid 8 untagged".
Prior to this change, if host A has the same (duplicate) MAC address as host B, this can disrupt communication between host B and host C. This happens because the .1ad bridge will see the duplicate MAC behind two of its ports within the same VID (3). It's not examining the inner VLAN to know that the hosts are actually reside within in different L2 segments.
With this change, the .1ad bridge uses both the inner and outer VID when looking up the FDB. With this technique, host B and C are able to communicate without disruptions due to the duplicate MAC assigned to host A.
Here is an example FDB dump on a .1ad bridge that is configured like the above diagram:
root@OpenWrt:~# bridge fdb show dynamic f4:a4:54:80:93:2f dev lan3 vlan 3 inner vlan 8 master br-lan f4:a4:54:81:7a:90 dev lan1 vlan 3 inner vlan 7 master br-lan f4:a4:54:81:7a:90 dev lan2 vlan 3 inner vlan 8 master br-lanNote how duplicate MAC f4:a4:54:81:7a:90 is behind both lan1 and lan2. This FDB dump shows two entries with the same MAC and the same 802.1ad VLAN, 3. Prior to this change, only one fdb entry per MAC/VID would be possible. As such, the bridge would have issues forwarding. After this change, these entries are understood to be distinct as they pertain to different inner vlans, and therefore separate L2 segments.
Signed-off-by Andy Strohman <[email protected]>--- drivers/net/ethernet/intel/i40e/i40e_main.c | 4 +- drivers/net/ethernet/intel/ice/ice_main.c | 6 +- drivers/net/ethernet/intel/igb/igb_main.c | 4 +- drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 4 +- .../ethernet/mellanox/mlxsw/spectrum_router.c | 4 +- .../ethernet/mellanox/mlxsw/spectrum_span.c | 4 +- .../mellanox/mlxsw/spectrum_switchdev.c | 2 +- drivers/net/ethernet/mscc/ocelot_net.c | 4 +- .../net/ethernet/qlogic/qlcnic/qlcnic_main.c | 8 +- drivers/net/macvlan.c | 4 +- drivers/net/vxlan/vxlan_core.c | 6 +- include/linux/if_bridge.h | 4 +- include/linux/netdevice.h | 6 +- include/linux/rtnetlink.h | 4 +- include/trace/events/bridge.h | 20 ++-- include/uapi/linux/if_link.h | 1 + include/uapi/linux/neighbour.h | 1 + net/bridge/br_arp_nd_proxy.c | 8 +- net/bridge/br_device.c | 11 +-
Quoted 9 lines
net/bridge/br_fdb.c | 107 ++++++++++-------- net/bridge/br_input.c | 22 ++-- net/bridge/br_netlink.c | 18 ++- net/bridge/br_private.h | 25 ++-- net/bridge/br_vlan.c | 34 +++++- net/core/neighbour.c | 1 + net/core/rtnetlink.c | 58 ++++++---- 26 files changed, 227 insertions(+), 143 deletions(-)
Hi,
This patch makes fdb lookups slower for everybody, ruins the nice key alignment, increases the key memory usage and adds more complexity for a corner case, especially having 2 different hosts with identical macs sounds weird. Fdb matching on both tags isn't a feature I've heard of, I don't know if there are switches that support it. Could you point to anywhere in the specs that such support is mentioned? Also could you please give more details about the use case? Maybe we can help you solve your problem without impacting everyone. Perhaps we can mix vlan-aware bridge and tc to solve it. As it stands I'm against adding such matching, but I'd love to hear what other people think.
Cheers,
Nik
Vladimir Oltean
maintainerQuoted 11 lines · Nikolay Aleksandrov
Hi,
This patch makes fdb lookups slower for everybody, ruins the nice key alignment, increases the key memory usage and adds more complexity for a corner case, especially having 2 different hosts with identical macs sounds weird. Fdb matching on both tags isn't a feature I've heard of, I don't know if there are switches that support it. Could you point to anywhere in the specs that such support is mentioned? Also could you please give more details about the use case? Maybe we can help you solve your problem without impacting everyone. Perhaps we can mix vlan-aware bridge and tc to solve it. As it stands I'm against adding such matching, but I'd love to hear what other people think.
Quoted 2 lines
Cheers,
Nik
Correct, I was also going to plan asking Andy what is his plan on making switchdev digest this. The switch ASICs I'm most familiar with can learn on inner VID or outer VID, but not both. Like you, I'm also not sure what 802.1Q says about FDB entries with 2 associated VIDs.
Hi Vladimir,
Thanks for the review.
Quoted 2 lines
I was also going to plan asking Andy what is his plan on making switchdev digest this.
Since switchdev switches don't seem to support this, I wasn't planning on making switchdev digest this. I was thinking that it should just be disabled for those hardware switches.
Quoted 2 lines
The switch ASICs I'm most familiar with can learn
on inner VID or outer VID, but not both.
I don't know of a switch ASIC that supports this.
Is that a problem? I thought that it would be OK to add features to a software bridge that don't exist in any hardware bridge.
I've tried to see if anyone else was facing this same problem. All I found were concerns about the fact that the provider bridge needed to learn all the customer's MACs. As a result, it looks like 802.1Qay was created.
It seems that 802.1Qay is primarily addressing a concern about TCAM limitations, and decoupling the provider and customer networks. I think it's possible that 802.1Qay has inadvertently fixed this issue for provider backbone bridges. But for my use case, I'm not concerned about TCAM usage. I just want isolation between the inner vlans.
Hi Nik,
Thanks for the review.
Quoted 2 lines
This patch makes fdb lookups slower for everybody, ruins the nice key alignment, increases the key memory usage
I could make the additional, inner_vid, fdb member variable's existence depend on a compile time flag, so that these penalties would only affect the users that want the feature.
Quoted 2 lines
and adds more complexity for a corner case, especially having 2 different hosts with identical macs sounds weird.
I admit that the use case is rare. In this commit message,
I focused on the duplicate MAC scenario, because I thought that would be the easiest way to describe it. If the problem is hosts with duplicate MACs, that's probably best remedied by just assigning a different MAC, or translating that MAC before it reaches the 802.1d bridge.
There might be a potential DoS opportunity, if an attacker knows the MAC addresses on a different VLAN. Consider someone on a "guest" VLAN transmitting a frame sourced with the MAC of a server on the "production" VLAN.
My personal use case is about simulating ethernet connections and VLAN aware bridges, so that I can test networking equipment that provides VLAN functionality with IVL.
https://github.com/andrewstrohman/topology-sim/raw/refs/heads/main/docs/Topology%20Simulation%20for%20Mesh%20Testing.pdf?download=
describes it, if you're interested in more information about it.
https://docs.google.com/drawings/d/1FybJP3UyCPxVQRGxAqGztO4Qc5mgXclV4m-QEyfUFQ8
is a diagram that shows what I'm thinking about. This case is not about duplicate macs, but rather a frame being bridged in a way, such that it passes through the same bridge twice via different ports depending on the inner VLAN. In the commit message, this is what I meant by the poorly worded:
"L2 hairpining where different VLANs are used for each side of the hairpin".
The diagram depicts a network where a layer 2 segment is partitioned by a L2 (bridging) firewall. I admit that this is contrived and not a typical way of constructing networks.
In this case, my testing system would use a 802.1ad bridge to simulate a VLAN aware bridge between .1q #1 and .1q #2. The problem is that the .1ad bridge would get confused about which ports hosts A and B are behind. The bridge would see them behind different ports depending on whether the packet was heading to, or returning from the bridge mode firewall.
If these nodes were connected with an IVL .1q bridge instead of the .1ad bridge, this topology would work. So it's a scenario where connectivity failure would be due to my testing system (topology-sim) instead of the networking equipment being tested.
Quoted 2 lines
Fdb matching on both tags isn't a feature I've heard of, I don't know if there are switches that support it. Could you point to anywhere in the specs that such support is mentioned?
I've never heard of this either. It's just an idea that I had. I don't know of any
switches that support it.
Quoted 3 lines
Also could you please give more details about the use case? Maybe we can help you solve your problem without impacting everyone. Perhaps we can mix vlan-aware bridge and tc to solve it.
Thanks. I tried to give the relevant details of my use case above. I think that using tunnels instead of VLANs would fix this for me, because the switches would not learn the inner MAC. But, the tunnel header has more overhead compared to adding a tag.
Quoted 1 line
As it stands I'm against adding such matching
Fair enough. I also have concerns about complexity vs value, myself. I just thought that I would give this a try in case others found it useful.
Vladimir Oltean
maintainerQuoted 23 lines · Andrew Strohman
My personal use case is about simulating ethernet connections and VLAN aware bridges, so that I can test networking equipment that provides VLAN functionality with IVL.
https://github.com/andrewstrohman/topology-sim/raw/refs/heads/main/docs/Topology%20Simulation%20for%20Mesh%20Testing.pdf?download=
describes it, if you're interested in more information about it.https://docs.google.com/drawings/d/1FybJP3UyCPxVQRGxAqGztO4Qc5mgXclV4m-QEyfUFQ8
is a diagram that shows what I'm thinking about. This case is not about duplicate macs, but rather a frame being bridged in a way, such that it passes through the same bridge twice via different ports depending on the inner VLAN. In the commit message, this is what I meant by the poorly worded:
"L2 hairpining where different VLANs are used for each side of the hairpin".The diagram depicts a network where a layer 2 segment is partitioned by a L2 (bridging) firewall. I admit that this is contrived and not a typical way of constructing networks.
In this case, my testing system would use a 802.1ad bridge to simulate a VLAN aware bridge between .1q #1 and .1q #2. The problem is that the .1ad bridge would get confused about which ports hosts A and B are behind. The bridge would see them behind different ports depending on whether the packet was heading to, or returning from the bridge mode firewall.
Quoted 4 lines
If these nodes were connected with an IVL .1q bridge instead of the .1ad bridge, this topology would work. So it's a scenario where connectivity failure would be due to my testing system (topology-sim) instead of the networking equipment being tested.
What stops you from changing the 802.1ad bridge port pvids to unique values, like 3, 4, 5... instead of 3, 3, 3, and making each other j != i bridge port be a non-pvid member of port i's pvid?
That would keep the MAC address isolation per 802.1ad bridge port, and would offer the same level of communication using 100% standard and available tools.
Quoted 3 lines
What stops you from changing the 802.1ad bridge port pvids to unique values, like 3, 4, 5... instead of 3, 3, 3, and making each other j != i bridge port be a non-pvid member of port i's pvid?
I'm not sure if I understand this suggestion.
I tried to draw out what you described here:
https://docs.google.com/drawings/d/1UcOpENFgr-s6p8Ypwo-l4yTvtUZFM6vSLxLiX2FOMLU
I'm not sure how host A can communicate with B with this configuration.
Consider host A transmitting towards host B. When the frame leaves ".1q bridge 3",
it will be tagged with .1q tag vid 7. When the frame leaves the .1ad bridge heading toward ".1q bridge 2", it will be tagged again with an outer .1ad tag vid 3.
So ".1q bridge 2" will see the frame as having an outer tag of .1ad vid 3 and inner tag of .1q vid 7.
Is that what you are thinking, or something else?
Vladimir Oltean
maintainerQuoted 17 lines · Andrew Strohman
Quoted 3 lines
What stops you from changing the 802.1ad bridge port pvids to unique values, like 3, 4, 5... instead of 3, 3, 3, and making each other j != i bridge port be a non-pvid member of port i's pvid?
I'm not sure if I understand this suggestion.
I tried to draw out what you described here:
https://docs.google.com/drawings/d/1UcOpENFgr-s6p8Ypwo-l4yTvtUZFM6vSLxLiX2FOMLUI'm not sure how host A can communicate with B with this configuration.
Consider host A transmitting towards host B. When the frame leaves ".1q bridge 3",
it will be tagged with .1q tag vid 7. When the frame leaves the .1ad bridge heading toward ".1q bridge 2", it will be tagged again with an outer .1ad tag vid 3.
Quoted 4 lines
So ".1q bridge 2" will see the frame as having an outer tag of .1ad vid 3 and inner tag of .1q vid 7.
Is that what you are thinking, or something else?
I didn't say "tagged". I just said "not PVID". There are 2 independent bridge VLAN attributes: "pvid" and [egress-]"untagged". I am suggesting that packets in VID 3, 4, 5 all exit the 802.1ad bridge untagged, but every bridge port has a unique PVID from this range.
bridge vlan add dev port1 vid 3 pvid untagged
bridge vlan add dev port1 vid 4 untagged
bridge vlan add dev port1 vid 5 untagged
bridge vlan add dev port1 vid 3 untagged
bridge vlan add dev port1 vid 4 pvid untagged
bridge vlan add dev port1 vid 5 untagged
bridge vlan add dev port1 vid 3 untagged
bridge vlan add dev port1 vid 4 untagged
bridge vlan add dev port1 vid 5 pvid untagged
Quoted 9 lines
I didn't say "tagged". I just said "not PVID". There are 2 independent bridge VLAN attributes: "pvid" and [egress-]"untagged". I am suggesting that packets in VID 3, 4, 5 all exit the 802.1ad bridge untagged, but every bridge port has a unique PVID from this range.
bridge vlan add dev port1 vid 3 pvid untagged
bridge vlan add dev port1 vid 4 untagged
bridge vlan add dev port1 vid 5 untagged
Quoted 7 lines
bridge vlan add dev port1 vid 3 untagged
bridge vlan add dev port1 vid 4 pvid untagged
bridge vlan add dev port1 vid 5 untaggedbridge vlan add dev port1 vid 3 untagged
bridge vlan add dev port1 vid 4 untagged
bridge vlan add dev port1 vid 5 pvid untagged
Thanks for the clarification. I think you meant to have the second set of three commands affect port2 and the third set of three commands affect port3. Please let me know if I'm wrong about this.
I gave this a try:
root@OpenWrt:~# bridge vlan show
port vlan-id
lan1 3 PVID Egress Untagged
4 Egress Untagged
5 Egress Untagged
lan2 3 Egress Untagged
4 PVID Egress Untagged
5 Egress Untagged
lan3 3 Egress Untagged
4 Egress Untagged
5 PVID Egress Untagged
root@OpenWrt:~# bridge fdb show dynamic
f4:a4:54:80:93:2f dev lan1 vlan 3 master br-lan
e0:3f:49:47:9a:38 dev lan2 vlan 4 master br-lan
f4:a4:54:81:7a:90 dev lan3 vlan 5 master br-lanLike you said, this has a FDB per port. But I think I need to have a FDB per inner/outer VLAN combination.
Connectiving works as expected in the above example, but only because of unknown-unicast flood, which of course, is suboptimal. The switch is acting like a hub.
For example, ever time the host behind lan1 sends a frame to the host behind lan2, the bridge is not able to find an FDB entry for the VID corresponding to PVID of lan1 and the MAC of the host behind lan2. The only FDB entry for the MAC corresponding to the host behind lan2 is associated with the VID corresponding to the PVID of lan2 (which is a different VID than what the packet arrived on). Hence, there is constant unicast flood.
I also don't think that this solves the issue for
https://docs.google.com/drawings/d/1FybJP3UyCPxVQRGxAqGztO4Qc5mgXclV4m-QEyfUFQ8
. If you like, I'm happy to explain why. But before I do, I want to make sure we are on the same page before going further.
Thanks,
Andy
Vladimir Oltean
maintainerQuoted 13 lines · Andrew Strohman
Quoted 13 lines
I didn't say "tagged". I just said "not PVID". There are 2 independent bridge VLAN attributes: "pvid" and [egress-]"untagged". I am suggesting that packets in VID 3, 4, 5 all exit the 802.1ad bridge untagged, but every bridge port has a unique PVID from this range.
bridge vlan add dev port1 vid 3 pvid untagged
bridge vlan add dev port1 vid 4 untagged
bridge vlan add dev port1 vid 5 untaggedbridge vlan add dev port1 vid 3 untagged
bridge vlan add dev port1 vid 4 pvid untagged
bridge vlan add dev port1 vid 5 untagged
Quoted 8 lines
Quoted 3 lines
bridge vlan add dev port1 vid 3 untagged
bridge vlan add dev port1 vid 4 untagged
bridge vlan add dev port1 vid 5 pvid untaggedThanks for the clarification. I think you meant to have the second set of three commands affect port2 and the third set of three commands affect port3. Please let me know if I'm wrong about this.
Yes, it should have been port1, port2, port3.
Quoted 25 lines
I gave this a try:
root@OpenWrt:~# bridge vlan show port vlan-id lan1 3 PVID Egress Untagged 4 Egress Untagged 5 Egress Untagged lan2 3 Egress Untagged 4 PVID Egress Untagged 5 Egress Untagged lan3 3 Egress Untagged 4 Egress Untagged 5 PVID Egress Untagged root@OpenWrt:~# bridge fdb show dynamic f4:a4:54:80:93:2f dev lan1 vlan 3 master br-lan e0:3f:49:47:9a:38 dev lan2 vlan 4 master br-lan f4:a4:54:81:7a:90 dev lan3 vlan 5 master br-lanLike you said, this has a FDB per port. But I think I need to have a FDB per inner/outer VLAN combination.
Connectiving works as expected in the above example, but only because of unknown-unicast flood, which of course, is suboptimal. The switch is acting like a hub.
Quoted 8 lines
For example, ever time the host behind lan1 sends a frame to the host behind lan2, the bridge is not able to find an FDB entry for the VID corresponding to PVID of lan1 and the MAC of the host behind lan2. The only FDB entry for the MAC corresponding to the host behind lan2 is associated with the VID corresponding to the PVID of lan2 (which is a different VID than what the packet arrived on). Hence, there is constant unicast flood.
Yes, I understand this is the implication of my proposal. I just was under the impression that the behavior (complete segregation of stations in the 802.1ad bridge into multiple FDBs) would be equivalent with what you wish to achieve with the Outer+Inner VLAN lookup. To be more precise, I thought that you want to keep the outer VLAN into the mix for FDB lookups for exactly that reason, thus the suggestion to make the isolation at the 802.1ad bridge level directly. I didn't look with enough attention into the FDB dump, to see that in your example, only the inner VID gives the namespacing that you desire.
But to be honest, looking again, I don't understand why just modifying the bridge to perform FDB lookups based on Inner VID + MAC DA wouldn't be sufficient? Why does it have to be Outer VID + Inner VID + MAC DA? I guess adding a bridge option to classify on the inner VLAN protocol could be easier to swallow, both for the software bridge and for switchdev.
Quoted 4 lines
I also don't think that this solves the issue for
https://docs.google.com/drawings/d/1FybJP3UyCPxVQRGxAqGztO4Qc5mgXclV4m-QEyfUFQ8
. If you like, I'm happy to explain why. But before I do, I want to make sure we are on the same page before going further.
Here the same thing. The 802.1ad bridge has the same PVID on all ports. Why does the FDB lookup have to be as complex as to take 2 VIDs into consideration, instead of just the inner one?
Quoted 3 lines
Here the same thing. The 802.1ad bridge has the same PVID on all ports. Why does the FDB lookup have to be as complex as to take 2 VIDs into consideration, instead of just the inner one?
In all my examples I'm using the same PVID, because that's a required condition for the issue to happen. I omit that the other .1ad ports in could have different .1ad VIDs configured for them, to focus on the concept I'm trying to describe.
But other VIDs can be configured on other ports. So, there could be collisions of .1q VIDs across different .1ad VIDs. As such, I don't want to ignore the outer VID during FDB lookup.
In my use case (topology-sim) the test fabric consists of .1ad bridges that are connected to networking equipment under test.
The topology-sim user configures virtual ethernet cables (point to point) and/or L2 IVL ethernet segments between multiple devices under test. They do this to construct an arbitrary ethernet topology that they want to test. topology-sim assigns / maps each one of these L2 segments to a unique .1ad VID. This is how it keeps the "virtual wires" from interfering with each other.
So if one virtual wire (ie .1ad vid 3) is connecting to a switch under test that is emitting frames with .1q vid 7, I want this virtual wire to be independent from another virtual wire (ie .1ad vid 4) that is also emitting frame with .lq7 vid 7.
I acknowledge that we shouldn't make this upstream change just for topology-sim, considering that I'm the only user of it. But these same problems can affect, for example, metro ethernet carriers that use .1ad vlan stacking to differentiate between their different customer's sites. I'm not trying to claim that
metro ethernet carriers would be inclined to use this feature -- I'm just providing another example to point out that this same concept applies to use cases outside of topology-sim, because toplogy-sim uses VLAN stacking in a typical, conventional way.
I'll now proceed to go over my hairpin example,
https://docs.google.com/drawings/d/1FybJP3UyCPxVQRGxAqGztO4Qc5mgXclV4m-QEyfUFQ8
in more detail. I think that it will help demonstrate why I want to consider the inner tags. It's an example about a circuitous network path where the same packet can enter the same .1ad bridge multiple times, with the same .1ad VID, but different inner .1q VIDs.
Like I mentioned before, this network is contrived. I've never seen this done, and don't expect that it is a common topology. But my goal is to prevent connectivity issues that only arise due to how topology-sim constructs the virtual L2 ethernet segments.
The network under test has a bridge mode firewall that is used to inspect traffic as it passes from some subset of a L2 segment to another subset of the same L2 segment. The way that the network operator achieve this goal is by creating separate VLANs for each subset of the L2 segment that need firewall interjection. This way, communicate between these different subsets are forced though the firewall. The firewall bridges the two VLANs to merge them into one L2 segment, one broadcast domain.
Say the topology-sim user wants to interconnect two .q1 bridges via a virtual Ethernet connection. topology-sim accomplishes this by setting the same PVID for both ports that that face these .q1 switches under test.
Let's follow what happens when a packets it transmitted from A towards B.
When the frame is emitted from ".lq #1", heading toward the .1ad switch, it is .1q tagged as 7. When the .1ad bridge receives the frame, it will associate it with .1ad vid 3 and .1q vid 7 can be seen in the packet, if desired.
At this point, the .1ad bridge can either learn that A is behind it's left port, for
.1ad vid 3 (current implementation), or it can learn that
A is behind the left port only for .1ad vid 3 + inner .1a vid 7 (proposed functionality).
When the frame leaves the .1ad switch heading toward
".1q #2", it will just have .1q vid 7 tag. ".1q #2" sends the packet to the firewall,
via its left port, untagged. The firewall bridges the frame, and therefore transmits
out its right port to ".1q #2", untagged. ".1q #2" transmits toward .1ad with .1q tag
8. When the .1ad bridge receives the frame, it will associate it with .1ad vid 3 and the inner .1q vid 8 can be seen in the packet if desired. At this point,
the .1ad bridge can either learn that A is behind its right port, for .1ad vid 3 or it can
learn that A is behind it's right port, for .1ad vid 3 + .1q inner vid 8.
Without my change, the .1ad switch's fdb entry for A's mac, .1ad vid 3, would flip continuously between the left and right port.
With my change, for .1ad vid 3, the .1ad bridge will always forward packets destined
to host A's MAC to the right if the inner vid is 8 and will always forward host A's MAC
to the left when the inner vid is 7.
I hope this example explains why I want to look at the inner VID. The fact that we can have
inner VID collisions for different outer vids, drives the need to examine the outer VID. This is why, collectively I want to consider MAC + inner + outer.
Does that make sense?