aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/mediatek/patches-5.4
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2020-09-13 09:34:37 +0200
committerFelix Fietkau <nbd@nbd.name>2020-09-13 11:14:32 +0200
commitf0cc5f6c0a72b7da9ed5915cf561e2f81d514c68 (patch)
tree87523c6da3cfdbd48968d21eacb3049508ea21a9 /target/linux/mediatek/patches-5.4
parent17e64b9447959858c5c85f7f6c98264775585711 (diff)
downloadupstream-f0cc5f6c0a72b7da9ed5915cf561e2f81d514c68.tar.gz
upstream-f0cc5f6c0a72b7da9ed5915cf561e2f81d514c68.tar.bz2
upstream-f0cc5f6c0a72b7da9ed5915cf561e2f81d514c68.zip
ramips/mediatek: improve GRO performance, fix PPE packet parsing
Backport upstream changes to initialize GDM settings and reset PPE Allow GMAC to recognize the special tag to fix PPE packet parsing Improve GRO performance by passing PPE L4 hash as skb hash Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'target/linux/mediatek/patches-5.4')
-rw-r--r--target/linux/mediatek/patches-5.4/0999-hnat.patch26
-rw-r--r--target/linux/mediatek/patches-5.4/1000-eth-gdm-config-backport.patch92
-rw-r--r--target/linux/mediatek/patches-5.4/1011-net-ethernet-mtk_eth_soc-add-support-for-coherent-DM.patch6
3 files changed, 16 insertions, 108 deletions
diff --git a/target/linux/mediatek/patches-5.4/0999-hnat.patch b/target/linux/mediatek/patches-5.4/0999-hnat.patch
index 50850a906e..685c741043 100644
--- a/target/linux/mediatek/patches-5.4/0999-hnat.patch
+++ b/target/linux/mediatek/patches-5.4/0999-hnat.patch
@@ -144,10 +144,10 @@
#include <linux/phylink.h>
+#include <linux/netfilter.h>
+#include <net/netfilter/nf_flow_table.h>
+ #include <net/dsa.h>
#include "mtk_eth_soc.h"
-
-@@ -1320,8 +1322,16 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1327,8 +1329,16 @@ static int mtk_poll_rx(struct napi_struc
(trxd.rxd2 & RX_DMA_VTAG))
__vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q),
RX_DMA_VID(trxd.rxd3));
@@ -166,7 +166,7 @@
skip_rx:
ring->data[idx] = new_data;
-@@ -2255,6 +2265,9 @@ static int mtk_open(struct net_device *d
+@@ -2292,6 +2302,9 @@ static int mtk_open(struct net_device *d
mtk_tx_irq_enable(eth, MTK_TX_DONE_INT);
mtk_rx_irq_enable(eth, MTK_RX_DONE_INT);
refcount_set(&eth->dma_refcnt, 1);
@@ -176,7 +176,7 @@
}
else
refcount_inc(&eth->dma_refcnt);
-@@ -2316,6 +2329,9 @@ static int mtk_stop(struct net_device *d
+@@ -2355,6 +2368,9 @@ static int mtk_stop(struct net_device *d
mtk_dma_free(eth);
@@ -186,7 +186,7 @@
return 0;
}
-@@ -2829,6 +2845,27 @@ static int mtk_set_rxnfc(struct net_devi
+@@ -2853,6 +2869,27 @@ static int mtk_set_rxnfc(struct net_devi
return ret;
}
@@ -214,7 +214,7 @@
static const struct ethtool_ops mtk_ethtool_ops = {
.get_link_ksettings = mtk_get_link_ksettings,
.set_link_ksettings = mtk_set_link_ksettings,
-@@ -2860,6 +2897,9 @@ static const struct net_device_ops mtk_n
+@@ -2884,6 +2921,9 @@ static const struct net_device_ops mtk_n
#ifdef CONFIG_NET_POLL_CONTROLLER
.ndo_poll_controller = mtk_poll_controller,
#endif
@@ -224,7 +224,7 @@
};
static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np)
-@@ -3202,6 +3242,7 @@ static const struct mtk_soc_data mt7622_
+@@ -3226,6 +3266,7 @@ static const struct mtk_soc_data mt7622_
.hw_features = MTK_HW_FEATURES,
.required_clks = MT7622_CLKS_BITMAP,
.required_pctl = false,
@@ -234,7 +234,7 @@
static const struct mtk_soc_data mt7623_data = {
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
-@@ -787,6 +787,13 @@ enum mkt_eth_capabilities {
+@@ -790,6 +790,13 @@ enum mkt_eth_capabilities {
MTK_MUX_U3_GMAC2_TO_QPHY | \
MTK_MUX_GMAC12_TO_GEPHY_SGMII | MTK_QDMA)
@@ -248,7 +248,7 @@
/* struct mtk_eth_data - This is the structure holding all differences
* among various plaforms
* @ana_rgc3: The offset for register ANA_RGC3 related to
-@@ -804,6 +811,7 @@ struct mtk_soc_data {
+@@ -807,6 +814,7 @@ struct mtk_soc_data {
u32 required_clks;
bool required_pctl;
netdev_features_t hw_features;
@@ -256,7 +256,7 @@
};
/* currently no SoC has more than 2 macs */
-@@ -829,6 +837,23 @@ struct mtk_sgmii {
+@@ -832,6 +840,23 @@ struct mtk_sgmii {
u32 ana_rgc3;
};
@@ -280,7 +280,7 @@
/* struct mtk_eth - This is the main datasructure for holding the state
* of the driver
* @dev: The device pointer
-@@ -914,6 +939,16 @@ struct mtk_eth {
+@@ -917,6 +942,16 @@ struct mtk_eth {
u32 tx_int_status_reg;
u32 rx_dma_l4_valid;
int ip_align;
@@ -297,7 +297,7 @@
};
/* struct mtk_mac - the structure that holds the info about the MACs of the
-@@ -946,6 +981,7 @@ void mtk_stats_update_mac(struct mtk_mac
+@@ -949,6 +984,7 @@ void mtk_stats_update_mac(struct mtk_mac
void mtk_w32(struct mtk_eth *eth, u32 val, unsigned reg);
u32 mtk_r32(struct mtk_eth *eth, unsigned reg);
@@ -305,7 +305,7 @@
int mtk_sgmii_init(struct mtk_sgmii *ss, struct device_node *np,
u32 ana_rgc3);
-@@ -958,4 +994,13 @@ int mtk_gmac_sgmii_path_setup(struct mtk
+@@ -961,4 +997,13 @@ int mtk_gmac_sgmii_path_setup(struct mtk
int mtk_gmac_gephy_path_setup(struct mtk_eth *eth, int mac_id);
int mtk_gmac_rgmii_path_setup(struct mtk_eth *eth, int mac_id);
diff --git a/target/linux/mediatek/patches-5.4/1000-eth-gdm-config-backport.patch b/target/linux/mediatek/patches-5.4/1000-eth-gdm-config-backport.patch
deleted file mode 100644
index a2acadfd90..0000000000
--- a/target/linux/mediatek/patches-5.4/1000-eth-gdm-config-backport.patch
+++ /dev/null
@@ -1,92 +0,0 @@
---- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -2240,6 +2240,31 @@ static int mtk_start_dma(struct mtk_eth
- return 0;
- }
-
-+static void mtk_gdm_config(struct mtk_eth *eth, u32 config)
-+{
-+ int i;
-+
-+ if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628))
-+ return;
-+
-+ for (i = 0; i < MTK_MAC_COUNT; i++) {
-+ u32 val = mtk_r32(eth, MTK_GDMA_FWD_CFG(i));
-+
-+ /* default setup the forward port to send frame to PDMA */
-+ val &= ~0xffff;
-+
-+ /* Enable RX checksum */
-+ val |= MTK_GDMA_ICS_EN | MTK_GDMA_TCS_EN | MTK_GDMA_UCS_EN;
-+
-+ val |= config;
-+
-+ mtk_w32(eth, val, MTK_GDMA_FWD_CFG(i));
-+ }
-+ /* Reset and enable PSE */
-+ mtk_w32(eth, RST_GL_PSE, MTK_RST_GL);
-+ mtk_w32(eth, 0, MTK_RST_GL);
-+}
-+
- static int mtk_open(struct net_device *dev)
- {
- struct mtk_mac *mac = netdev_priv(dev);
-@@ -2260,6 +2285,8 @@ static int mtk_open(struct net_device *d
- if (err)
- return err;
-
-+ mtk_gdm_config(eth, MTK_GDMA_TO_PDMA);
-+
- napi_enable(&eth->tx_napi);
- napi_enable(&eth->rx_napi);
- mtk_tx_irq_enable(eth, MTK_TX_DONE_INT);
-@@ -2315,6 +2342,8 @@ static int mtk_stop(struct net_device *d
- if (!refcount_dec_and_test(&eth->dma_refcnt))
- return 0;
-
-+ mtk_gdm_config(eth, MTK_GDMA_DROP_ALL);
-+
- mtk_tx_irq_disable(eth, MTK_TX_DONE_INT);
- mtk_rx_irq_disable(eth, MTK_RX_DONE_INT);
- napi_disable(&eth->tx_napi);
-@@ -2498,8 +2527,6 @@ static int mtk_hw_init(struct mtk_eth *e
- /* disable delay and normal interrupt */
- mtk_tx_irq_disable(eth, ~0);
- mtk_rx_irq_disable(eth, ~0);
-- mtk_w32(eth, RST_GL_PSE, MTK_RST_GL);
-- mtk_w32(eth, 0, MTK_RST_GL);
-
- /* FE int grouping */
- mtk_w32(eth, MTK_TX_DONE_INT, MTK_PDMA_INT_GRP1);
-@@ -2508,19 +2535,6 @@ static int mtk_hw_init(struct mtk_eth *e
- mtk_w32(eth, MTK_RX_DONE_INT, MTK_QDMA_INT_GRP2);
- mtk_w32(eth, 0x21021000, MTK_FE_INT_GRP);
-
-- for (i = 0; i < MTK_MAC_COUNT; i++) {
-- u32 val = mtk_r32(eth, MTK_GDMA_FWD_CFG(i));
--
-- /* setup the forward port to send frame to PDMA */
-- val &= ~0xffff;
--
-- /* Enable RX checksum */
-- val |= MTK_GDMA_ICS_EN | MTK_GDMA_TCS_EN | MTK_GDMA_UCS_EN;
--
-- /* setup the mac dma */
-- mtk_w32(eth, val, MTK_GDMA_FWD_CFG(i));
-- }
--
- return 0;
-
- err_disable_pm:
---- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
-+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
-@@ -85,6 +85,8 @@
- #define MTK_GDMA_ICS_EN BIT(22)
- #define MTK_GDMA_TCS_EN BIT(21)
- #define MTK_GDMA_UCS_EN BIT(20)
-+#define MTK_GDMA_TO_PDMA 0x0
-+#define MTK_GDMA_DROP_ALL 0x7777
-
- /* Unicast Filter MAC Address Register - Low */
- #define MTK_GDMA_MAC_ADRL(x) (0x508 + (x * 0x1000))
diff --git a/target/linux/mediatek/patches-5.4/1011-net-ethernet-mtk_eth_soc-add-support-for-coherent-DM.patch b/target/linux/mediatek/patches-5.4/1011-net-ethernet-mtk_eth_soc-add-support-for-coherent-DM.patch
index cc104927d8..ed9aecdf74 100644
--- a/target/linux/mediatek/patches-5.4/1011-net-ethernet-mtk_eth_soc-add-support-for-coherent-DM.patch
+++ b/target/linux/mediatek/patches-5.4/1011-net-ethernet-mtk_eth_soc-add-support-for-coherent-DM.patch
@@ -37,7 +37,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
#include <linux/mfd/syscon.h>
#include <linux/regmap.h>
#include <linux/clk.h>
-@@ -2476,6 +2477,12 @@ static int mtk_hw_init(struct mtk_eth *e
+@@ -2486,6 +2487,12 @@ static int mtk_hw_init(struct mtk_eth *e
if (ret)
goto err_disable_pm;
@@ -50,7 +50,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628)) {
ret = device_reset(eth->dev);
if (ret) {
-@@ -3078,6 +3085,16 @@ static int mtk_probe(struct platform_dev
+@@ -3088,6 +3095,16 @@ static int mtk_probe(struct platform_dev
}
}
@@ -69,7 +69,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
GFP_KERNEL);
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
-@@ -425,6 +425,11 @@
+@@ -426,6 +426,11 @@
#define RSTCTRL_FE BIT(6)
#define RSTCTRL_PPE BIT(31)