linux/drivers/net/ethernet
Vladimir Oltean bfbab31044 net: mscc: ocelot: add the local station MAC addresses in VID 0
The ocelot switchdev driver does not include the CPU port in the list of
flooding destinations for unknown traffic, instead that traffic is
supposed to match FDB entries to reach the CPU.

The addresses it installs are:
(a) the station MAC address, in ocelot_probe_port() and later during
    runtime in ocelot_port_set_mac_address(). These are the VLAN-unaware
    addresses. The VLAN-aware addresses are in ocelot_vlan_vid_add().
(b) multicast addresses added with dev_mc_add() (not bridge host MDB
    entries) in ocelot_mc_sync()
(c) multicast destination MAC addresses for MRP in ocelot_mrp_save_mac(),
    to make sure those are dropped (not forwarded) by the bridging
    service, just trapped to the CPU

So we can see that the logic is slightly buggy ever since the initial
commit a556c76adc ("net: mscc: Add initial Ocelot switch support").
This is because, when ocelot_probe_port() runs, the port pvid is 0.
Then we join a VLAN-aware bridge, the pvid becomes 1, we call
ocelot_port_set_mac_address(), this learns the new MAC address in VID 1
(also fails to forget the old one, since it thinks it's in VID 1, but
that's not so important). Then when we leave the VLAN-aware bridge,
outside world is unable to ping our new MAC address because it isn't
learned in VID 0, the VLAN-unaware pvid.

[ note: this is strictly based on static analysis, I don't have hardware
  to test. But there are also many more corner cases ]

The basic idea is that we should have a separation of concerns, and the
FDB entries used for standalone operation should be managed by the
driver, and the FDB entries used by the bridging service should be
managed by the bridge. So the standalone and VLAN-unaware bridge FDB
entries should not follow the bridge PVID, because that will only be
active when the bridge is VLAN-aware. So since the port pvid is
coincidentally zero during probe time, just make those entries
statically go to VID 0.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2021-10-21 12:14:29 +01:00
..
3com ethernet: replace netdev->dev_addr 16bit writes 2021-10-14 09:22:27 -07:00
8390 ethernet: 8390: remove direct netdev->dev_addr writes 2021-10-09 11:46:57 +01:00
actions ethernet: constify references to netdev->dev_addr in drivers 2021-10-14 09:22:11 -07:00
adaptec ethernet: adaptec: use eth_hw_addr_set() 2021-10-16 08:53:45 +01:00
aeroflex ethernet: aeroflex: use eth_hw_addr_set() 2021-10-16 08:53:45 +01:00
agere ethernet: use eth_hw_addr_set() instead of ether_addr_copy() 2021-10-02 14:18:25 +01:00
alacritech ethernet: constify references to netdev->dev_addr in drivers 2021-10-14 09:22:11 -07:00
allwinner ethernet: use of_get_ethdev_address() 2021-10-07 13:39:51 +01:00
alteon ethernet: alteon: use eth_hw_addr_set() 2021-10-16 08:53:46 +01:00
altera ethernet: constify references to netdev->dev_addr in drivers 2021-10-14 09:22:11 -07:00
amazon ethernet: use eth_hw_addr_set() instead of ether_addr_copy() 2021-10-02 14:18:25 +01:00
amd ethernet: amd: use eth_hw_addr_set() 2021-10-16 08:53:46 +01:00
apm ethernet: constify references to netdev->dev_addr in drivers 2021-10-14 09:22:11 -07:00
apple ethernet: replace netdev->dev_addr assignment loops 2021-10-14 09:22:25 -07:00
aquantia ethernet: aquantia: use eth_hw_addr_set() 2021-10-16 08:53:46 +01:00
arc Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-10-14 16:50:14 -07:00
atheros ethernet: make use of eth_hw_addr_random() where appropriate 2021-10-14 09:22:15 -07:00
broadcom ethernet: Remove redundant statement 2021-10-19 13:10:44 +01:00
brocade ethernet: Remove redundant 'flush_workqueue()' calls 2021-10-10 11:33:15 +01:00
cadence ethernet: manually convert memcpy(dev_addr,..., sizeof(addr)) 2021-10-14 09:22:19 -07:00
calxeda ethernet: use eth_hw_addr_set() in unmaintained drivers 2021-10-18 13:20:38 +01:00
cavium ethernet: Remove redundant 'flush_workqueue()' calls 2021-10-10 11:33:15 +01:00
chelsio tcp: switch orphan_count to bare per-cpu counters 2021-10-15 11:28:34 +01:00
cirrus ethernet: use eth_hw_addr_set() in unmaintained drivers 2021-10-18 13:20:38 +01:00
cisco ethernet: enic: use eth_hw_addr_set() 2021-10-16 08:53:46 +01:00
cortina ethernet: make use of eth_hw_addr_random() where appropriate 2021-10-14 09:22:15 -07:00
davicom ethernet: use eth_hw_addr_set() in unmaintained drivers 2021-10-18 13:20:38 +01:00
dec net: tulip: winbond-840: fix build for UML 2021-10-14 19:18:53 -07:00
dlink ethernet: replace netdev->dev_addr 16bit writes 2021-10-14 09:22:27 -07:00
emulex ethernet: constify references to netdev->dev_addr in drivers 2021-10-14 09:22:11 -07:00
ezchip ethernet: use of_get_ethdev_address() 2021-10-07 13:39:51 +01:00
faraday ethernet: make more use of device_get_ethdev_address() 2021-10-07 13:39:51 +01:00
freescale net: enetc: unmap DMA in enetc_send_cmd() 2021-10-20 14:32:15 +01:00
fujitsu ethernet: use eth_hw_addr_set() in unmaintained drivers 2021-10-18 13:20:38 +01:00
google gve: Track RX buffer allocation failures 2021-10-11 23:25:36 +01:00
hisilicon ethernet: make use of eth_hw_addr_random() where appropriate 2021-10-14 09:22:15 -07:00
huawei ethernet: use eth_hw_addr_set() in unmaintained drivers 2021-10-18 13:20:38 +01:00
i825xx ethernet: replace netdev->dev_addr assignment loops 2021-10-14 09:22:25 -07:00
ibm ethernet: ibmveth: use ether_addr_to_u64() 2021-10-16 08:53:46 +01:00
intel ice: fix an error code in ice_ena_vfs() 2021-10-19 10:53:28 -07:00
litex ethernet: use of_get_ethdev_address() 2021-10-07 13:39:51 +01:00
marvell ethernet: prestera: use eth_hw_addr_gen() 2021-10-19 12:46:24 +01:00
mediatek ethernet: constify references to netdev->dev_addr in drivers 2021-10-14 09:22:11 -07:00
mellanox ethernet: mlxsw: use eth_hw_addr_gen() 2021-10-19 12:46:25 +01:00
micrel ethernet: use eth_hw_addr_set() in unmaintained drivers 2021-10-18 13:20:38 +01:00
microchip ethernet: sparx5: use eth_hw_addr_gen() 2021-10-19 12:46:25 +01:00
microsoft Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-10-14 16:50:14 -07:00
moxa ethernet: use eth_hw_addr_set() for dev->addr_len cases 2021-10-05 13:16:48 +01:00
mscc net: mscc: ocelot: add the local station MAC addresses in VID 0 2021-10-21 12:14:29 +01:00
myricom ethernet: replace netdev->dev_addr assignment loops 2021-10-14 09:22:25 -07:00
natsemi ethernet: use eth_hw_addr_set() in unmaintained drivers 2021-10-18 13:20:38 +01:00
neterion Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-10-14 16:50:14 -07:00
netronome net: sched: Merge Qdisc::bstats and Qdisc::cpu_bstats data types 2021-10-18 12:54:41 +01:00
ni ethernet: use eth_hw_addr_set() instead of ether_addr_copy() 2021-10-02 14:18:25 +01:00
nvidia ethernet: forcedeth: remove direct netdev->dev_addr writes 2021-10-09 11:46:56 +01:00
nxp ethernet: lpc: use eth_hw_addr_set() 2021-10-19 12:41:47 +01:00
oki-semi ethernet: use eth_hw_addr_set() for dev->addr_len cases 2021-10-05 13:16:48 +01:00
packetengines ethernet: use eth_hw_addr_set() in unmaintained drivers 2021-10-18 13:20:38 +01:00
pasemi ethernet: manually convert memcpy(dev_addr,..., sizeof(addr)) 2021-10-14 09:22:19 -07:00
pensando Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-10-14 16:50:14 -07:00
qlogic ethernet: netxen: use eth_hw_addr_set() 2021-10-19 12:41:47 +01:00
qualcomm ethernet: make use of eth_hw_addr_random() where appropriate 2021-10-14 09:22:15 -07:00
rdc ethernet: replace netdev->dev_addr 16bit writes 2021-10-14 09:22:27 -07:00
realtek ethernet: r8169: use eth_hw_addr_set() 2021-10-19 12:41:47 +01:00
renesas ethernet: renesas: use eth_hw_addr_set() 2021-10-19 12:41:47 +01:00
rocker ethernet: rocker: use eth_hw_addr_set() 2021-10-19 12:41:47 +01:00
samsung ethernet: sxgbe: use eth_hw_addr_set() 2021-10-19 12:41:48 +01:00
seeq ethernet: use eth_hw_addr_set() for dev->addr_len cases 2021-10-05 13:16:48 +01:00
sfc sfc: Fix reading non-legacy supported link modes 2021-10-18 14:28:02 +01:00
sgi ethernet: use eth_hw_addr_set() for dev->addr_len cases 2021-10-05 13:16:48 +01:00
silan ethernet: use eth_hw_addr_set() in unmaintained drivers 2021-10-18 13:20:38 +01:00
sis ethernet: sis900: use eth_hw_addr_set() 2021-10-19 12:41:48 +01:00
smsc ethernet: smsc: use eth_hw_addr_set() 2021-10-19 12:41:48 +01:00
socionext ethernet: netsec: use eth_hw_addr_set() 2021-10-20 11:41:01 +01:00
stmicro ethernet: stmmac: use eth_hw_addr_set() 2021-10-20 11:41:01 +01:00
sun ethernet: use eth_hw_addr_set() in unmaintained drivers 2021-10-18 13:20:38 +01:00
synopsys ethernet: constify references to netdev->dev_addr in drivers 2021-10-14 09:22:11 -07:00
tehuti ethernet: tehuti: use eth_hw_addr_set() 2021-10-20 11:41:01 +01:00
ti ethernet: tlan: use eth_hw_addr_set() 2021-10-20 11:41:01 +01:00
toshiba ethernet: use eth_hw_addr_set() in unmaintained drivers 2021-10-18 13:20:38 +01:00
tundra dev_ioctl: split out ndo_eth_ioctl 2021-07-27 20:11:45 +01:00
via ethernet: via-velocity: use eth_hw_addr_set() 2021-10-20 11:41:01 +01:00
wiznet net: w5100: Make w5100_remove() return void 2021-10-18 12:59:12 +01:00
xilinx ethernet: constify references to netdev->dev_addr in drivers 2021-10-14 09:22:11 -07:00
xircom ethernet: use eth_hw_addr_set() in unmaintained drivers 2021-10-18 13:20:38 +01:00
xscale net: ethernet: ixp4xx: Make use of dma_pool_zalloc() instead of dma_pool_alloc/memset() 2021-10-19 13:24:26 +01:00
dnet.c ethernet: manually convert memcpy(dev_addr,..., sizeof(addr)) 2021-10-14 09:22:19 -07:00
dnet.h
ec_bhf.c ethernet: ec_bhf: use eth_hw_addr_set() 2021-10-16 08:53:46 +01:00
ethoc.c ethernet: use eth_hw_addr_set() in unmaintained drivers 2021-10-18 13:20:38 +01:00
fealnx.c ethernet: use eth_hw_addr_set() in unmaintained drivers 2021-10-18 13:20:38 +01:00
jme.c ethernet: use eth_hw_addr_set() for dev->addr_len cases 2021-10-05 13:16:48 +01:00
jme.h
Kconfig net: korina: select CRC32 2021-10-13 13:28:35 -07:00
korina.c ethernet: use of_get_ethdev_address() 2021-10-07 13:39:51 +01:00
lantiq_etop.c net: lantiq: configure the burst length in ethernet drivers 2021-09-15 11:02:01 +01:00
lantiq_xrx200.c ethernet: use of_get_ethdev_address() 2021-10-07 13:39:51 +01:00
Makefile net: Add driver for LiteX's LiteETH network interface 2021-08-26 12:13:52 +01:00