linux_dsm_epyc7002/drivers/net/ethernet/mscc
Vladimir Oltean b9cd75e668 net: mscc: ocelot: refuse to overwrite the port's native vlan
The switch driver keeps a "vid" variable per port, which signifies _the_
VLAN ID that is stripped on that port's egress (aka the native VLAN on a
trunk port).

That is the way the hardware is designed (mostly). The port->vid is
programmed into REW:PORT:PORT_VLAN_CFG:PORT_VID and the rewriter is told
to send all traffic as tagged except the one having port->vid.

There exists a possibility of finer-grained egress untagging decisions:
using the VCAP IS1 engine, one rule can be added to match every
VLAN-tagged frame whose VLAN should be untagged, and set POP_CNT=1 as
action. However, the IS1 can hold at most 512 entries, and the VLANs are
in the order of 6 * 4096.

So the code is fine for now. But this sequence of commands:

$ bridge vlan add dev swp0 vid 1 pvid untagged
$ bridge vlan add dev swp0 vid 2 untagged

makes untagged and pvid-tagged traffic be sent out of swp0 as tagged
with VID 1, despite user's request.

Prevent that from happening. The user should temporarily remove the
existing untagged VLAN (1 in this case), add it back as tagged, and then
add the new untagged VLAN (2 in this case).

Cc: Antoine Tenart <antoine.tenart@bootlin.com>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
Fixes: 7142529f16 ("net: mscc: ocelot: add VLAN filtering")
Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-10-29 16:22:07 -07:00
..
Kconfig net: mscc: ocelot: make use of SerDes PHYs for handling their configuration 2018-10-05 14:36:44 -07:00
Makefile net: mscc: ocelot: Hardware ofload for tc flower filter 2019-06-02 13:49:49 -07:00
ocelot_ace.c ocelot_ace: fix action of trap 2019-08-22 15:44:24 -07:00
ocelot_ace.h drivers: net: use flow block API 2019-07-09 14:38:50 -07:00
ocelot_ana.h
ocelot_board.c net: mscc: ocelot: add missing of_node_put after calling of_get_child_by_name 2019-10-01 10:01:58 -07:00
ocelot_dev.h
ocelot_flower.c net: sched: use major priority number as hardware priority 2019-08-18 14:13:23 -07:00
ocelot_io.c
ocelot_police.c net: mscc: ocelot: Implement port policers via tc command 2019-05-29 21:37:49 -07:00
ocelot_police.h net: mscc: ocelot: Implement port policers via tc command 2019-05-29 21:37:49 -07:00
ocelot_ptp.h net: mscc: describe the PTP register range 2019-08-15 16:31:11 -07:00
ocelot_qs.h
ocelot_qsys.h
ocelot_regs.c net: mscc: describe the PTP register range 2019-08-15 16:31:11 -07:00
ocelot_rew.h
ocelot_s2.h net: mscc: ocelot: Add support for tcam 2019-06-02 13:49:49 -07:00
ocelot_sys.h
ocelot_tc.c net: flow_offload: add flow_block structure and use it 2019-07-19 21:27:45 -07:00
ocelot_tc.h net: mscc: ocelot: Implement port policers via tc command 2019-05-29 21:37:49 -07:00
ocelot_vcap.h net: mscc: ocelot: Add support for tcam 2019-06-02 13:49:49 -07:00
ocelot.c net: mscc: ocelot: refuse to overwrite the port's native vlan 2019-10-29 16:22:07 -07:00
ocelot.h net: mscc: PTP Hardware Clock (PHC) support 2019-08-15 16:31:12 -07:00