From b5d425af237dc03327078d6b9be178a38b5f8723 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Thu, 27 Aug 2020 06:39:48 +0200 Subject: mediatek/ramips: unify ethernet driver fixes and add performance optimizations Increase DMA burst size and tx ring size and optimize tx processing Signed-off-by: Felix Fietkau --- ...-ethernet-mtk_eth_soc-fix-rx-vlan-offload.patch | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 target/linux/generic/pending-5.4/770-02-net-ethernet-mtk_eth_soc-fix-rx-vlan-offload.patch (limited to 'target/linux/generic/pending-5.4/770-02-net-ethernet-mtk_eth_soc-fix-rx-vlan-offload.patch') diff --git a/target/linux/generic/pending-5.4/770-02-net-ethernet-mtk_eth_soc-fix-rx-vlan-offload.patch b/target/linux/generic/pending-5.4/770-02-net-ethernet-mtk_eth_soc-fix-rx-vlan-offload.patch new file mode 100644 index 0000000000..899bc41c93 --- /dev/null +++ b/target/linux/generic/pending-5.4/770-02-net-ethernet-mtk_eth_soc-fix-rx-vlan-offload.patch @@ -0,0 +1,31 @@ +From: Felix Fietkau +Date: Wed, 26 Aug 2020 16:52:12 +0200 +Subject: [PATCH] net: ethernet: mtk_eth_soc: fix rx vlan offload + +The VLAN ID in the rx descriptor is only valid if the RX_DMA_VID bit is set +Fixes frames wrongly marked with VLAN tags + +Signed-off-by: Felix Fietkau +--- + +--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c ++++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +@@ -1320,7 +1320,7 @@ static int mtk_poll_rx(struct napi_struc + skb->protocol = eth_type_trans(skb, netdev); + + if (netdev->features & NETIF_F_HW_VLAN_CTAG_RX && +- RX_DMA_VID(trxd.rxd3)) ++ (trxd.rxd2 & RX_DMA_VTAG)) + __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), + RX_DMA_VID(trxd.rxd3)); + skb_record_rx_queue(skb, 0); +--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h ++++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h +@@ -293,6 +293,7 @@ + #define RX_DMA_LSO BIT(30) + #define RX_DMA_PLEN0(_x) (((_x) & 0x3fff) << 16) + #define RX_DMA_GET_PLEN0(_x) (((_x) >> 16) & 0x3fff) ++#define RX_DMA_VTAG BIT(15) + + /* QDMA descriptor rxd3 */ + #define RX_DMA_VID(_x) ((_x) & 0xfff) -- cgit v1.2.3