Issues with a static mac on vxlan access port

Hi.

There are some issues with static mac and vxlan in Cumulus with bcm lib.

When adding a static mac into an access port with vxlan,
it is added into kernel, but not added into asic.

But it is correctly added into kernel and asic, if the vlan-id is trunk, or the port is bond (static or dynamic).

Tested on Cumulus Linux 4.3.0 with bcm asic (Trident2 and Tomahawk)

Test config with trunk

auto vni13101
iface vni13101
bridge-access 3101
vxlan-id 13101

auto swp1
iface swp1
bridge-vids 3101

auto bridge
iface bridge
mtu 9100
bridge-ports swp1 swp3 vni13101
bridge-mcsnoop no
bridge-stp off
bridge-vids 3101
bridge-vlan-aware yes
post-up bridge fdb replace 00:11:12:13:14:15 dev swp1 master static vlan 3101 sticky

# net show bridge mac vlan 3101

VLAN  Master  Interface  MAC                TunnelDest  State   Flags   LastSeen
----  ------  ---------  -----------------  ----------  ------  ------  --------
3101  bridge  swp1       00:11:12:13:14:15              static  sticky  00:09:52
3101  bridge  swp1       dc:2c:6e:09:a9:0b                              00:00:07


# /usr/lib/cumulus/bcmcmd l2 show
mac=dc:2c:6e:09:a9:0b vlan=1 GPORT=0x1 modid=0 port=1/xe0
mac=00:11:12:13:14:15 vlan=28673 GPORT=0x80000002 port=0x80000002(vxlan) Static
mac=dc:2c:6e:09:a9:0b vlan=28673 GPORT=0x80000002 port=0x80000002(vxlan)

mac 00:11:12:13:14:15 presents in the kernel and in the asic

And here is a test config with access vlan

auto vni13101
iface vni13101
bridge-access 3101
vxlan-id 13101

auto swp1
iface swp1
bridge-access 3101

auto bridge
iface bridge
mtu 9100
bridge-ports swp1 vni13101
bridge-mcsnoop no
bridge-stp off
bridge-vids 3101
bridge-vlan-aware yes
post-up bridge fdb replace 00:11:12:13:14:15 dev swp1 master static vlan 3101 sticky

# net show bridge mac vlan 3101

VLAN  Master  Interface  MAC                TunnelDest  State   Flags   LastSeen
----  ------  ---------  -----------------  ----------  ------  ------  --------
3101  bridge  swp1       00:11:12:13:14:15              static  sticky  00:00:13
3101  bridge  swp1       dc:2c:6e:09:a9:0b                              00:00:16

# /usr/lib/cumulus/bcmcmd l2 show
mac=dc:2c:6e:09:a9:0b vlan=3101 GPORT=0x1 modid=0 port=1/xe0 Hit
mac=dc:2c:6e:09:a9:0b vlan=28673 GPORT=0x80000002 port=0x80000002(vxlan) Hit

mac 00:11:12:13:14:15 presents only in kernel, but not installed into asic.

As a solution, a single port static bond could be.

auto vni13101
iface vni13101
bridge-access 3101
vxlan-id 13101

auto swp1
iface swp1

auto bond1
iface bond1
bridge-access 3101
bond-slaves swp1
bond-mode balance-xor
bridge-access 3101

auto bridge
iface bridge
mtu 9100
bridge-ports bond1 vni13101
bridge-mcsnoop no
bridge-stp off
bridge-vids 3101
bridge-vlan-aware yes
post-up bridge fdb replace 00:11:12:13:14:15 dev bond1 master static vlan 3101 sticky

# net show bridge mac vlan 3101

VLAN  Master  Interface  MAC                TunnelDest  State   Flags   LastSeen
----  ------  ---------  -----------------  ----------  ------  ------  --------
3101  bridge  bond1      00:11:12:13:14:15              static  sticky  00:01:37
3101  bridge  bond1      dc:2c:6e:09:a9:0b                              00:00:07

# /usr/lib/cumulus/bcmcmd l2 show
mac=00:11:12:13:14:15 vlan=28673 GPORT=0x80000002 port=0x80000002(vxlan) Static
mac=dc:2c:6e:09:a9:0b vlan=28673 GPORT=0x80000002 port=0x80000002(vxlan)