diff options
author | Felix Fietkau <nbd@nbd.name> | 2022-11-10 22:24:54 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2022-11-10 22:27:18 +0100 |
commit | 04b8ad60fd92b375cf661a56afb853344c95ca99 (patch) | |
tree | c37f189dd828fe99f66a7158671747ea434fc295 /target/linux/generic/pending-5.15 | |
parent | 161b22d103decd82868e8e3c3fe09b88cf64724c (diff) | |
download | upstream-04b8ad60fd92b375cf661a56afb853344c95ca99.tar.gz upstream-04b8ad60fd92b375cf661a56afb853344c95ca99.tar.bz2 upstream-04b8ad60fd92b375cf661a56afb853344c95ca99.zip |
kernel: more fixes for mtk_eth_soc performance optimization
- fix features sync between netdevs
- fix crash in dsa_switch_rcv
Fixes: ceb1451c10c1 ("kernel: add mediatek soc ethernet performance improvements")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'target/linux/generic/pending-5.15')
2 files changed, 25 insertions, 20 deletions
diff --git a/target/linux/generic/pending-5.15/732-08-net-dsa-add-support-for-DSA-rx-offloading-via-metada.patch b/target/linux/generic/pending-5.15/732-08-net-dsa-add-support-for-DSA-rx-offloading-via-metada.patch index 7fe7e5c07d..f6799f2949 100644 --- a/target/linux/generic/pending-5.15/732-08-net-dsa-add-support-for-DSA-rx-offloading-via-metada.patch +++ b/target/linux/generic/pending-5.15/732-08-net-dsa-add-support-for-DSA-rx-offloading-via-metada.patch @@ -45,7 +45,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> struct dsa_port *cpu_dp = dev->dsa_ptr; struct sk_buff *nskb = NULL; struct dsa_slave_priv *p; -@@ -238,7 +240,21 @@ static int dsa_switch_rcv(struct sk_buff +@@ -238,7 +240,22 @@ static int dsa_switch_rcv(struct sk_buff if (!skb) return 0; @@ -53,14 +53,15 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> + if (md_dst && md_dst->type == METADATA_HW_PORT_MUX) { + unsigned int port = md_dst->u.port_info.port_id; + -+ dsa_default_offload_fwd_mark(skb); + skb_dst_set(skb, NULL); + if (!skb_has_extensions(skb)) + skb->slow_gro = 0; + + skb->dev = dsa_master_find_slave(dev, 0, port); -+ if (skb->dev) ++ if (likely(skb->dev)) { ++ dsa_default_offload_fwd_mark(skb); + nskb = skb; ++ } + } else { + nskb = cpu_dp->rcv(skb, dev); + } diff --git a/target/linux/generic/pending-5.15/732-09-net-ethernet-mtk_eth_soc-fix-VLAN-rx-hardware-accele.patch b/target/linux/generic/pending-5.15/732-09-net-ethernet-mtk_eth_soc-fix-VLAN-rx-hardware-accele.patch index a065ea8257..8a20202131 100644 --- a/target/linux/generic/pending-5.15/732-09-net-ethernet-mtk_eth_soc-fix-VLAN-rx-hardware-accele.patch +++ b/target/linux/generic/pending-5.15/732-09-net-ethernet-mtk_eth_soc-fix-VLAN-rx-hardware-accele.patch @@ -52,39 +52,43 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> } skb_record_rx_queue(skb, 0); -@@ -2793,15 +2800,25 @@ static netdev_features_t mtk_fix_feature +@@ -2793,15 +2800,30 @@ static netdev_features_t mtk_fix_feature static int mtk_set_features(struct net_device *dev, netdev_features_t features) { - int err = 0; -- -- if (!((dev->features ^ features) & NETIF_F_LRO)) -- return 0; + struct mtk_mac *mac = netdev_priv(dev); + struct mtk_eth *eth = mac->hw; + netdev_features_t diff = dev->features ^ features; + int i; ++ ++ if ((diff & NETIF_F_LRO) && !(features & NETIF_F_LRO)) ++ mtk_hwlro_netdev_disable(dev); + +- if (!((dev->features ^ features) & NETIF_F_LRO)) ++ /* Set RX VLAN offloading */ ++ if (!(diff & NETIF_F_HW_VLAN_CTAG_RX)) + return 0; - if (!(features & NETIF_F_LRO)) -+ if ((diff & NETIF_F_LRO) && !(features & NETIF_F_LRO)) - mtk_hwlro_netdev_disable(dev); +- mtk_hwlro_netdev_disable(dev); ++ mtk_w32(eth, !!(features & NETIF_F_HW_VLAN_CTAG_RX), ++ MTK_CDMP_EG_CTRL); - return err; -+ /* Set RX VLAN offloading */ -+ if (diff & NETIF_F_HW_VLAN_CTAG_RX) -+ mtk_w32(eth, !!(features & NETIF_F_HW_VLAN_CTAG_RX), -+ MTK_CDMP_EG_CTRL); -+ + /* sync features with other MAC */ -+ for (i = 0; i < MTK_MAC_COUNT; i++) -+ if (eth->netdev[i] && eth->netdev[i] != dev) -+ eth->netdev[i]->features = features; ++ for (i = 0; i < MTK_MAC_COUNT; i++) { ++ if (!eth->netdev[i] || eth->netdev[i] == dev) ++ continue; ++ eth->netdev[i]->features &= ~NETIF_F_HW_VLAN_CTAG_RX; ++ eth->netdev[i]->features |= features & NETIF_F_HW_VLAN_CTAG_RX; ++ } + + return 0; } /* wait for DMA to finish whatever it is doing before we start using it again */ -@@ -3083,11 +3100,45 @@ found: +@@ -3083,11 +3105,45 @@ found: return NOTIFY_DONE; } @@ -131,7 +135,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> err = phylink_of_phy_connect(mac->phylink, mac->of_node, 0); if (err) { -@@ -3417,6 +3468,10 @@ static int mtk_hw_init(struct mtk_eth *e +@@ -3417,6 +3473,10 @@ static int mtk_hw_init(struct mtk_eth *e */ val = mtk_r32(eth, MTK_CDMQ_IG_CTRL); mtk_w32(eth, val | MTK_CDMQ_STAG_EN, MTK_CDMQ_IG_CTRL); @@ -142,7 +146,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> /* Enable RX VLan Offloading */ mtk_w32(eth, 1, MTK_CDMP_EG_CTRL); -@@ -3634,6 +3689,12 @@ static int mtk_free_dev(struct mtk_eth * +@@ -3634,6 +3694,12 @@ static int mtk_free_dev(struct mtk_eth * free_netdev(eth->netdev[i]); } |