original_kernel/net/dsa
Vladimir Oltean 4ef8d857b5 net: dsa: tag_8021q: fix the VLAN IDs used for encoding sub-VLANs
When using sub-VLANs in the range of 1-7, the resulting value from:

	rx_vid = dsa_8021q_rx_vid_subvlan(ds, port, subvlan);

is wrong according to the description from tag_8021q.c:

 | 11  | 10  |  9  |  8  |  7  |  6  |  5  |  4  |  3  |  2  |  1  |  0  |
 +-----------+-----+-----------------+-----------+-----------------------+
 |    DIR    | SVL |    SWITCH_ID    |  SUBVLAN  |          PORT         |
 +-----------+-----+-----------------+-----------+-----------------------+

For example, when ds->index == 0, port == 3 and subvlan == 1,
dsa_8021q_rx_vid_subvlan() returns 1027, same as it returns for
subvlan == 0, but it should have returned 1043.

This is because the low portion of the subvlan bits are not masked
properly when writing into the 12-bit VLAN value. They are masked into
bits 4:3, but they should be masked into bits 5:4.

Fixes: 3eaae1d05f ("net: dsa: tag_8021q: support up to 8 VLANs per port using sub-VLANs")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2021-06-01 15:02:05 -07:00
..
Kconfig net: selftest: fix build issue if INET is disabled 2021-04-28 14:06:45 -07:00
Makefile
dsa.c
dsa2.c net: dsa: Allow default tag protocol to be overridden from DT 2021-04-20 16:51:20 -07:00
dsa_priv.h net: dsa: sync up switchdev objects and port attributes when joining the bridge 2021-03-23 14:49:06 -07:00
master.c net: dsa: fix a crash if ->get_sset_count() fails 2021-05-10 14:31:27 -07:00
port.c net: dsa: fix bridge support for drivers without port_bridge_flags callback 2021-04-21 10:47:27 -07:00
slave.c net: dsa: fix error code getting shifted with 4 in dsa_slave_get_sset_count 2021-05-10 14:36:59 -07:00
switch.c net: dsa: Only notify CPU ports of changes to the tag protocol 2021-04-20 16:51:19 -07:00
tag_8021q.c net: dsa: tag_8021q: fix the VLAN IDs used for encoding sub-VLANs 2021-06-01 15:02:05 -07:00
tag_ar9331.c
tag_brcm.c net: dsa: tag_brcm: add support for legacy tags 2021-03-17 12:24:36 -07:00
tag_dsa.c
tag_gswip.c
tag_hellcreek.c
tag_ksz.c
tag_lan9303.c
tag_mtk.c net: dsa: mt7530: support MDB and bridge flag operations 2021-03-16 11:54:41 -07:00
tag_ocelot.c net: mscc: ocelot: support PTP Sync one-step timestamping 2021-04-27 14:10:15 -07:00
tag_ocelot_8021q.c net: mscc: ocelot: support PTP Sync one-step timestamping 2021-04-27 14:10:15 -07:00
tag_qca.c
tag_rtl4_a.c net: dsa: Fix a typo in tag_rtl4_a.c 2021-03-25 17:05:08 -07:00
tag_sja1105.c
tag_trailer.c
tag_xrs700x.c