1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/drivers/net/ethernet/mediatek
Arınç ÜNAL 04910d8cbf net: ethernet: mtk_eth_soc: fix QoS on DSA MAC on non MTK_NETSYS_V2 SoCs
The commit c6d96df9fa ("net: ethernet: mtk_eth_soc: drop generic vlan rx
offload, only use DSA untagging") makes VLAN RX offloading to be only used
on the SoCs without the MTK_NETSYS_V2 ability (which are not just MT7621
and MT7622). The commit disables the proper handling of special tagged
(DSA) frames, added with commit 87e3df4961 ("net-next: ethernet:
mediatek: add CDM able to recognize the tag for DSA"), for non
MTK_NETSYS_V2 SoCs when it finds a MAC that does not use DSA. So if the
other MAC uses DSA, the CDMQ component transmits DSA tagged frames to the
CPU improperly. This issue can be observed on frames with TCP, for example,
a TCP speed test using iperf3 won't work.

The commit disables the proper handling of special tagged (DSA) frames
because it assumes that these SoCs don't use more than one MAC, which is
wrong. Although I made Frank address this false assumption on the patch log
when they sent the patch on behalf of Felix, the code still made changes
with this assumption.

Therefore, the proper handling of special tagged (DSA) frames must be kept
enabled in all circumstances as it doesn't affect non DSA tagged frames.

Hardware DSA untagging, introduced with the commit 2d7605a729 ("net:
ethernet: mtk_eth_soc: enable hardware DSA untagging"), and VLAN RX
offloading are operations on the two CDM components of the frame engine,
CDMP and CDMQ, which connect to Packet DMA (PDMA) and QoS DMA (QDMA) and
are between the MACs and the CPU. These operations apply to all MACs of the
SoC so if one MAC uses DSA and the other doesn't, the hardware DSA
untagging operation will cause the CDMP component to transmit non DSA
tagged frames to the CPU improperly.

Since the VLAN RX offloading feature configuration was dropped, VLAN RX
offloading can only be used along with hardware DSA untagging. So, for the
case above, we need to disable both features and leave it to the CPU,
therefore software, to untag the DSA and VLAN tags.

So the correct way to handle this is:

For all SoCs:

Enable the proper handling of special tagged (DSA) frames
(MTK_CDMQ_IG_CTRL).

For non MTK_NETSYS_V2 SoCs:

Enable hardware DSA untagging (MTK_CDMP_IG_CTRL).
Enable VLAN RX offloading (MTK_CDMP_EG_CTRL).

When a non MTK_NETSYS_V2 SoC MAC does not use DSA:

Disable hardware DSA untagging (MTK_CDMP_IG_CTRL).
Disable VLAN RX offloading (MTK_CDMP_EG_CTRL).

Fixes: c6d96df9fa ("net: ethernet: mtk_eth_soc: drop generic vlan rx offload, only use DSA untagging")
Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2023-05-24 08:04:41 +01:00
..
Kconfig net: ethernet: mtk_eth_soc: switch to external PCS driver 2023-03-20 19:48:35 -07:00
Makefile net: ethernet: mtk_eth_soc: switch to external PCS driver 2023-03-20 19:48:35 -07:00
mtk_eth_path.c net: ethernet: mtk_eth_soc: add support for MT7981 SoC 2023-03-20 19:47:59 -07:00
mtk_eth_soc.c net: ethernet: mtk_eth_soc: fix QoS on DSA MAC on non MTK_NETSYS_V2 SoCs 2023-05-24 08:04:41 +01:00
mtk_eth_soc.h net: ethernet: mtk_eth_soc: drop generic vlan rx offload, only use DSA untagging 2023-05-02 20:19:52 -07:00
mtk_ppe.c net: mtk_eth_soc: mediatek: fix ppe flow accounting for v1 hardware 2023-04-23 13:25:49 +01:00
mtk_ppe.h net: mtk_eth_soc: mediatek: fix ppe flow accounting for v1 hardware 2023-04-23 13:25:49 +01:00
mtk_ppe_debugfs.c net: ethernet: mtk_eth_soc: use be32 type to store be32 values 2023-04-10 18:24:55 -07:00
mtk_ppe_offload.c net: ethernet: mtk_eth_soc: add code for offloading flows from wlan devices 2023-04-07 08:23:08 +01:00
mtk_ppe_regs.h net: ethernet: mtk_eth_soc: ppe: add support for flow accounting 2023-03-20 19:48:23 -07:00
mtk_star_emac.c net: Remove C45 check in C22 only MDIO bus drivers 2023-01-20 18:12:45 -08:00
mtk_wed.c net: ethernet: mtk_eth_soc: fix NULL pointer dereference 2023-05-10 09:23:53 +01:00
mtk_wed.h net: ethernet: mtk_wed: add reset/reset_complete callbacks 2023-01-17 11:36:45 +01:00
mtk_wed_debugfs.c net: ethernet: mediatek: remove return value check of mtk_wed_hw_add_debugfs 2023-04-23 13:37:27 +01:00
mtk_wed_mcu.c net: ethernet: mtk_eth_soc: use WO firmware for MT7981 2023-04-22 14:13:25 +01:00
mtk_wed_ops.c net: ethernet: mtk_eth_soc: add support for Wireless Ethernet Dispatch (WED) 2022-04-06 14:08:49 +01:00
mtk_wed_regs.h net: ethernet: mtk_wed: add mtk_wed_rx_reset routine 2022-11-29 11:40:24 +01:00
mtk_wed_wo.c net: ethernet: mtk_wed: get rid of queue lock for tx queue 2023-01-13 21:35:16 -08:00
mtk_wed_wo.h net: ethernet: mtk_eth_soc: use WO firmware for MT7981 2023-04-22 14:13:25 +01:00