[][MAC80211][misc][Refactor wed/flowblock/mtk_ppe patches]
[Description]
Refactor wed/flowblock/mtk_ppe patches
[Release-log]
Change-Id: I4353142dea601460dcae92b8b70e71dd79cc38fb
Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/8021862
diff --git a/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3002-ovs-add-multicast-to-unicast-support.patch b/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3000-ovs-add-multicast-to-unicast-support.patch
old mode 100755
new mode 100644
similarity index 94%
rename from autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3002-ovs-add-multicast-to-unicast-support.patch
rename to autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3000-ovs-add-multicast-to-unicast-support.patch
index c707ee2..11c2c8e
--- a/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3002-ovs-add-multicast-to-unicast-support.patch
+++ b/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3000-ovs-add-multicast-to-unicast-support.patch
@@ -1,3 +1,16 @@
+From 0a78a8c88b4db2a49aad7544c085078d65dbd343 Mon Sep 17 00:00:00 2001
+From: mtk22468 <Xuzhu.Wang@mediatek.com>
+Date: Mon, 18 Sep 2023 10:50:36 +0800
+Subject: [PATCH 01/22] ovs add multicast to unicast support
+
+---
+ net/openvswitch/actions.c | 30 ++++
+ net/openvswitch/datapath.c | 289 +++++++++++++++++++++++++++++++++++++
+ net/openvswitch/datapath.h | 32 ++++
+ net/openvswitch/vport.c | 8 +
+ net/openvswitch/vport.h | 26 ++++
+ 5 files changed, 385 insertions(+)
+
diff --git a/net/openvswitch/actions.c b/net/openvswitch/actions.c
index 9e8a5c4..d5bf30d 100644
--- a/net/openvswitch/actions.c
@@ -47,7 +60,7 @@
} else if (mru <= vport->dev->mtu) {
struct net *net = read_pnet(&dp->net);
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c
-index 4f097bd..9a2a8c0 100644
+index 4c537e7..40b4795 100644
--- a/net/openvswitch/datapath.c
+++ b/net/openvswitch/datapath.c
@@ -11,6 +11,9 @@
@@ -60,7 +73,7 @@
#include <linux/jhash.h>
#include <linux/delay.h>
#include <linux/time.h>
-@@ -530,6 +533,270 @@ static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb,
+@@ -538,6 +541,270 @@ static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb,
return err;
}
@@ -331,7 +344,7 @@
static int ovs_packet_cmd_execute(struct sk_buff *skb, struct genl_info *info)
{
struct ovs_header *ovs_header = info->userhdr;
-@@ -604,6 +871,9 @@ static int ovs_packet_cmd_execute(struct sk_buff *skb, struct genl_info *info)
+@@ -612,6 +879,9 @@ static int ovs_packet_cmd_execute(struct sk_buff *skb, struct genl_info *info)
OVS_CB(packet)->input_vport = input_vport;
sf_acts = rcu_dereference(flow->sf_acts);
@@ -341,7 +354,7 @@
local_bh_disable();
err = ovs_execute_actions(dp, packet, sf_acts, &flow->key);
local_bh_enable();
-@@ -2183,6 +2453,9 @@ static int ovs_vport_cmd_del(struct sk_buff *skb, struct genl_info *info)
+@@ -2199,6 +2469,9 @@ static int ovs_vport_cmd_del(struct sk_buff *skb, struct genl_info *info)
struct datapath *dp;
struct vport *vport;
unsigned int new_headroom;
@@ -351,7 +364,7 @@
int err;
reply = ovs_vport_cmd_alloc_info();
-@@ -2210,6 +2483,22 @@ static int ovs_vport_cmd_del(struct sk_buff *skb, struct genl_info *info)
+@@ -2226,6 +2499,22 @@ static int ovs_vport_cmd_del(struct sk_buff *skb, struct genl_info *info)
if (netdev_get_fwd_headroom(vport->dev) == dp->max_headroom)
update_headroom = true;
@@ -480,3 +493,6 @@
};
/**
+--
+2.18.0
+
diff --git a/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3003-mt7622-backport-nf-hw-offload-framework-and-ups.patch b/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3001-mt7622-backport-nf-hw-offload-framework-and-upstream.patch
old mode 100755
new mode 100644
similarity index 96%
rename from autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3003-mt7622-backport-nf-hw-offload-framework-and-ups.patch
rename to autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3001-mt7622-backport-nf-hw-offload-framework-and-upstream.patch
index 9ccf9ce..ec6efb9
--- a/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3003-mt7622-backport-nf-hw-offload-framework-and-ups.patch
+++ b/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3001-mt7622-backport-nf-hw-offload-framework-and-upstream.patch
@@ -1,17 +1,17 @@
-From 6ad9bd65769003ab526e504577e0f747eba14287 Mon Sep 17 00:00:00 2001
+From b80c745d2b90b30558e4f5b12060af956ae8e76d Mon Sep 17 00:00:00 2001
From: Bo Jiao <Bo.Jiao@mediatek.com>
-Date: Wed, 22 Jun 2022 09:42:19 +0800
-Subject: [PATCH 1/8]
- 9990-mt7622-backport-nf-hw-offload-framework-and-upstream-hnat-plus-xt-FLOWOFFLOAD-update-v2
+Date: Mon, 18 Sep 2023 10:52:27 +0800
+Subject: [PATCH 02/22] mt7622 backport nf hw offload framework and upstream
+ hnat plus xt-FLOWOFFLOAD update v2
---
drivers/net/ethernet/mediatek/Makefile | 3 +-
- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 28 +-
- drivers/net/ethernet/mediatek/mtk_eth_soc.h | 20 +-
- drivers/net/ethernet/mediatek/mtk_ppe.c | 509 +++++++
+ drivers/net/ethernet/mediatek/mtk_eth_soc.c | 25 +-
+ drivers/net/ethernet/mediatek/mtk_eth_soc.h | 19 +-
+ drivers/net/ethernet/mediatek/mtk_ppe.c | 510 +++++++
drivers/net/ethernet/mediatek/mtk_ppe.h | 288 ++++
.../net/ethernet/mediatek/mtk_ppe_debugfs.c | 214 +++
- .../net/ethernet/mediatek/mtk_ppe_offload.c | 526 ++++++++
+ .../net/ethernet/mediatek/mtk_ppe_offload.c | 535 ++++++++
drivers/net/ethernet/mediatek/mtk_ppe_regs.h | 144 ++
drivers/net/ppp/ppp_generic.c | 22 +
drivers/net/ppp/pppoe.c | 24 +
@@ -23,7 +23,7 @@
.../net/netfilter/ipv6/nf_conntrack_ipv6.h | 3 -
include/net/netfilter/nf_conntrack.h | 12 +
include/net/netfilter/nf_conntrack_acct.h | 11 +
- include/net/netfilter/nf_flow_table.h | 264 +++-
+ include/net/netfilter/nf_flow_table.h | 266 +++-
include/net/netns/conntrack.h | 6 +
.../linux/netfilter/nf_conntrack_common.h | 9 +-
include/uapi/linux/netfilter/xt_FLOWOFFLOAD.h | 17 +
@@ -33,7 +33,7 @@
net/bridge/br_vlan.c | 55 +
net/core/dev.c | 46 +
net/dsa/dsa.c | 9 +
- net/dsa/slave.c | 41 +-
+ net/dsa/slave.c | 37 +-
net/ipv4/netfilter/Kconfig | 4 +-
net/ipv6/ip6_output.c | 2 +-
net/ipv6/netfilter/Kconfig | 3 +-
@@ -44,11 +44,14 @@
net/netfilter/nf_conntrack_proto_tcp.c | 4 +
net/netfilter/nf_conntrack_proto_udp.c | 4 +
net/netfilter/nf_conntrack_standalone.c | 34 +-
- net/netfilter/nf_flow_table_core.c | 446 +++---
- net/netfilter/nf_flow_table_ip.c | 455 ++++---
- net/netfilter/nf_flow_table_offload.c | 1191 +++++++++++++++++
- net/netfilter/xt_FLOWOFFLOAD.c | 719 ++++++++++
- 43 files changed, 4913 insertions(+), 432 deletions(-)
+ net/netfilter/nf_flow_table_core.c | 462 ++++---
+ net/netfilter/nf_flow_table_ip.c | 447 +++---
+ net/netfilter/nf_flow_table_offload.c | 1199 +++++++++++++++++
+ net/netfilter/xt_FLOWOFFLOAD.c | 794 +++++++++++
+ 43 files changed, 5005 insertions(+), 435 deletions(-)
+ mode change 100644 => 100755 drivers/net/ethernet/mediatek/Makefile
+ mode change 100644 => 100755 drivers/net/ethernet/mediatek/mtk_eth_soc.c
+ mode change 100644 => 100755 drivers/net/ethernet/mediatek/mtk_eth_soc.h
create mode 100644 drivers/net/ethernet/mediatek/mtk_ppe.c
create mode 100644 drivers/net/ethernet/mediatek/mtk_ppe.h
create mode 100644 drivers/net/ethernet/mediatek/mtk_ppe_debugfs.c
@@ -59,7 +62,9 @@
create mode 100644 net/netfilter/xt_FLOWOFFLOAD.c
diff --git a/drivers/net/ethernet/mediatek/Makefile b/drivers/net/ethernet/mediatek/Makefile
-index 13c5b4e8f..0a6af99f1 100755
+old mode 100644
+new mode 100755
+index 634640d..5f342f4
--- a/drivers/net/ethernet/mediatek/Makefile
+++ b/drivers/net/ethernet/mediatek/Makefile
@@ -4,5 +4,6 @@
@@ -71,20 +76,22 @@
+ mtk_ppe.o mtk_ppe_debugfs.o mtk_ppe_offload.o
obj-$(CONFIG_NET_MEDIATEK_HNAT) += mtk_hnat/
diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-index 2b21f7ed0..819d8a0be 100755
+old mode 100644
+new mode 100755
+index c4bea4d..9c85e16
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -3081,6 +3081,7 @@ static int mtk_open(struct net_device *d
- struct mtk_phylink_priv *phylink_priv = &mac->phylink_priv;
+@@ -3573,6 +3573,7 @@ static int mtk_open(struct net_device *dev)
+ u32 id = mtk_mac2xgmii_id(eth, mac->id);
int err, i;
struct device_node *phy_node;
+ u32 gdm_config = MTK_GDMA_TO_PDMA;
err = phylink_of_phy_connect(mac->phylink, mac->of_node, 0);
if (err) {
-@@ -3157,7 +3158,10 @@ static int mtk_open(struct net_device *d
- if (!phy_node && eth->xgmii->regmap_sgmii[mac->id])
- regmap_write(eth->xgmii->regmap_sgmii[mac->id], SGMSYS_QPHY_PWR_STATE_CTRL, 0);
+@@ -3650,7 +3651,10 @@ static int mtk_open(struct net_device *dev)
+ regmap_write(eth->sgmii->pcs[id].regmap,
+ SGMSYS_QPHY_PWR_STATE_CTRL, 0);
- mtk_gdm_config(eth, mac->id, MTK_GDMA_TO_PDMA);
+ if (eth->soc->offload_version && mtk_ppe_start(ð->ppe) == 0)
@@ -94,7 +101,7 @@
return 0;
}
-@@ -3238,6 +3242,9 @@ static int mtk_stop(struct net_device *d
+@@ -3730,6 +3734,9 @@ static int mtk_stop(struct net_device *dev)
mtk_dma_free(eth);
@@ -104,15 +111,15 @@
return 0;
}
-@@ -3915,6 +3922,7 @@ static const struct net_device_ops mtk_n
+@@ -4576,6 +4583,7 @@ static const struct net_device_ops mtk_netdev_ops = {
#ifdef CONFIG_NET_POLL_CONTROLLER
.ndo_poll_controller = mtk_poll_controller,
#endif
+ .ndo_setup_tc = mtk_eth_setup_tc,
};
- static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np)
-@@ -4308,6 +4316,17 @@ static int mtk_probe(struct platform_dev
+ static void mux_poll(struct work_struct *work)
+@@ -5161,6 +5169,17 @@ static int mtk_probe(struct platform_device *pdev)
goto err_free_dev;
}
@@ -130,40 +137,42 @@
for (i = 0; i < MTK_MAX_DEVS; i++) {
if (!eth->netdev[i])
continue;
-@@ -4410,6 +4429,7 @@ static const struct mtk_soc_data mt2701_
+@@ -5254,6 +5273,7 @@ static const struct mtk_soc_data mt2701_data = {
.required_clks = MT7623_CLKS_BITMAP,
.required_pctl = true,
.has_sram = false,
+ .offload_version = 2,
- .rss_num = 0,
+ .rss_num = 0,
.txrx = {
.txd_size = sizeof(struct mtk_tx_dma),
-@@ -4424,6 +4444,7 @@ static const struct mtk_soc_data mt7621_
+@@ -5271,6 +5291,7 @@ static const struct mtk_soc_data mt7621_data = {
.required_clks = MT7621_CLKS_BITMAP,
.required_pctl = false,
.has_sram = false,
+ .offload_version = 2,
- .rss_num = 0,
+ .rss_num = 0,
.txrx = {
.txd_size = sizeof(struct mtk_tx_dma),
-@@ -4439,6 +4460,7 @@ static const struct mtk_soc_data mt7622_
+@@ -5289,6 +5310,7 @@ static const struct mtk_soc_data mt7622_data = {
.required_clks = MT7622_CLKS_BITMAP,
.required_pctl = false,
.has_sram = false,
+ .offload_version = 2,
- .rss_num = 0,
+ .rss_num = 0,
.txrx = {
.txd_size = sizeof(struct mtk_tx_dma),
-@@ -4453,6 +4475,7 @@ static const struct mtk_soc_data mt7623_
+@@ -5306,6 +5328,7 @@ static const struct mtk_soc_data mt7623_data = {
.required_clks = MT7623_CLKS_BITMAP,
.required_pctl = true,
.has_sram = false,
+ .offload_version = 2,
- .rss_num = 0,
+ .rss_num = 0,
.txrx = {
.txd_size = sizeof(struct mtk_tx_dma),
diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.h b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
-index b6380ffeb..349f98503 100755
+old mode 100644
+new mode 100755
+index 8a9b615..a87e46d
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
@@ -15,6 +15,8 @@
@@ -175,7 +184,7 @@
#define MTK_QDMA_PAGE_SIZE 2048
#define MTK_MAX_RX_LENGTH 1536
-@@ -37,7 +39,8 @@
+@@ -44,7 +46,8 @@
NETIF_F_HW_VLAN_CTAG_TX | \
NETIF_F_SG | NETIF_F_TSO | \
NETIF_F_TSO6 | \
@@ -185,15 +194,15 @@
#define MTK_SET_FEATURES (NETIF_F_LRO | \
NETIF_F_HW_VLAN_CTAG_RX)
#define MTK_HW_FEATURES_MT7628 (NETIF_F_SG | NETIF_F_RXCSUM)
-@@ -107,6 +110,7 @@
- #define MTK_GDMA_TCS_EN BIT(21)
+@@ -127,6 +130,7 @@
#define MTK_GDMA_UCS_EN BIT(20)
+ #define MTK_GDMA_STRP_CRC BIT(16)
#define MTK_GDMA_TO_PDMA 0x0
+#define MTK_GDMA_TO_PPE 0x4444
#define MTK_GDMA_DROP_ALL 0x7777
- /* Unicast Filter MAC Address Register - Low */
-@@ -547,6 +551,12 @@
+ /* GDM Egress Control Register */
+@@ -617,6 +621,12 @@
#define RX_DMA_TCI(_x) ((_x) & (VLAN_PRIO_MASK | VLAN_VID_MASK))
#define RX_DMA_VPID(_x) (((_x) >> 16) & 0xffff)
@@ -206,15 +215,15 @@
/* QDMA descriptor rxd4 */
#define RX_DMA_L4_VALID BIT(24)
#define RX_DMA_L4_VALID_PDMA BIT(30) /* when PDMA is used */
-@@ -1158,6 +1168,7 @@ struct mtk_soc_data {
- u32 caps;
- u32 required_clks;
+@@ -1651,6 +1661,7 @@ struct mtk_soc_data {
+ u64 caps;
+ u64 required_clks;
bool required_pctl;
+ u8 offload_version;
netdev_features_t hw_features;
bool has_sram;
- };
-@@ -1271,6 +1282,9 @@ struct mtk_eth {
+ struct {
+@@ -1847,6 +1858,9 @@ struct mtk_eth {
int ip_align;
spinlock_t syscfg0_lock;
struct timer_list mtk_dma_monitor_timer;
@@ -224,17 +233,19 @@
};
/* struct mtk_mac - the structure that holds the info about the MACs of the
-@@ -1319,4 +1333,7 @@ int mtk_gmac_rgmii_path_setup(struct mtk_eth *eth, int mac_id);
- void mtk_usxgmii_reset(struct mtk_xgmii *ss, int mac_id);
+@@ -1927,6 +1941,9 @@ int mtk_toprgu_init(struct mtk_eth *eth, struct device_node *r);
int mtk_dump_usxgmii(struct regmap *pmap, char *name, u32 offset, u32 range);
+ void mtk_usxgmii_link_poll(struct work_struct *work);
+int mtk_eth_offload_init(struct mtk_eth *eth);
+int mtk_eth_setup_tc(struct net_device *dev, enum tc_setup_type type,
+ void *type_data);
void mtk_eth_set_dma_device(struct mtk_eth *eth, struct device *dma_dev);
+ u32 mtk_rss_indr_table(struct mtk_rss_params *rss_params, int index);
+ #endif /* MTK_ETH_H */
diff --git a/drivers/net/ethernet/mediatek/mtk_ppe.c b/drivers/net/ethernet/mediatek/mtk_ppe.c
new file mode 100644
-index 000000000..66298e223
+index 0000000..27b5be5
--- /dev/null
+++ b/drivers/net/ethernet/mediatek/mtk_ppe.c
@@ -0,0 +1,510 @@
@@ -750,7 +761,7 @@
+}
diff --git a/drivers/net/ethernet/mediatek/mtk_ppe.h b/drivers/net/ethernet/mediatek/mtk_ppe.h
new file mode 100644
-index 000000000..242fb8f2a
+index 0000000..242fb8f
--- /dev/null
+++ b/drivers/net/ethernet/mediatek/mtk_ppe.h
@@ -0,0 +1,288 @@
@@ -1044,7 +1055,7 @@
+#endif
diff --git a/drivers/net/ethernet/mediatek/mtk_ppe_debugfs.c b/drivers/net/ethernet/mediatek/mtk_ppe_debugfs.c
new file mode 100644
-index 000000000..d4b482340
+index 0000000..d4b4823
--- /dev/null
+++ b/drivers/net/ethernet/mediatek/mtk_ppe_debugfs.c
@@ -0,0 +1,214 @@
@@ -1264,7 +1275,7 @@
+}
diff --git a/drivers/net/ethernet/mediatek/mtk_ppe_offload.c b/drivers/net/ethernet/mediatek/mtk_ppe_offload.c
new file mode 100644
-index 000000000..4294f0c74
+index 0000000..1380ef0
--- /dev/null
+++ b/drivers/net/ethernet/mediatek/mtk_ppe_offload.c
@@ -0,0 +1,535 @@
@@ -1805,7 +1816,7 @@
+}
diff --git a/drivers/net/ethernet/mediatek/mtk_ppe_regs.h b/drivers/net/ethernet/mediatek/mtk_ppe_regs.h
new file mode 100644
-index 000000000..0c45ea090
+index 0000000..0c45ea0
--- /dev/null
+++ b/drivers/net/ethernet/mediatek/mtk_ppe_regs.h
@@ -0,0 +1,144 @@
@@ -1954,7 +1965,7 @@
+
+#endif
diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c
-index a085213dc..813e30495 100644
+index 078c0f4..f8a98d8 100644
--- a/drivers/net/ppp/ppp_generic.c
+++ b/drivers/net/ppp/ppp_generic.c
@@ -1378,12 +1378,34 @@ static void ppp_dev_priv_destructor(struct net_device *dev)
@@ -1993,7 +2004,7 @@
static struct device_type ppp_type = {
diff --git a/drivers/net/ppp/pppoe.c b/drivers/net/ppp/pppoe.c
-index 087b01684..7a8c246ab 100644
+index 087b016..7a8c246 100644
--- a/drivers/net/ppp/pppoe.c
+++ b/drivers/net/ppp/pppoe.c
@@ -974,8 +974,32 @@ static int pppoe_xmit(struct ppp_channel *chan, struct sk_buff *skb)
@@ -2030,10 +2041,10 @@
static int pppoe_recvmsg(struct socket *sock, struct msghdr *m,
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
-index 38af42bf8..9f64504ac 100644
+index 631d158..ef44d9a 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
-@@ -829,6 +829,59 @@ typedef u16 (*select_queue_fallback_t)(struct net_device *dev,
+@@ -838,6 +838,59 @@ typedef u16 (*select_queue_fallback_t)(struct net_device *dev,
struct sk_buff *skb,
struct net_device *sb_dev);
@@ -2093,7 +2104,7 @@
enum tc_setup_type {
TC_SETUP_QDISC_MQPRIO,
TC_SETUP_CLSU32,
-@@ -844,6 +897,7 @@ enum tc_setup_type {
+@@ -853,6 +906,7 @@ enum tc_setup_type {
TC_SETUP_ROOT_QDISC,
TC_SETUP_QDISC_GRED,
TC_SETUP_QDISC_TAPRIO,
@@ -2101,7 +2112,7 @@
};
/* These structures hold the attributes of bpf state that are being passed
-@@ -1239,6 +1293,8 @@ struct tlsdev_ops;
+@@ -1248,6 +1302,8 @@ struct tlsdev_ops;
* Get devlink port instance associated with a given netdev.
* Called with a reference on the netdevice and devlink locks only,
* rtnl_lock is not held.
@@ -2110,7 +2121,7 @@
*/
struct net_device_ops {
int (*ndo_init)(struct net_device *dev);
-@@ -1436,6 +1492,8 @@ struct net_device_ops {
+@@ -1445,6 +1501,8 @@ struct net_device_ops {
int (*ndo_xsk_wakeup)(struct net_device *dev,
u32 queue_id, u32 flags);
struct devlink_port * (*ndo_get_devlink_port)(struct net_device *dev);
@@ -2119,7 +2130,7 @@
};
/**
-@@ -2661,6 +2719,8 @@ void dev_remove_offload(struct packet_offload *po);
+@@ -2670,6 +2728,8 @@ void dev_remove_offload(struct packet_offload *po);
int dev_get_iflink(const struct net_device *dev);
int dev_fill_metadata_dst(struct net_device *dev, struct sk_buff *skb);
@@ -2129,7 +2140,7 @@
unsigned short mask);
struct net_device *dev_get_by_name(struct net *net, const char *name);
diff --git a/include/linux/ppp_channel.h b/include/linux/ppp_channel.h
-index 98966064e..91f9a9283 100644
+index 9896606..91f9a92 100644
--- a/include/linux/ppp_channel.h
+++ b/include/linux/ppp_channel.h
@@ -28,6 +28,9 @@ struct ppp_channel_ops {
@@ -2143,10 +2154,10 @@
struct ppp_channel {
diff --git a/include/net/dsa.h b/include/net/dsa.h
-index 05f66d487..cafc74218 100644
+index d29ee9e..43f65cb 100644
--- a/include/net/dsa.h
+++ b/include/net/dsa.h
-@@ -561,6 +561,8 @@ struct dsa_switch_ops {
+@@ -562,6 +562,8 @@ struct dsa_switch_ops {
struct sk_buff *skb);
};
@@ -2155,7 +2166,7 @@
struct dsa_switch_driver {
struct list_head list;
const struct dsa_switch_ops *ops;
-@@ -653,6 +655,14 @@ static inline int call_dsa_notifiers(unsigned long val, struct net_device *dev,
+@@ -654,6 +656,14 @@ static inline int call_dsa_notifiers(unsigned long val, struct net_device *dev,
#define BRCM_TAG_GET_PORT(v) ((v) >> 8)
#define BRCM_TAG_GET_QUEUE(v) ((v) & 0xff)
@@ -2171,7 +2182,7 @@
netdev_tx_t dsa_enqueue_skb(struct sk_buff *skb, struct net_device *dev);
int dsa_port_get_phy_strings(struct dsa_port *dp, uint8_t *data);
diff --git a/include/net/flow_offload.h b/include/net/flow_offload.h
-index c6f7bd22d..59b873653 100644
+index c6f7bd2..59b8736 100644
--- a/include/net/flow_offload.h
+++ b/include/net/flow_offload.h
@@ -138,6 +138,7 @@ enum flow_action_id {
@@ -2193,7 +2204,7 @@
};
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h
-index 2c739fc75..89ab8f180 100644
+index 2c739fc..89ab8f1 100644
--- a/include/net/ip6_route.h
+++ b/include/net/ip6_route.h
@@ -314,12 +314,13 @@ static inline bool rt6_duplicate_nexthop(struct fib6_info *a, struct fib6_info *
@@ -2213,7 +2224,7 @@
if (mtu)
goto out;
diff --git a/include/net/netfilter/ipv6/nf_conntrack_ipv6.h b/include/net/netfilter/ipv6/nf_conntrack_ipv6.h
-index 7b3c873f8..e95483192 100644
+index 7b3c873..e954831 100644
--- a/include/net/netfilter/ipv6/nf_conntrack_ipv6.h
+++ b/include/net/netfilter/ipv6/nf_conntrack_ipv6.h
@@ -4,7 +4,4 @@
@@ -2225,7 +2236,7 @@
-
#endif /* _NF_CONNTRACK_IPV6_H*/
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h
-index 90690e37a..ce0bc3e62 100644
+index 90690e3..ce0bc3e 100644
--- a/include/net/netfilter/nf_conntrack.h
+++ b/include/net/netfilter/nf_conntrack.h
@@ -279,6 +279,18 @@ static inline bool nf_ct_should_gc(const struct nf_conn *ct)
@@ -2248,7 +2259,7 @@
int nf_conntrack_set_hashsize(const char *val, const struct kernel_param *kp);
diff --git a/include/net/netfilter/nf_conntrack_acct.h b/include/net/netfilter/nf_conntrack_acct.h
-index f7a060c6e..7f44a7715 100644
+index f7a060c..7f44a77 100644
--- a/include/net/netfilter/nf_conntrack_acct.h
+++ b/include/net/netfilter/nf_conntrack_acct.h
@@ -65,6 +65,17 @@ static inline void nf_ct_set_acct(struct net *net, bool enable)
@@ -2270,7 +2281,7 @@
int nf_conntrack_acct_init(void);
diff --git a/include/net/netfilter/nf_flow_table.h b/include/net/netfilter/nf_flow_table.h
-index 68d7fc92..7cf89767 100644
+index 68d7fc9..feac793 100644
--- a/include/net/netfilter/nf_flow_table.h
+++ b/include/net/netfilter/nf_flow_table.h
@@ -8,31 +8,99 @@
@@ -2573,7 +2584,7 @@
struct flow_ports {
__be16 source, dest;
-@@ -126,4 +298,41 @@ unsigned int nf_flow_offload_ipv6_hook(void *priv, struct sk_buff *skb,
+@@ -126,4 +299,41 @@ unsigned int nf_flow_offload_ipv6_hook(void *priv, struct sk_buff *skb,
#define MODULE_ALIAS_NF_FLOWTABLE(family) \
MODULE_ALIAS("nf-flowtable-" __stringify(family))
@@ -2616,7 +2627,7 @@
+
#endif /* _NF_FLOW_TABLE_H */
diff --git a/include/net/netns/conntrack.h b/include/net/netns/conntrack.h
-index 806454e76..9e3963c8f 100644
+index 806454e..9e3963c 100644
--- a/include/net/netns/conntrack.h
+++ b/include/net/netns/conntrack.h
@@ -27,6 +27,9 @@ struct nf_tcp_net {
@@ -2640,7 +2651,7 @@
struct nf_icmp_net {
diff --git a/include/uapi/linux/netfilter/nf_conntrack_common.h b/include/uapi/linux/netfilter/nf_conntrack_common.h
-index 336014bf8..ae698d11c 100644
+index 336014b..ae698d1 100644
--- a/include/uapi/linux/netfilter/nf_conntrack_common.h
+++ b/include/uapi/linux/netfilter/nf_conntrack_common.h
@@ -105,14 +105,19 @@ enum ip_conntrack_status {
@@ -2667,7 +2678,7 @@
/* Connection tracking event types */
diff --git a/include/uapi/linux/netfilter/xt_FLOWOFFLOAD.h b/include/uapi/linux/netfilter/xt_FLOWOFFLOAD.h
new file mode 100644
-index 000000000..5841bbe0e
+index 0000000..5841bbe
--- /dev/null
+++ b/include/uapi/linux/netfilter/xt_FLOWOFFLOAD.h
@@ -0,0 +1,17 @@
@@ -2689,7 +2700,7 @@
+
+#endif /* _XT_FLOWOFFLOAD_H */
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
-index 589615ec4..444ab5fae 100644
+index 0a3a167..6112266 100644
--- a/net/8021q/vlan_dev.c
+++ b/net/8021q/vlan_dev.c
@@ -747,6 +747,26 @@ static int vlan_dev_get_iflink(const struct net_device *dev)
@@ -2728,7 +2739,7 @@
static void vlan_dev_free(struct net_device *dev)
diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c
-index 501f77f0f..0940b44cd 100644
+index 501f77f..0940b44 100644
--- a/net/bridge/br_device.c
+++ b/net/bridge/br_device.c
@@ -377,6 +377,54 @@ static int br_del_slave(struct net_device *dev, struct net_device *slave_dev)
@@ -2795,7 +2806,7 @@
static struct device_type br_type = {
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
-index a736be8a1..4bd9e9b57 100644
+index a736be8..4bd9e9b 100644
--- a/net/bridge/br_private.h
+++ b/net/bridge/br_private.h
@@ -912,6 +912,13 @@ void br_vlan_port_event(struct net_bridge_port *p, unsigned long event);
@@ -2833,7 +2844,7 @@
const struct net_bridge *br)
{
diff --git a/net/bridge/br_vlan.c b/net/bridge/br_vlan.c
-index 9257292bd..bcfd16924 100644
+index 9257292..bcfd169 100644
--- a/net/bridge/br_vlan.c
+++ b/net/bridge/br_vlan.c
@@ -1268,6 +1268,61 @@ int br_vlan_get_pvid_rcu(const struct net_device *dev, u16 *p_pvid)
@@ -2899,7 +2910,7 @@
struct bridge_vlan_info *p_vinfo)
{
diff --git a/net/core/dev.c b/net/core/dev.c
-index fe2c856b9..4f0edb218 100644
+index 54cc544..a117bd0 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -639,6 +639,52 @@ int dev_fill_metadata_dst(struct net_device *dev, struct sk_buff *skb)
@@ -2956,7 +2967,7 @@
* __dev_get_by_name - find a device by its name
* @net: the applicable net namespace
diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c
-index ca80f8699..35a1249a9 100644
+index ca80f86..35a1249 100644
--- a/net/dsa/dsa.c
+++ b/net/dsa/dsa.c
@@ -329,6 +329,15 @@ int call_dsa_notifiers(unsigned long val, struct net_device *dev,
@@ -2976,10 +2987,10 @@
{
int rc;
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
-index 036fda317..2dfaa1eac 100644
+index e2b91b3..2dfaa1e 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
-@@ -1033,14 +1031,32 @@ static int dsa_slave_setup_tc_block(struct net_device *dev,
+@@ -1031,14 +1031,32 @@ static int dsa_slave_setup_tc_block(struct net_device *dev,
}
}
@@ -3013,7 +3024,7 @@
if (!ds->ops->port_setup_tc)
return -EOPNOTSUPP;
-@@ -1226,6 +1242,21 @@ static struct devlink_port *dsa_slave_get_devlink_port(struct net_device *dev)
+@@ -1224,6 +1242,21 @@ static struct devlink_port *dsa_slave_get_devlink_port(struct net_device *dev)
return dp->ds->devlink ? &dp->devlink_port : NULL;
}
@@ -3035,7 +3046,7 @@
static const struct net_device_ops dsa_slave_netdev_ops = {
.ndo_open = dsa_slave_open,
.ndo_stop = dsa_slave_close,
-@@ -1250,6 +1281,7 @@ static const struct net_device_ops dsa_slave_netdev_ops = {
+@@ -1248,6 +1281,7 @@ static const struct net_device_ops dsa_slave_netdev_ops = {
.ndo_vlan_rx_add_vid = dsa_slave_vlan_rx_add_vid,
.ndo_vlan_rx_kill_vid = dsa_slave_vlan_rx_kill_vid,
.ndo_get_devlink_port = dsa_slave_get_devlink_port,
@@ -3043,8 +3054,7 @@
};
static struct device_type dsa_type = {
-@@ -1497,7 +1529,8 @@ void dsa_slave_destroy(struct net_device *slave_dev)
- bool dsa_slave_dev_check(const struct net_device *dev)
+@@ -1499,6 +1533,7 @@ bool dsa_slave_dev_check(const struct net_device *dev)
{
return dev->netdev_ops == &dsa_slave_netdev_ops;
}
@@ -3053,7 +3063,7 @@
static int dsa_slave_changeupper(struct net_device *dev,
struct netdev_notifier_changeupper_info *info)
diff --git a/net/ipv4/netfilter/Kconfig b/net/ipv4/netfilter/Kconfig
-index f17b40211..803b92e4c 100644
+index f17b402..803b92e 100644
--- a/net/ipv4/netfilter/Kconfig
+++ b/net/ipv4/netfilter/Kconfig
@@ -56,8 +56,6 @@ config NF_TABLES_ARP
@@ -3075,7 +3085,7 @@
tristate "Netfilter IPv4 packet duplication to alternate destination"
depends on !NF_CONNTRACK || NF_CONNTRACK
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
-index 5585e3a94..bb76f6061 100644
+index 8231a7a..7176d7f 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -607,7 +607,7 @@ int ip6_forward(struct sk_buff *skb)
@@ -3088,7 +3098,7 @@
mtu = IPV6_MIN_MTU;
diff --git a/net/ipv6/netfilter/Kconfig b/net/ipv6/netfilter/Kconfig
-index 69443e9a3..0b481d236 100644
+index 69443e9..0b481d2 100644
--- a/net/ipv6/netfilter/Kconfig
+++ b/net/ipv6/netfilter/Kconfig
@@ -45,7 +45,6 @@ config NFT_FIB_IPV6
@@ -3109,7 +3119,7 @@
tristate "Netfilter IPv6 packet duplication to alternate destination"
depends on !NF_CONNTRACK || NF_CONNTRACK
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
-index 98aaf0b79..2b357ac71 100644
+index 43d185c..82a752c 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -83,7 +83,7 @@ enum rt6_nud_state {
@@ -3149,10 +3159,10 @@
/* MTU selection:
diff --git a/net/netfilter/Kconfig b/net/netfilter/Kconfig
-index b967763f5..c040e713a 100644
+index b6e0a62..5d690ab 100644
--- a/net/netfilter/Kconfig
+++ b/net/netfilter/Kconfig
-@@ -690,8 +690,6 @@ config NFT_FIB_NETDEV
+@@ -689,8 +689,6 @@ config NFT_FIB_NETDEV
endif # NF_TABLES_NETDEV
@@ -3161,7 +3171,7 @@
config NF_FLOW_TABLE_INET
tristate "Netfilter flow table mixed IPv4/IPv6 module"
depends on NF_FLOW_TABLE
-@@ -700,11 +698,12 @@ config NF_FLOW_TABLE_INET
+@@ -699,11 +697,12 @@ config NF_FLOW_TABLE_INET
To compile it as a module, choose M here.
@@ -3175,7 +3185,7 @@
help
This option adds the flow table core infrastructure.
-@@ -984,6 +983,15 @@ config NETFILTER_XT_TARGET_NOTRACK
+@@ -983,6 +982,15 @@ config NETFILTER_XT_TARGET_NOTRACK
depends on NETFILTER_ADVANCED
select NETFILTER_XT_TARGET_CT
@@ -3192,7 +3202,7 @@
tristate '"RATEEST" target support'
depends on NETFILTER_ADVANCED
diff --git a/net/netfilter/Makefile b/net/netfilter/Makefile
-index 4fc075b61..d93a121bc 100644
+index 4fc075b..d93a121 100644
--- a/net/netfilter/Makefile
+++ b/net/netfilter/Makefile
@@ -120,7 +120,8 @@ obj-$(CONFIG_NFT_FWD_NETDEV) += nft_fwd_netdev.o
@@ -3214,10 +3224,10 @@
obj-$(CONFIG_NETFILTER_XT_TARGET_HMARK) += xt_HMARK.o
obj-$(CONFIG_NETFILTER_XT_TARGET_LED) += xt_LED.o
diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c
-index f6ab6f484..f689e19d8 100644
+index f6ab6f4..f689e19 100644
--- a/net/netfilter/nf_conntrack_core.c
+++ b/net/netfilter/nf_conntrack_core.c
-@@ -864,9 +864,8 @@ out:
+@@ -864,9 +864,8 @@ nf_conntrack_hash_check_insert(struct nf_conn *ct)
}
EXPORT_SYMBOL_GPL(nf_conntrack_hash_check_insert);
@@ -3283,10 +3293,10 @@
return nf_ct_delete(ct, 0, 0);
}
diff --git a/net/netfilter/nf_conntrack_proto_tcp.c b/net/netfilter/nf_conntrack_proto_tcp.c
-index 7204f0366..3742bae21 100644
+index e219b6f..5cdc627 100644
--- a/net/netfilter/nf_conntrack_proto_tcp.c
+++ b/net/netfilter/nf_conntrack_proto_tcp.c
-@@ -1453,6 +1453,10 @@ void nf_conntrack_tcp_init_net(struct net *net)
+@@ -1463,6 +1463,10 @@ void nf_conntrack_tcp_init_net(struct net *net)
tn->tcp_loose = nf_ct_tcp_loose;
tn->tcp_be_liberal = nf_ct_tcp_be_liberal;
tn->tcp_max_retrans = nf_ct_tcp_max_retrans;
@@ -3298,7 +3308,7 @@
const struct nf_conntrack_l4proto nf_conntrack_l4proto_tcp =
diff --git a/net/netfilter/nf_conntrack_proto_udp.c b/net/netfilter/nf_conntrack_proto_udp.c
-index e3a2d018f..a1579d6c3 100644
+index e3a2d01..a1579d6 100644
--- a/net/netfilter/nf_conntrack_proto_udp.c
+++ b/net/netfilter/nf_conntrack_proto_udp.c
@@ -267,6 +267,10 @@ void nf_conntrack_udp_init_net(struct net *net)
@@ -3313,7 +3323,7 @@
const struct nf_conntrack_l4proto nf_conntrack_l4proto_udp =
diff --git a/net/netfilter/nf_conntrack_standalone.c b/net/netfilter/nf_conntrack_standalone.c
-index 9c6259c28..10d9f93ce 100644
+index 0b600b4..a2cfafa 100644
--- a/net/netfilter/nf_conntrack_standalone.c
+++ b/net/netfilter/nf_conntrack_standalone.c
@@ -353,7 +353,9 @@ static int ct_seq_show(struct seq_file *s, void *v)
@@ -3345,7 +3355,7 @@
NF_SYSCTL_CT_PROTO_TIMEOUT_ICMP,
NF_SYSCTL_CT_PROTO_TIMEOUT_ICMPV6,
#ifdef CONFIG_NF_CT_PROTO_SCTP
-@@ -812,6 +820,14 @@ static struct ctl_table nf_ct_sysctl_table[] = {
+@@ -811,6 +819,14 @@ static struct ctl_table nf_ct_sysctl_table[] = {
.mode = 0644,
.proc_handler = proc_dointvec_jiffies,
},
@@ -3360,7 +3370,7 @@
[NF_SYSCTL_CT_PROTO_TCP_LOOSE] = {
.procname = "nf_conntrack_tcp_loose",
.maxlen = sizeof(int),
-@@ -846,6 +862,14 @@ static struct ctl_table nf_ct_sysctl_table[] = {
+@@ -845,6 +861,14 @@ static struct ctl_table nf_ct_sysctl_table[] = {
.mode = 0644,
.proc_handler = proc_dointvec_jiffies,
},
@@ -3375,7 +3385,7 @@
[NF_SYSCTL_CT_PROTO_TIMEOUT_ICMP] = {
.procname = "nf_conntrack_icmp_timeout",
.maxlen = sizeof(unsigned int),
-@@ -1028,6 +1052,11 @@ static void nf_conntrack_standalone_init_tcp_sysctl(struct net *net,
+@@ -1021,6 +1045,11 @@ static void nf_conntrack_standalone_init_tcp_sysctl(struct net *net,
XASSIGN(LIBERAL, &tn->tcp_be_liberal);
XASSIGN(MAX_RETRANS, &tn->tcp_max_retrans);
#undef XASSIGN
@@ -3387,7 +3397,7 @@
}
static void nf_conntrack_standalone_init_sctp_sysctl(struct net *net,
-@@ -1115,6 +1144,9 @@ static int nf_conntrack_standalone_init_sysctl(struct net *net)
+@@ -1107,6 +1136,9 @@ static int nf_conntrack_standalone_init_sysctl(struct net *net)
table[NF_SYSCTL_CT_PROTO_TIMEOUT_ICMPV6].data = &nf_icmpv6_pernet(net)->timeout;
table[NF_SYSCTL_CT_PROTO_TIMEOUT_UDP].data = &un->timeouts[UDP_CT_UNREPLIED];
table[NF_SYSCTL_CT_PROTO_TIMEOUT_UDP_STREAM].data = &un->timeouts[UDP_CT_REPLIED];
@@ -3398,7 +3408,7 @@
nf_conntrack_standalone_init_tcp_sysctl(net, table);
nf_conntrack_standalone_init_sctp_sysctl(net, table);
diff --git a/net/netfilter/nf_flow_table_core.c b/net/netfilter/nf_flow_table_core.c
-index f212cec0..10365581 100644
+index f212cec..c3054af 100644
--- a/net/netfilter/nf_flow_table_core.c
+++ b/net/netfilter/nf_flow_table_core.c
@@ -7,43 +7,21 @@
@@ -3963,7 +3973,7 @@
}
static void nf_flow_offload_work_gc(struct work_struct *work)
-@@ -387,30 +484,20 @@ static void nf_flow_offload_work_gc(struct work_struct *work)
+@@ -387,30 +487,20 @@ static void nf_flow_offload_work_gc(struct work_struct *work)
queue_delayed_work(system_power_efficient_wq, &flow_table->gc_work, HZ);
}
@@ -3998,7 +4008,7 @@
udph = (void *)(skb_network_header(skb) + thoff);
if (udph->check || skb->ip_summed == CHECKSUM_PARTIAL) {
inet_proto_csum_replace2(&udph->check, skb, port,
-@@ -418,38 +505,28 @@ static int nf_flow_nat_port_udp(struct sk_buff *skb, unsigned int thoff,
+@@ -418,38 +508,28 @@ static int nf_flow_nat_port_udp(struct sk_buff *skb, unsigned int thoff,
if (!udph->check)
udph->check = CSUM_MANGLED_0;
}
@@ -4044,7 +4054,7 @@
hdr = (void *)(skb_network_header(skb) + thoff);
switch (dir) {
-@@ -463,25 +540,19 @@ int nf_flow_snat_port(const struct flow_offload *flow,
+@@ -463,25 +543,19 @@ int nf_flow_snat_port(const struct flow_offload *flow,
new_port = flow->tuplehash[FLOW_OFFLOAD_DIR_ORIGINAL].tuple.src_port;
hdr->dest = new_port;
break;
@@ -4074,7 +4084,7 @@
hdr = (void *)(skb_network_header(skb) + thoff);
switch (dir) {
-@@ -495,11 +566,9 @@ int nf_flow_dnat_port(const struct flow_offload *flow,
+@@ -495,11 +569,9 @@ int nf_flow_dnat_port(const struct flow_offload *flow,
new_port = flow->tuplehash[FLOW_OFFLOAD_DIR_ORIGINAL].tuple.dst_port;
hdr->source = new_port;
break;
@@ -4087,7 +4097,7 @@
}
EXPORT_SYMBOL_GPL(nf_flow_dnat_port);
-@@ -507,7 +576,9 @@ int nf_flow_table_init(struct nf_flowtable *flowtable)
+@@ -507,7 +579,9 @@ int nf_flow_table_init(struct nf_flowtable *flowtable)
{
int err;
@@ -4098,7 +4108,7 @@
err = rhashtable_init(&flowtable->rhashtable,
&nf_flow_offload_rhash_params);
-@@ -528,25 +599,24 @@ EXPORT_SYMBOL_GPL(nf_flow_table_init);
+@@ -528,25 +602,24 @@ EXPORT_SYMBOL_GPL(nf_flow_table_init);
static void nf_flow_table_do_cleanup(struct flow_offload *flow, void *data)
{
struct net_device *dev = data;
@@ -4130,7 +4140,7 @@
}
void nf_flow_table_cleanup(struct net_device *dev)
-@@ -555,7 +625,7 @@ void nf_flow_table_cleanup(struct net_device *dev)
+@@ -555,7 +628,7 @@ void nf_flow_table_cleanup(struct net_device *dev)
mutex_lock(&flowtable_lock);
list_for_each_entry(flowtable, &flowtables, list)
@@ -4139,7 +4149,7 @@
mutex_unlock(&flowtable_lock);
}
EXPORT_SYMBOL_GPL(nf_flow_table_cleanup);
-@@ -565,9 +635,14 @@ void nf_flow_table_free(struct nf_flowtable *flow_table)
+@@ -565,9 +638,14 @@ void nf_flow_table_free(struct nf_flowtable *flow_table)
mutex_lock(&flowtable_lock);
list_del(&flow_table->list);
mutex_unlock(&flowtable_lock);
@@ -4154,7 +4164,7 @@
rhashtable_destroy(&flow_table->rhashtable);
}
EXPORT_SYMBOL_GPL(nf_flow_table_free);
-@@ -591,12 +666,23 @@ static struct notifier_block flow_offload_netdev_notifier = {
+@@ -591,12 +669,23 @@ static struct notifier_block flow_offload_netdev_notifier = {
static int __init nf_flow_table_module_init(void)
{
@@ -4179,13 +4189,13 @@
}
module_init(nf_flow_table_module_init);
-@@ -604,3 +690,4 @@ module_exit(nf_flow_table_module_exit);
+@@ -604,3 +693,4 @@ module_exit(nf_flow_table_module_exit);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Pablo Neira Ayuso <pablo@netfilter.org>");
+MODULE_DESCRIPTION("Netfilter flow table module");
diff --git a/net/netfilter/nf_flow_table_ip.c b/net/netfilter/nf_flow_table_ip.c
-index 397129b2..6257d87c 100644
+index 397129b..6257d87 100644
--- a/net/netfilter/nf_flow_table_ip.c
+++ b/net/netfilter/nf_flow_table_ip.c
@@ -7,11 +7,13 @@
@@ -4914,7 +4924,7 @@
EXPORT_SYMBOL_GPL(nf_flow_offload_ipv6_hook);
diff --git a/net/netfilter/nf_flow_table_offload.c b/net/netfilter/nf_flow_table_offload.c
new file mode 100644
-index 000000000..d94c6fb92
+index 0000000..50f2f2e
--- /dev/null
+++ b/net/netfilter/nf_flow_table_offload.c
@@ -0,0 +1,1199 @@
@@ -6119,7 +6129,7 @@
+}
diff --git a/net/netfilter/xt_FLOWOFFLOAD.c b/net/netfilter/xt_FLOWOFFLOAD.c
new file mode 100644
-index 0000000..12f067c
+index 0000000..2cab008
--- /dev/null
+++ b/net/netfilter/xt_FLOWOFFLOAD.c
@@ -0,0 +1,794 @@
diff --git a/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3004-dts-mt7986-wed-changes.patch b/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3002-dts-mt7986-wed-changes.patch
old mode 100755
new mode 100644
similarity index 93%
rename from autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3004-dts-mt7986-wed-changes.patch
rename to autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3002-dts-mt7986-wed-changes.patch
index 3b965ac..97a66ba
--- a/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3004-dts-mt7986-wed-changes.patch
+++ b/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3002-dts-mt7986-wed-changes.patch
@@ -1,7 +1,7 @@
-From b83743c16da6fa4da206df3e5a1a9c29485bb613 Mon Sep 17 00:00:00 2001
+From be48305fd2e3ecd9a9853f2ae11fb9432e40b299 Mon Sep 17 00:00:00 2001
From: Bo Jiao <Bo.Jiao@mediatek.com>
-Date: Wed, 22 Jun 2022 16:36:42 +0800
-Subject: [PATCH 3/8] 9992-dts-mt7986-wed-changes
+Date: Mon, 18 Sep 2023 10:55:08 +0800
+Subject: [PATCH 03/22] dts mt7986 wed changes
---
arch/arm64/boot/dts/mediatek/mt7986a.dtsi | 33 ++++++++---------------
@@ -9,7 +9,7 @@
2 files changed, 22 insertions(+), 44 deletions(-)
diff --git a/arch/arm64/boot/dts/mediatek/mt7986a.dtsi b/arch/arm64/boot/dts/mediatek/mt7986a.dtsi
-index ba27b95f5..7f78de6b9 100644
+index e43c306..e5d4e12 100644
--- a/arch/arm64/boot/dts/mediatek/mt7986a.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt7986a.dtsi
@@ -58,32 +58,20 @@
@@ -55,7 +55,7 @@
};
ap2woccif: ap2woccif@151A5000 {
-@@ -490,6 +478,7 @@
+@@ -507,6 +495,7 @@
<&topckgen CK_TOP_CB_SGM_325M>;
mediatek,ethsys = <ðsys>;
mediatek,sgmiisys = <&sgmiisys0>, <&sgmiisys1>;
@@ -64,7 +64,7 @@
#address-cells = <1>;
#size-cells = <0>;
diff --git a/arch/arm64/boot/dts/mediatek/mt7986b.dtsi b/arch/arm64/boot/dts/mediatek/mt7986b.dtsi
-index 523d585cb..0e5f116a2 100644
+index 21d8357..2d2207f 100644
--- a/arch/arm64/boot/dts/mediatek/mt7986b.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt7986b.dtsi
@@ -58,32 +58,20 @@
@@ -110,7 +110,7 @@
};
ap2woccif: ap2woccif@151A5000 {
-@@ -405,6 +393,7 @@
+@@ -409,6 +397,7 @@
<&topckgen CK_TOP_CB_SGM_325M>;
mediatek,ethsys = <ðsys>;
mediatek,sgmiisys = <&sgmiisys0>, <&sgmiisys1>;
diff --git a/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3005-add-wed.patch b/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3003-add-wed.patch
old mode 100755
new mode 100644
similarity index 97%
rename from autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3005-add-wed.patch
rename to autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3003-add-wed.patch
index fe2dc53..ae4e9c1
--- a/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3005-add-wed.patch
+++ b/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3003-add-wed.patch
@@ -1,16 +1,15 @@
-From 342fdc50b761309e75974554cdcf790a2d09e134 Mon Sep 17 00:00:00 2001
+From cdb36beeb6725bcef3faad499c017c26bc17fd4a Mon Sep 17 00:00:00 2001
From: Sujuan Chen <sujuan.chen@mediatek.com>
-Date: Thu, 2 Jun 2022 15:32:07 +0800
-Subject: [PATCH 4/8] 9993-add-wed
+Date: Mon, 18 Sep 2023 10:56:21 +0800
+Subject: [PATCH 04/22] add wed
-Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
---
arch/arm64/boot/dts/mediatek/mt7622.dtsi | 32 +-
drivers/net/ethernet/mediatek/Kconfig | 4 +
drivers/net/ethernet/mediatek/Makefile | 5 +
- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 136 ++-
- drivers/net/ethernet/mediatek/mtk_eth_soc.h | 14 +-
- drivers/net/ethernet/mediatek/mtk_ppe.c | 373 +++++++-
+ drivers/net/ethernet/mediatek/mtk_eth_soc.c | 39 +-
+ drivers/net/ethernet/mediatek/mtk_eth_soc.h | 5 +-
+ drivers/net/ethernet/mediatek/mtk_ppe.c | 378 +++++++-
drivers/net/ethernet/mediatek/mtk_ppe.h | 89 +-
.../net/ethernet/mediatek/mtk_ppe_debugfs.c | 4 +-
.../net/ethernet/mediatek/mtk_ppe_offload.c | 167 +++-
@@ -22,7 +21,7 @@
include/linux/netdevice.h | 7 +
include/linux/soc/mediatek/mtk_wed.h | 131 +++
net/core/dev.c | 4 +
- 17 files changed, 2283 insertions(+), 128 deletions(-)
+ 17 files changed, 2207 insertions(+), 103 deletions(-)
mode change 100755 => 100644 drivers/net/ethernet/mediatek/Kconfig
mode change 100755 => 100644 drivers/net/ethernet/mediatek/Makefile
mode change 100755 => 100644 drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -36,7 +35,7 @@
create mode 100644 include/linux/soc/mediatek/mtk_wed.h
diff --git a/arch/arm64/boot/dts/mediatek/mt7622.dtsi b/arch/arm64/boot/dts/mediatek/mt7622.dtsi
-index 369e01389..d0fbc367e 100644
+index 753a97a..e46566a 100644
--- a/arch/arm64/boot/dts/mediatek/mt7622.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt7622.dtsi
@@ -338,7 +338,7 @@
@@ -48,7 +47,7 @@
interface-type = "ace";
reg = <0x5000 0x1000>;
};
-@@ -920,6 +920,11 @@
+@@ -921,6 +921,11 @@
};
};
@@ -60,7 +59,7 @@
ethsys: syscon@1b000000 {
compatible = "mediatek,mt7622-ethsys",
"syscon";
-@@ -938,6 +943,26 @@
+@@ -939,6 +944,26 @@
#dma-cells = <1>;
};
@@ -87,7 +86,7 @@
eth: ethernet@1b100000 {
compatible = "mediatek,mt7622-eth",
"mediatek,mt2701-eth",
-@@ -964,6 +989,11 @@
+@@ -965,6 +990,11 @@
power-domains = <&scpsys MT7622_POWER_DOMAIN_ETHSYS>;
mediatek,ethsys = <ðsys>;
mediatek,sgmiisys = <&sgmiisys>;
@@ -102,7 +101,7 @@
diff --git a/drivers/net/ethernet/mediatek/Kconfig b/drivers/net/ethernet/mediatek/Kconfig
old mode 100755
new mode 100644
-index 42e6b38d2..8ab6615a3
+index 7bfc78b..1574af9
--- a/drivers/net/ethernet/mediatek/Kconfig
+++ b/drivers/net/ethernet/mediatek/Kconfig
@@ -7,6 +7,10 @@ config NET_VENDOR_MEDIATEK
@@ -119,12 +118,12 @@
diff --git a/drivers/net/ethernet/mediatek/Makefile b/drivers/net/ethernet/mediatek/Makefile
old mode 100755
new mode 100644
-index 0a6af99f1..3528f1b3c
+index 5f342f4..4090132
--- a/drivers/net/ethernet/mediatek/Makefile
+++ b/drivers/net/ethernet/mediatek/Makefile
@@ -6,4 +6,9 @@
obj-$(CONFIG_NET_MEDIATEK_SOC) += mtk_eth.o
- mtk_eth-y := mtk_eth_soc.o mtk_sgmii.o mtk_eth_path.o mtk_eth_dbg.o mtk_eth_reset.o \
+ mtk_eth-y := mtk_eth_soc.o mtk_sgmii.o mtk_usxgmii.o mtk_eth_path.o mtk_eth_dbg.o mtk_eth_reset.o \
mtk_ppe.o mtk_ppe_debugfs.o mtk_ppe_offload.o
+mtk_eth-$(CONFIG_NET_MEDIATEK_SOC_WED) += mtk_wed.o
+ifdef CONFIG_DEBUG_FS
@@ -135,10 +134,10 @@
diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
old mode 100755
new mode 100644
-index 819d8a0be..2121335a1
+index 9c85e16..88b38e2
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -20,11 +21,13 @@
+@@ -21,11 +21,13 @@
#include <linux/pinctrl/devinfo.h>
#include <linux/phylink.h>
#include <linux/gpio/consumer.h>
@@ -152,15 +151,15 @@
#if defined(CONFIG_NET_MEDIATEK_HNAT) || defined(CONFIG_NET_MEDIATEK_HNAT_MODULE)
#include "mtk_hnat/nf_hnat_mtk.h"
-@@ -1737,6 +1740,7 @@ static int mtk_poll_rx(struct napi_struc
+@@ -2191,6 +2193,7 @@ static int mtk_poll_rx(struct napi_struct *napi, int budget,
+ unsigned int pktlen, *rxdcsum;
struct net_device *netdev = NULL;
- unsigned int pktlen;
dma_addr_t dma_addr = 0;
+ u32 hash, reason;
int mac = 0;
if (eth->hwlro)
-@@ -1827,6 +1831,17 @@ static int mtk_poll_rx(struct napi_struc
+@@ -2282,6 +2285,17 @@ static int mtk_poll_rx(struct napi_struct *napi, int budget,
skb_checksum_none_assert(skb);
skb->protocol = eth_type_trans(skb, netdev);
@@ -176,9 +175,9 @@
+ trxd.rxd4 & MTK_RXD4_FOE_ENTRY);
+
if (netdev->features & NETIF_F_HW_VLAN_CTAG_RX) {
- if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2) ||
- MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V3)) {
-@@ -3243,7 +3258,7 @@ static int mtk_stop(struct net_device *d
+ if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_RX_V2)) {
+ if (trxd.rxd3 & RX_DMA_VTAG_V2)
+@@ -3735,7 +3749,7 @@ static int mtk_stop(struct net_device *dev)
mtk_dma_free(eth);
if (eth->soc->offload_version)
@@ -187,7 +186,7 @@
return 0;
}
-@@ -4217,6 +4278,22 @@ static int mtk_probe(struct platform_dev
+@@ -5044,6 +5058,22 @@ static int mtk_probe(struct platform_device *pdev)
}
}
@@ -208,9 +207,9 @@
+ }
+
for (i = 0; i < MTK_PDMA_IRQ_NUM; i++)
- eth->irq_pdma[i] = platform_get_irq(pdev, i);
-
-@@ -4320,10 +4397,11 @@ static int mtk_probe(struct platform_dev
+ eth->irq_pdma[i] = platform_get_irq(pdev, i);
+
+@@ -5170,10 +5200,11 @@ static int mtk_probe(struct platform_device *pdev)
}
if (eth->soc->offload_version) {
@@ -228,10 +227,10 @@
diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.h b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
old mode 100755
new mode 100644
-index 349f98503..b52378bd6
+index a87e46d..15337d3
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
-@@ -549,6 +549,9 @@
+@@ -578,6 +578,9 @@
#define RX_DMA_SPORT_MASK 0x7
#define RX_DMA_SPORT_MASK_V2 0xf
@@ -241,7 +240,7 @@
/* QDMA descriptor txd4 */
#define TX_DMA_CHKSUM (0x7 << 29)
#define TX_DMA_TSO BIT(28)
-@@ -1596,7 +1607,7 @@ struct mtk_eth {
+@@ -1859,7 +1862,7 @@ struct mtk_eth {
spinlock_t syscfg0_lock;
struct timer_list mtk_dma_monitor_timer;
@@ -253,7 +252,7 @@
diff --git a/drivers/net/ethernet/mediatek/mtk_ppe.c b/drivers/net/ethernet/mediatek/mtk_ppe.c
old mode 100644
new mode 100755
-index 66298e223..3d75c22be
+index 27b5be5..86741bf
--- a/drivers/net/ethernet/mediatek/mtk_ppe.c
+++ b/drivers/net/ethernet/mediatek/mtk_ppe.c
@@ -6,9 +6,22 @@
@@ -520,7 +519,7 @@
memcpy(&hwe->data, &entry->data, sizeof(hwe->data));
wmb();
hwe->ib1 = entry->ib1;
-@@ -362,32 +519,201 @@ int mtk_foe_entry_commit(struct mtk_ppe *ppe, struct mtk_foe_entry *entry,
+@@ -362,32 +520,201 @@ int mtk_foe_entry_commit(struct mtk_ppe *ppe, struct mtk_foe_entry *entry,
dma_wmb();
mtk_ppe_cache_clear(ppe);
@@ -726,7 +725,7 @@
}
static void mtk_ppe_init_foe_table(struct mtk_ppe *ppe)
-@@ -395,7 +717,7 @@ static void mtk_ppe_init_foe_table(struct mtk_ppe *ppe)
+@@ -395,7 +722,7 @@ static void mtk_ppe_init_foe_table(struct mtk_ppe *ppe)
static const u8 skip[] = { 12, 25, 38, 51, 76, 89, 102 };
int i, k;
@@ -735,7 +734,7 @@
if (!IS_ENABLED(CONFIG_SOC_MT7621))
return;
-@@ -443,7 +765,6 @@ int mtk_ppe_start(struct mtk_ppe *ppe)
+@@ -443,7 +770,6 @@ int mtk_ppe_start(struct mtk_ppe *ppe)
MTK_PPE_FLOW_CFG_IP4_NAT |
MTK_PPE_FLOW_CFG_IP4_NAPT |
MTK_PPE_FLOW_CFG_IP4_DSLITE |
@@ -744,7 +743,7 @@
ppe_w32(ppe, MTK_PPE_FLOW_CFG, val);
diff --git a/drivers/net/ethernet/mediatek/mtk_ppe.h b/drivers/net/ethernet/mediatek/mtk_ppe.h
-index 242fb8f2a..1f5cf1c9a 100644
+index 242fb8f..1f5cf1c 100644
--- a/drivers/net/ethernet/mediatek/mtk_ppe.h
+++ b/drivers/net/ethernet/mediatek/mtk_ppe.h
@@ -6,6 +6,7 @@
@@ -900,7 +899,7 @@
#endif
diff --git a/drivers/net/ethernet/mediatek/mtk_ppe_debugfs.c b/drivers/net/ethernet/mediatek/mtk_ppe_debugfs.c
-index d4b482340..a591ab1fd 100644
+index d4b4823..a591ab1 100644
--- a/drivers/net/ethernet/mediatek/mtk_ppe_debugfs.c
+++ b/drivers/net/ethernet/mediatek/mtk_ppe_debugfs.c
@@ -32,7 +32,6 @@ static const char *mtk_foe_pkt_type_str(int type)
@@ -922,7 +921,7 @@
debugfs_create_file("bind", S_IRUGO, root, ppe, &fops_bind);
diff --git a/drivers/net/ethernet/mediatek/mtk_ppe_offload.c b/drivers/net/ethernet/mediatek/mtk_ppe_offload.c
-index 4294f0c74..d4a012608 100644
+index 1380ef0..8a28572 100644
--- a/drivers/net/ethernet/mediatek/mtk_ppe_offload.c
+++ b/drivers/net/ethernet/mediatek/mtk_ppe_offload.c
@@ -11,6 +11,7 @@
@@ -1229,16 +1228,16 @@
f->stats.lastused = jiffies - idle * HZ;
return 0;
-@@ -470,7 +536,7 @@ mtk_eth_setup_tc_block(struct net_device *dev, struct flow_block_offload *f)
- struct flow_block_cb *block_cb;
+@@ -471,7 +537,7 @@ mtk_eth_setup_tc_block(struct net_device *dev, struct flow_block_offload *f)
flow_setup_cb_t *cb;
+ int err = 0;
- if (!eth->ppe.foe_table)
+ if (!eth->ppe || !eth->ppe->foe_table)
return -EOPNOTSUPP;
if (f->binder_type != FLOW_BLOCK_BINDER_TYPE_CLSACT_INGRESS)
-@@ -511,15 +577,18 @@ mtk_eth_setup_tc_block(struct net_device *dev, struct flow_block_offload *f)
+@@ -520,15 +586,18 @@ mtk_eth_setup_tc_block(struct net_device *dev, struct flow_block_offload *f)
int mtk_eth_setup_tc(struct net_device *dev, enum tc_setup_type type,
void *type_data)
{
@@ -1263,7 +1262,7 @@
return rhashtable_init(ð->flow_table, &mtk_flow_ht_params);
diff --git a/drivers/net/ethernet/mediatek/mtk_wed.c b/drivers/net/ethernet/mediatek/mtk_wed.c
new file mode 100644
-index 000000000..ea1cbdf1a
+index 0000000..ea1cbdf
--- /dev/null
+++ b/drivers/net/ethernet/mediatek/mtk_wed.c
@@ -0,0 +1,876 @@
@@ -2145,7 +2144,7 @@
+}
diff --git a/drivers/net/ethernet/mediatek/mtk_wed.h b/drivers/net/ethernet/mediatek/mtk_wed.h
new file mode 100644
-index 000000000..981ec613f
+index 0000000..981ec61
--- /dev/null
+++ b/drivers/net/ethernet/mediatek/mtk_wed.h
@@ -0,0 +1,135 @@
@@ -2286,7 +2285,7 @@
+#endif
diff --git a/drivers/net/ethernet/mediatek/mtk_wed_debugfs.c b/drivers/net/ethernet/mediatek/mtk_wed_debugfs.c
new file mode 100644
-index 000000000..a81d3fd1a
+index 0000000..a81d3fd
--- /dev/null
+++ b/drivers/net/ethernet/mediatek/mtk_wed_debugfs.c
@@ -0,0 +1,175 @@
@@ -2467,7 +2466,7 @@
+}
diff --git a/drivers/net/ethernet/mediatek/mtk_wed_ops.c b/drivers/net/ethernet/mediatek/mtk_wed_ops.c
new file mode 100644
-index 000000000..a5d9d8a5b
+index 0000000..a5d9d8a
--- /dev/null
+++ b/drivers/net/ethernet/mediatek/mtk_wed_ops.c
@@ -0,0 +1,8 @@
@@ -2481,7 +2480,7 @@
+EXPORT_SYMBOL_GPL(mtk_soc_wed_ops);
diff --git a/drivers/net/ethernet/mediatek/mtk_wed_regs.h b/drivers/net/ethernet/mediatek/mtk_wed_regs.h
new file mode 100644
-index 000000000..0a0465ea5
+index 0000000..0a0465e
--- /dev/null
+++ b/drivers/net/ethernet/mediatek/mtk_wed_regs.h
@@ -0,0 +1,251 @@
@@ -2737,10 +2736,10 @@
+
+#endif
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
-index 9f64504ac..35998b1a7 100644
+index ef44d9a..59a3e96 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
-@@ -835,6 +835,7 @@ enum net_device_path_type {
+@@ -844,6 +844,7 @@ enum net_device_path_type {
DEV_PATH_BRIDGE,
DEV_PATH_PPPOE,
DEV_PATH_DSA,
@@ -2748,7 +2747,7 @@
};
struct net_device_path {
-@@ -860,6 +861,12 @@ struct net_device_path {
+@@ -869,6 +870,12 @@ struct net_device_path {
int port;
u16 proto;
} dsa;
@@ -2763,7 +2762,7 @@
diff --git a/include/linux/soc/mediatek/mtk_wed.h b/include/linux/soc/mediatek/mtk_wed.h
new file mode 100644
-index 000000000..7e00cca06
+index 0000000..7e00cca
--- /dev/null
+++ b/include/linux/soc/mediatek/mtk_wed.h
@@ -0,0 +1,131 @@
@@ -2899,7 +2898,7 @@
+
+#endif
diff --git a/net/core/dev.c b/net/core/dev.c
-index 4f0edb218..031ac7c6f 100644
+index a117bd0..1b6d42b 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -675,6 +675,10 @@ int dev_fill_forward_path(const struct net_device *dev, const u8 *daddr,
diff --git a/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3006-ethernet-update-ppe-from-mt7622-to-mt7986.patch b/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3004-ethernet-update-ppe-from-mt7622-to-mt7986.patch
old mode 100755
new mode 100644
similarity index 82%
rename from autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3006-ethernet-update-ppe-from-mt7622-to-mt7986.patch
rename to autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3004-ethernet-update-ppe-from-mt7622-to-mt7986.patch
index 57a21d3..d613ce8
--- a/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3006-ethernet-update-ppe-from-mt7622-to-mt7986.patch
+++ b/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3004-ethernet-update-ppe-from-mt7622-to-mt7986.patch
@@ -1,23 +1,22 @@
-From d86af0076cbf7d99bdb4f28115159643b79ad3fa Mon Sep 17 00:00:00 2001
+From 3562f05aedc6c2d793b34b3ee3eb78e8352804c8 Mon Sep 17 00:00:00 2001
From: Sujuan Chen <sujuan.chen@mediatek.com>
-Date: Wed, 18 May 2022 11:08:15 +0800
-Subject: [PATCH 5/8] 9994-ethernet-update-ppe-from-mt7622-to-mt7986
+Date: Mon, 18 Sep 2023 10:58:32 +0800
+Subject: [PATCH 05/22] ethernet update ppe from mt7622 to mt7986
-Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
---
- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 14 +++-
- drivers/net/ethernet/mediatek/mtk_eth_soc.h | 7 +-
- drivers/net/ethernet/mediatek/mtk_ppe.c | 24 ++++---
- drivers/net/ethernet/mediatek/mtk_ppe.h | 69 ++++++++++---------
- .../net/ethernet/mediatek/mtk_ppe_offload.c | 7 +-
- drivers/net/ethernet/mediatek/mtk_ppe_regs.h | 10 +++
- 6 files changed, 86 insertions(+), 45 deletions(-)
+ drivers/net/ethernet/mediatek/mtk_eth_soc.c | 14 ++++-
+ drivers/net/ethernet/mediatek/mtk_eth_soc.h | 7 ++-
+ drivers/net/ethernet/mediatek/mtk_ppe.c | 29 +++++++++--
+ drivers/net/ethernet/mediatek/mtk_ppe.h | 51 +++++++++++++++++++
+ .../net/ethernet/mediatek/mtk_ppe_offload.c | 8 +++
+ drivers/net/ethernet/mediatek/mtk_ppe_regs.h | 10 ++++
+ 6 files changed, 113 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-index 2121335a1..01fc1e5c0 100644
+index 88b38e2..bfda873 100644
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -1467,16 +1467,27 @@ static int mtk_poll_rx(struct napi_struct *napi, int budget,
+@@ -2285,16 +2285,27 @@ static int mtk_poll_rx(struct napi_struct *napi, int budget,
skb_checksum_none_assert(skb);
skb->protocol = eth_type_trans(skb, netdev);
@@ -45,8 +44,8 @@
+#endif
if (netdev->features & NETIF_F_HW_VLAN_CTAG_RX) {
- if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) {
-@@ -3926,13 +3937,14 @@ static const struct mtk_soc_data mt7986_data = {
+ if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_RX_V2)) {
+@@ -5396,6 +5407,7 @@ static const struct mtk_soc_data mt7986_data = {
.required_clks = MT7986_CLKS_BITMAP,
.required_pctl = false,
.has_sram = false,
@@ -54,27 +53,20 @@
.rss_num = 4,
.txrx = {
.txd_size = sizeof(struct mtk_tx_dma_v2),
- .rxd_size = sizeof(struct mtk_rx_dma),
- .rx_dma_l4_valid = RX_DMA_L4_VALID_V2,
- .dma_max_len = MTK_TX_DMA_BUF_LEN_V2,
- .dma_len_offset = MTK_TX_DMA_BUF_SHIFT_V2,
- },
- };
-
diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.h b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
-index b52378bd6..fce1a7172 100644
+index 15337d3..a385df5 100644
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
-@@ -110,7 +110,7 @@
- #define MTK_GDMA_TCS_EN BIT(21)
+@@ -130,7 +130,7 @@
#define MTK_GDMA_UCS_EN BIT(20)
+ #define MTK_GDMA_STRP_CRC BIT(16)
#define MTK_GDMA_TO_PDMA 0x0
-#define MTK_GDMA_TO_PPE 0x4444
+#define MTK_GDMA_TO_PPE 0x3333
#define MTK_GDMA_DROP_ALL 0x7777
- /* Unicast Filter MAC Address Register - Low */
-@@ -560,6 +560,11 @@
+ /* GDM Egress Control Register */
+@@ -630,6 +630,11 @@
#define MTK_RXD4_SRC_PORT GENMASK(21, 19)
#define MTK_RXD4_ALG GENMASK(31, 22)
@@ -87,7 +79,7 @@
#define RX_DMA_L4_VALID BIT(24)
#define RX_DMA_L4_VALID_PDMA BIT(30) /* when PDMA is used */
diff --git a/drivers/net/ethernet/mediatek/mtk_ppe.c b/drivers/net/ethernet/mediatek/mtk_ppe.c
-index 3d75c22be..d46e91178 100755
+index 86741bf..ef8acbc 100755
--- a/drivers/net/ethernet/mediatek/mtk_ppe.c
+++ b/drivers/net/ethernet/mediatek/mtk_ppe.c
@@ -122,7 +122,7 @@ static u32 mtk_ppe_hash_entry(struct mtk_foe_entry *e)
@@ -102,7 +94,7 @@
@@ -171,8 +171,12 @@ int mtk_foe_entry_prepare(struct mtk_foe_entry *entry, int type, int l4proto,
MTK_FOE_IB1_BIND_CACHE;
entry->ib1 = val;
-
+
+#if defined(CONFIG_MEDIATEK_NETSYS_V2)
+ val = FIELD_PREP(MTK_FOE_IB2_PORT_AG, 0xf) |
+#else
@@ -112,7 +104,7 @@
FIELD_PREP(MTK_FOE_IB2_DEST_PORT, pse_port);
if (is_multicast_ether_addr(dest_mac))
-@@ -359,12 +358,19 @@ int mtk_foe_entry_set_wdma(struct mtk_foe_entry *entry, int wdma_idx, int txq,
+@@ -359,12 +363,19 @@ int mtk_foe_entry_set_wdma(struct mtk_foe_entry *entry, int wdma_idx, int txq,
*ib2 &= ~MTK_FOE_IB2_PORT_MG;
*ib2 |= MTK_FOE_IB2_WDMA_WINFO;
@@ -132,7 +124,7 @@
return 0;
}
-@@ -741,6 +738,9 @@ int mtk_ppe_start(struct mtk_ppe *ppe)
+@@ -746,6 +757,9 @@ int mtk_ppe_start(struct mtk_ppe *ppe)
MTK_PPE_TB_CFG_AGE_TCP |
MTK_PPE_TB_CFG_AGE_UDP |
MTK_PPE_TB_CFG_AGE_TCP_FIN |
@@ -142,18 +134,18 @@
FIELD_PREP(MTK_PPE_TB_CFG_SEARCH_MISS,
MTK_PPE_SEARCH_MISS_ACTION_FORWARD_BUILD) |
FIELD_PREP(MTK_PPE_TB_CFG_KEEPALIVE,
-@@ -757,7 +755,8 @@ int mtk_ppe_start(struct mtk_ppe *ppe)
+@@ -762,15 +776,17 @@ int mtk_ppe_start(struct mtk_ppe *ppe)
mtk_ppe_cache_enable(ppe, true);
- val = MTK_PPE_FLOW_CFG_IP4_TCP_FRAG |
+- MTK_PPE_FLOW_CFG_IP4_UDP_FRAG |
+ val = MTK_PPE_MD_TOAP_BYP_CRSN0 |
+ MTK_PPE_MD_TOAP_BYP_CRSN1 |
+ MTK_PPE_MD_TOAP_BYP_CRSN2 |
-- MTK_PPE_FLOW_CFG_IP4_UDP_FRAG |
MTK_PPE_FLOW_CFG_IP6_3T_ROUTE |
MTK_PPE_FLOW_CFG_IP6_5T_ROUTE |
-@@ -765,7 +765,8 @@ int mtk_ppe_start(struct mtk_ppe *ppe)
+ MTK_PPE_FLOW_CFG_IP6_6RD |
MTK_PPE_FLOW_CFG_IP4_NAT |
MTK_PPE_FLOW_CFG_IP4_NAPT |
MTK_PPE_FLOW_CFG_IP4_DSLITE |
@@ -163,10 +155,10 @@
ppe_w32(ppe, MTK_PPE_FLOW_CFG, val);
val = FIELD_PREP(MTK_PPE_UNBIND_AGE_MIN_PACKETS, 1000) |
-@@ -800,6 +801,11 @@ int mtk_ppe_start(struct mtk_ppe *ppe)
+@@ -806,6 +822,11 @@ int mtk_ppe_start(struct mtk_ppe *ppe)
ppe_w32(ppe, MTK_PPE_DEFAULT_CPU_PORT, 0);
-
+
+#if defined(CONFIG_MEDIATEK_NETSYS_V2)
+ ppe_w32(ppe, MTK_PPE_DEFAULT_CPU_PORT1, 0xcb777);
+ ppe_w32(ppe, MTK_PPE_SBW_CTRL, 0x7f);
@@ -176,13 +168,13 @@
}
diff --git a/drivers/net/ethernet/mediatek/mtk_ppe.h b/drivers/net/ethernet/mediatek/mtk_ppe.h
-index 1f5cf1c9a..a76f4b0ac 100644
+index 1f5cf1c..7012351 100644
--- a/drivers/net/ethernet/mediatek/mtk_ppe.h
+++ b/drivers/net/ethernet/mediatek/mtk_ppe.h
@@ -8,7 +8,11 @@
#include <linux/bitfield.h>
#include <linux/rhashtable.h>
-
+
+#if defined(CONFIG_MEDIATEK_NETSYS_V2)
+#define MTK_ETH_PPE_BASE 0x2000
+#else
@@ -191,7 +183,7 @@
#define MTK_PPE_ENTRIES_SHIFT 3
#define MTK_PPE_ENTRIES (1024 << MTK_PPE_ENTRIES_SHIFT)
-@@ -16,20 +16,40 @@
+@@ -16,6 +20,24 @@
#define MTK_PPE_WAIT_TIMEOUT_US 1000000
#define MTK_FOE_IB1_UNBIND_TIMESTAMP GENMASK(7, 0)
@@ -216,14 +208,7 @@
#define MTK_FOE_IB1_UNBIND_PACKETS GENMASK(23, 8)
#define MTK_FOE_IB1_UNBIND_PREBIND BIT(24)
- #define MTK_FOE_IB1_BIND_TIMESTAMP GENMASK(14, 0)
- #define MTK_FOE_IB1_BIND_KEEPALIVE BIT(15)
- #define MTK_FOE_IB1_BIND_VLAN_LAYER GENMASK(18, 16)
- #define MTK_FOE_IB1_BIND_PPPOE BIT(19)
- #define MTK_FOE_IB1_BIND_VLAN_TAG BIT(20)
- #define MTK_FOE_IB1_BIND_PKT_SAMPLE BIT(21)
- #define MTK_FOE_IB1_BIND_CACHE BIT(22)
- #define MTK_FOE_IB1_BIND_TUNNEL_DECAP BIT(23)
+@@ -30,6 +52,8 @@
#define MTK_FOE_IB1_BIND_TTL BIT(24)
#define MTK_FOE_IB1_PACKET_TYPE GENMASK(27, 25)
@@ -232,7 +217,7 @@
#define MTK_FOE_IB1_STATE GENMASK(29, 28)
#define MTK_FOE_IB1_UDP BIT(30)
#define MTK_FOE_IB1_STATIC BIT(31)
-@@ -44,24 +47,42 @@ enum {
+@@ -44,24 +68,42 @@ enum {
MTK_PPE_PKT_TYPE_IPV6_6RD = 7,
};
@@ -275,7 +260,7 @@
enum {
MTK_FOE_STATE_INVALID,
-@@ -83,6 +81,11 @@ struct mtk_foe_mac_info {
+@@ -83,6 +125,11 @@ struct mtk_foe_mac_info {
u16 pppoe_id;
u16 src_mac_lo;
@@ -287,7 +272,7 @@
};
/* software-only entry type */
-@@ -200,7 +205,11 @@ struct mtk_foe_entry {
+@@ -200,7 +247,11 @@ struct mtk_foe_entry {
struct mtk_foe_ipv4_dslite dslite;
struct mtk_foe_ipv6 ipv6;
struct mtk_foe_ipv6_6rd ipv6_6rd;
@@ -300,11 +285,10 @@
};
diff --git a/drivers/net/ethernet/mediatek/mtk_ppe_offload.c b/drivers/net/ethernet/mediatek/mtk_ppe_offload.c
-index d4a012608..5a4201447 100644
+index 8a28572..77594f3 100644
--- a/drivers/net/ethernet/mediatek/mtk_ppe_offload.c
+++ b/drivers/net/ethernet/mediatek/mtk_ppe_offload.c
-@@ -192,7 +192,15 @@ mtk_flow_set_output_device(struct mtk_eth *eth, struct mtk_foe_entry *foe,
- if (mtk_flow_get_wdma_info(dev, dest_mac, &info) == 0) {
+@@ -193,6 +193,14 @@ mtk_flow_set_output_device(struct mtk_eth *eth, struct mtk_foe_entry *foe,
mtk_foe_entry_set_wdma(foe, info.wdma_idx, info.queue, info.bss,
info.wcid);
pse_port = PSE_PPE0_PORT;
@@ -320,7 +304,7 @@
goto out;
}
diff --git a/drivers/net/ethernet/mediatek/mtk_ppe_regs.h b/drivers/net/ethernet/mediatek/mtk_ppe_regs.h
-index 0c45ea090..d319f1861 100644
+index 0c45ea0..d319f18 100644
--- a/drivers/net/ethernet/mediatek/mtk_ppe_regs.h
+++ b/drivers/net/ethernet/mediatek/mtk_ppe_regs.h
@@ -21,6 +21,9 @@
diff --git a/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3007-flow-offload-add-mkhnat-dual-ppe-new-v2.patch b/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3005-flow-offload-add-mkhnat-dual-ppe-new-v2.patch
old mode 100755
new mode 100644
similarity index 95%
rename from autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3007-flow-offload-add-mkhnat-dual-ppe-new-v2.patch
rename to autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3005-flow-offload-add-mkhnat-dual-ppe-new-v2.patch
index 9957670..407cea0
--- a/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3007-flow-offload-add-mkhnat-dual-ppe-new-v2.patch
+++ b/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3005-flow-offload-add-mkhnat-dual-ppe-new-v2.patch
@@ -1,7 +1,7 @@
-From 8341e1b35ca14f303f828f96f5e63719f80be88e Mon Sep 17 00:00:00 2001
+From 9f734703a4a6870a34ea015ba27f01b986e80c4c Mon Sep 17 00:00:00 2001
From: Bo-Cun Chen <bc-bocun.chen@mediatek.com>
-Date: Wed, 23 Aug 2023 11:36:05 +0800
-Subject: [PATCH] 999-3007-flow-offload-add-mkhnat-dual-ppe-new-v2
+Date: Mon, 18 Sep 2023 10:59:56 +0800
+Subject: [PATCH 06/22] flow-offload-add-mkhnat-dual-ppe-new-v2
---
arch/arm64/boot/dts/mediatek/mt7986a.dtsi | 1 +
@@ -28,10 +28,10 @@
#address-cells = <1>;
#size-cells = <0>;
diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-index f019c56..81b68d6 100644
+index bfda873..ee5e0c6 100644
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -2097,6 +2097,7 @@ static int mtk_poll_rx(struct napi_struct *napi, int budget,
+@@ -2185,6 +2185,7 @@ static int mtk_poll_rx(struct napi_struct *napi, int budget,
u8 *data, *new_data;
struct mtk_rx_dma_v2 *rxd, trxd;
int done = 0;
@@ -39,7 +39,7 @@
if (unlikely(!ring))
goto rx_done;
-@@ -2209,14 +2210,20 @@ static int mtk_poll_rx(struct napi_struct *napi, int budget,
+@@ -2297,14 +2298,20 @@ static int mtk_poll_rx(struct napi_struct *napi, int budget,
#if defined(CONFIG_MEDIATEK_NETSYS_RX_V2)
reason = FIELD_GET(MTK_RXD5_PPE_CPU_REASON_V2, trxd.rxd5);
@@ -66,7 +66,7 @@
#endif
if (netdev->features & NETIF_F_HW_VLAN_CTAG_RX) {
-@@ -3588,8 +3595,12 @@ static int mtk_open(struct net_device *dev)
+@@ -3676,8 +3683,12 @@ static int mtk_open(struct net_device *dev)
regmap_write(eth->sgmii->pcs[id].regmap,
SGMSYS_QPHY_PWR_STATE_CTRL, 0);
@@ -81,7 +81,7 @@
mtk_gdm_config(eth, mac->id, gdm_config);
-@@ -3671,8 +3682,10 @@ static int mtk_stop(struct net_device *dev)
+@@ -3759,8 +3770,10 @@ static int mtk_stop(struct net_device *dev)
mtk_dma_free(eth);
@@ -94,7 +94,7 @@
return 0;
}
-@@ -4958,15 +4971,35 @@ static int mtk_probe(struct platform_device *pdev)
+@@ -5211,15 +5224,35 @@ static int mtk_probe(struct platform_device *pdev)
}
if (eth->soc->offload_version) {
@@ -138,7 +138,7 @@
for (i = 0; i < MTK_MAX_DEVS; i++) {
diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.h b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
-index 8675c86..fad3e73 100644
+index a385df5..783166d 100644
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
@@ -130,7 +130,12 @@
@@ -155,7 +155,7 @@
#define MTK_GDMA_DROP_ALL 0x7777
/* GDM Egress Control Register */
-@@ -1856,7 +1861,8 @@ struct mtk_eth {
+@@ -1867,7 +1872,8 @@ struct mtk_eth {
spinlock_t syscfg0_lock;
struct timer_list mtk_dma_monitor_timer;
@@ -165,9 +165,9 @@
struct rhashtable flow_table;
};
-@@ -1918,9 +1924,11 @@ int mtk_usxgmii_init(struct mtk_eth *eth, struct device_node *r);
- int mtk_toprgu_init(struct mtk_eth *eth, struct device_node *r);
+@@ -1949,9 +1955,11 @@ int mtk_toprgu_init(struct mtk_eth *eth, struct device_node *r);
int mtk_dump_usxgmii(struct regmap *pmap, char *name, u32 offset, u32 range);
+ void mtk_usxgmii_link_poll(struct work_struct *work);
-int mtk_eth_offload_init(struct mtk_eth *eth);
+int mtk_eth_offload_init(struct mtk_eth *eth, int id);
@@ -179,7 +179,7 @@
+int mtk_ppe_debugfs_init(struct mtk_eth *eth);
#endif /* MTK_ETH_H */
diff --git a/drivers/net/ethernet/mediatek/mtk_ppe.c b/drivers/net/ethernet/mediatek/mtk_ppe.c
-index 7506670..0ff1fef 100755
+index ef8acbc..96c15b3 100755
--- a/drivers/net/ethernet/mediatek/mtk_ppe.c
+++ b/drivers/net/ethernet/mediatek/mtk_ppe.c
@@ -696,7 +696,7 @@ int mtk_foe_entry_idle_time(struct mtk_ppe *ppe, struct mtk_flow_entry *entry)
@@ -330,7 +330,7 @@
diff --git a/drivers/net/ethernet/mediatek/mtk_ppe_offload.c b/drivers/net/ethernet/mediatek/mtk_ppe_offload.c
old mode 100644
new mode 100755
-index 77594f3..18f6333
+index 77594f3..f256607
--- a/drivers/net/ethernet/mediatek/mtk_ppe_offload.c
+++ b/drivers/net/ethernet/mediatek/mtk_ppe_offload.c
@@ -229,9 +229,12 @@ mtk_flow_offload_replace(struct mtk_eth *eth, struct flow_cls_offload *f)
diff --git a/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3008-add-wed-tx-support-for-mt7986.patch b/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3006-add-wed-tx-support-for-mt7986.patch
similarity index 97%
rename from autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3008-add-wed-tx-support-for-mt7986.patch
rename to autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3006-add-wed-tx-support-for-mt7986.patch
index f6fcae3..3e0a0f1 100644
--- a/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3008-add-wed-tx-support-for-mt7986.patch
+++ b/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3006-add-wed-tx-support-for-mt7986.patch
@@ -1,7 +1,7 @@
-From c6b43d63c3d4229b5f15cb7391192494b07e0fa7 Mon Sep 17 00:00:00 2001
+From a0b64514c2bfe883d0128ce5bb26559c34185d90 Mon Sep 17 00:00:00 2001
From: Bo Jiao <Bo.Jiao@mediatek.com>
-Date: Mon, 27 Jun 2022 14:53:54 +0800
-Subject: [PATCH 7/8] 9996-add-wed-tx-support-for-mt7986
+Date: Mon, 18 Sep 2023 11:01:55 +0800
+Subject: [PATCH 07/22] add-wed-tx-support-for-mt7986
---
arch/arm64/boot/dts/mediatek/mt7986a.dtsi | 2 +
@@ -12,11 +12,11 @@
drivers/net/ethernet/mediatek/mtk_wed.h | 18 +-
.../net/ethernet/mediatek/mtk_wed_debugfs.c | 3 +
drivers/net/ethernet/mediatek/mtk_wed_regs.h | 130 ++++-
- include/linux/soc/mediatek/mtk_wed.h | 29 +-
- 9 files changed, 546 insertions(+), 150 deletions(-)
+ include/linux/soc/mediatek/mtk_wed.h | 23 +
+ 9 files changed, 547 insertions(+), 149 deletions(-)
diff --git a/arch/arm64/boot/dts/mediatek/mt7986a.dtsi b/arch/arm64/boot/dts/mediatek/mt7986a.dtsi
-index 381136c21..644255b35 100644
+index 0c54e12..3ff8994 100644
--- a/arch/arm64/boot/dts/mediatek/mt7986a.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt7986a.dtsi
@@ -64,6 +64,7 @@
@@ -36,7 +36,7 @@
ap2woccif: ap2woccif@151A5000 {
diff --git a/arch/arm64/boot/dts/mediatek/mt7986b.dtsi b/arch/arm64/boot/dts/mediatek/mt7986b.dtsi
-index 0e5f116a2..67bf86f6a 100644
+index 2d2207f..043e509 100644
--- a/arch/arm64/boot/dts/mediatek/mt7986b.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt7986b.dtsi
@@ -64,6 +64,7 @@
@@ -56,18 +56,18 @@
ap2woccif: ap2woccif@151A5000 {
diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-index 3f67bebfe..ac021e2ed 100644
+index ee5e0c6..2cab49a 100644
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -4807,6 +4807,7 @@ static int mtk_probe(struct platform_device *pdev)
+@@ -4968,6 +4968,7 @@ static int mtk_probe(struct platform_device *pdev)
{
- struct device_node *mac_np;
+ struct device_node *mac_np, *mux_np;
struct mtk_eth *eth;
+ struct resource *res = NULL;
int err, i;
eth = devm_kzalloc(&pdev->dev, sizeof(*eth), GFP_KERNEL);
-@@ -4827,13 +4828,12 @@ static int mtk_probe(struct platform_device *pdev)
+@@ -4988,13 +4989,12 @@ static int mtk_probe(struct platform_device *pdev)
return PTR_ERR(eth->sram_base);
}
@@ -86,7 +86,7 @@
mtk_get_hwver(eth);
-@@ -4929,12 +4929,15 @@ static int mtk_probe(struct platform_device *pdev)
+@@ -5090,12 +5090,15 @@ static int mtk_probe(struct platform_device *pdev)
MTK_WDMA1_BASE
};
void __iomem *wdma;
@@ -102,14 +102,14 @@
+ mtk_wed_add_hw(np, eth, wdma, wdma_phy, i);
}
- for (i = 0; i < MTK_MAX_IRQ_NUM; i++) {
+ for (i = 0; i < MTK_PDMA_IRQ_NUM; i++)
diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.h b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
-index b4de7c0c6..4a69bd0cf 100644
+index 783166d..960b979 100644
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
-@@ -518,8 +518,13 @@
+@@ -583,8 +583,13 @@
#define RX_DMA_SPORT_MASK 0x7
- #endif
+ #define RX_DMA_SPORT_MASK_V2 0xf
+#if defined(CONFIG_MEDIATEK_NETSYS_V2)
+#define MTK_WDMA0_BASE 0x4800
@@ -122,7 +122,7 @@
/* QDMA descriptor txd4 */
#define TX_DMA_CHKSUM (0x7 << 29)
diff --git a/drivers/net/ethernet/mediatek/mtk_wed.c b/drivers/net/ethernet/mediatek/mtk_wed.c
-index ea1cbdf1a..48b0353bb 100644
+index ea1cbdf..0588e32 100644
--- a/drivers/net/ethernet/mediatek/mtk_wed.c
+++ b/drivers/net/ethernet/mediatek/mtk_wed.c
@@ -18,15 +18,6 @@
@@ -209,7 +209,7 @@
desc->info = 0;
desc++;
-@@ -202,12 +206,12 @@ free_pagelist:
+@@ -202,12 +206,12 @@ mtk_wed_free_buffer(struct mtk_wed_device *dev)
}
static void
@@ -701,12 +701,12 @@
- MTK_WED_CTRL_WED_TX_FREE_AGENT_EN);
-
- wed_w32(dev, MTK_WED_PCIE_INT_TRIGGER, MTK_WED_PCIE_INT_TRIGGER_STATUS);
-+ mtk_wed_set_int(dev, irq_mask);
-
+-
- wed_w32(dev, MTK_WED_WPDMA_INT_TRIGGER,
- MTK_WED_WPDMA_INT_TRIGGER_RX_DONE |
- MTK_WED_WPDMA_INT_TRIGGER_TX_DONE);
--
++ mtk_wed_set_int(dev, irq_mask);
+
- wed_set(dev, MTK_WED_WPDMA_INT_CTRL,
- MTK_WED_WPDMA_INT_CTRL_SUBRT_ADV);
-
@@ -842,7 +842,7 @@
}
return 0;
-@@ -780,7 +1009,8 @@ out:
+@@ -780,7 +1009,8 @@ void mtk_wed_flow_remove(int index)
}
void mtk_wed_add_hw(struct device_node *np, struct mtk_eth *eth,
@@ -892,7 +892,7 @@
hw_list[index] = hw;
diff --git a/drivers/net/ethernet/mediatek/mtk_wed.h b/drivers/net/ethernet/mediatek/mtk_wed.h
-index 981ec613f..9b17b7405 100644
+index 981ec61..9b17b74 100644
--- a/drivers/net/ethernet/mediatek/mtk_wed.h
+++ b/drivers/net/ethernet/mediatek/mtk_wed.h
@@ -8,6 +8,19 @@
@@ -941,7 +941,7 @@
}
static inline void
diff --git a/drivers/net/ethernet/mediatek/mtk_wed_debugfs.c b/drivers/net/ethernet/mediatek/mtk_wed_debugfs.c
-index a81d3fd1a..f420f187e 100644
+index a81d3fd..f420f18 100644
--- a/drivers/net/ethernet/mediatek/mtk_wed_debugfs.c
+++ b/drivers/net/ethernet/mediatek/mtk_wed_debugfs.c
@@ -116,6 +116,9 @@ wed_txinfo_show(struct seq_file *s, void *data)
@@ -955,7 +955,7 @@
struct mtk_wed_hw *hw = s->private;
struct mtk_wed_device *dev = hw->wed_dev;
diff --git a/drivers/net/ethernet/mediatek/mtk_wed_regs.h b/drivers/net/ethernet/mediatek/mtk_wed_regs.h
-index 0a0465ea5..69f136ed4 100644
+index 0a0465e..a9b9e2a 100644
--- a/drivers/net/ethernet/mediatek/mtk_wed_regs.h
+++ b/drivers/net/ethernet/mediatek/mtk_wed_regs.h
@@ -4,9 +4,15 @@
@@ -1217,7 +1217,7 @@
#define MTK_WDMA_INT_MASK 0x228
#define MTK_WDMA_INT_MASK_TX_DONE GENMASK(3, 0)
diff --git a/include/linux/soc/mediatek/mtk_wed.h b/include/linux/soc/mediatek/mtk_wed.h
-index 7e00cca06..24742604b 100644
+index 7e00cca..ffd547a 100644
--- a/include/linux/soc/mediatek/mtk_wed.h
+++ b/include/linux/soc/mediatek/mtk_wed.h
@@ -8,6 +8,19 @@
diff --git a/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3009-add-wed-tx-wds-support-for-mt7986.patch b/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3007-add-wed-tx-wds-support-for-mt7986.patch
old mode 100755
new mode 100644
similarity index 89%
rename from autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3009-add-wed-tx-wds-support-for-mt7986.patch
rename to autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3007-add-wed-tx-wds-support-for-mt7986.patch
index d17f43d..aaa6c48
--- a/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3009-add-wed-tx-wds-support-for-mt7986.patch
+++ b/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3007-add-wed-tx-wds-support-for-mt7986.patch
@@ -1,9 +1,8 @@
-From 3bddc232ca043699e893d279a3ec1f72ff6b9fae Mon Sep 17 00:00:00 2001
+From 396ce749479219467ea3f1123d5e9a303e5051ec Mon Sep 17 00:00:00 2001
From: Sujuan Chen <sujuan.chen@mediatek.com>
-Date: Sat, 10 Sep 2022 15:42:32 +0800
-Subject: [PATCH] 9996-add-wed-tx-wds-support-on-panther
+Date: Mon, 18 Sep 2023 11:03:33 +0800
+Subject: [PATCH 08/22] add-wed-tx-wds-support-for-mt7986
-Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
---
drivers/net/ethernet/mediatek/mtk_wed.c | 8 +++++++-
drivers/net/ethernet/mediatek/mtk_wed_regs.h | 1 +
@@ -11,7 +10,7 @@
3 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mediatek/mtk_wed.c b/drivers/net/ethernet/mediatek/mtk_wed.c
-index 48b0353..472726e 100644
+index 0588e32..23e3dc5 100644
--- a/drivers/net/ethernet/mediatek/mtk_wed.c
+++ b/drivers/net/ethernet/mediatek/mtk_wed.c
@@ -797,7 +797,7 @@ mtk_wed_start(struct mtk_wed_device *dev, u32 irq_mask)
@@ -44,7 +43,7 @@
ret = mtk_wed_buffer_alloc(dev);
if (ret) {
diff --git a/drivers/net/ethernet/mediatek/mtk_wed_regs.h b/drivers/net/ethernet/mediatek/mtk_wed_regs.h
-index e107de7..b189761 100644
+index a9b9e2a..14e0e21 100644
--- a/drivers/net/ethernet/mediatek/mtk_wed_regs.h
+++ b/drivers/net/ethernet/mediatek/mtk_wed_regs.h
@@ -31,6 +31,7 @@ struct mtk_wdma_desc {
diff --git a/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3010-add-wed-rx-support-for-mt7896.patch b/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3008-add-wed-rx-support-for-mt7896.patch
old mode 100755
new mode 100644
similarity index 98%
rename from autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3010-add-wed-rx-support-for-mt7896.patch
rename to autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3008-add-wed-rx-support-for-mt7896.patch
index 053a4da..92f50bf
--- a/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3010-add-wed-rx-support-for-mt7896.patch
+++ b/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3008-add-wed-rx-support-for-mt7896.patch
@@ -1,9 +1,8 @@
-From 7c81104d65728fb1c0f156c46e3cfc5dec24b119 Mon Sep 17 00:00:00 2001
+From d35f304a7d0ec9612064a41b98338d9f712fbb48 Mon Sep 17 00:00:00 2001
From: Sujuan Chen <sujuan.chen@mediatek.com>
-Date: Wed, 15 Jun 2022 14:38:54 +0800
-Subject: [PATCH 8/8] 9997-add-wed-rx-support-for-mt7896
+Date: Mon, 18 Sep 2023 11:04:53 +0800
+Subject: [PATCH 09/22] add-wed-rx-support-for-mt7896
-Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
---
arch/arm64/boot/dts/mediatek/mt7986a.dtsi | 42 +-
arch/arm64/boot/dts/mediatek/mt7986b.dtsi | 42 +-
@@ -19,7 +18,7 @@
drivers/net/ethernet/mediatek/mtk_wed_wo.c | 564 ++++++++++++++++
drivers/net/ethernet/mediatek/mtk_wed_wo.h | 324 +++++++++
include/linux/soc/mediatek/mtk_wed.h | 126 +++-
- 14 files changed, 2796 insertions(+), 75 deletions(-)
+ 14 files changed, 2801 insertions(+), 83 deletions(-)
create mode 100644 drivers/net/ethernet/mediatek/mtk_wed_ccif.c
create mode 100644 drivers/net/ethernet/mediatek/mtk_wed_ccif.h
create mode 100644 drivers/net/ethernet/mediatek/mtk_wed_mcu.c
@@ -28,7 +27,7 @@
create mode 100644 drivers/net/ethernet/mediatek/mtk_wed_wo.h
diff --git a/arch/arm64/boot/dts/mediatek/mt7986a.dtsi b/arch/arm64/boot/dts/mediatek/mt7986a.dtsi
-index 87d2b11a9..6abc06db8 100644
+index 3ff8994..c5dc5e8 100644
--- a/arch/arm64/boot/dts/mediatek/mt7986a.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt7986a.dtsi
@@ -65,6 +65,12 @@
@@ -99,7 +98,7 @@
resets = <ðsysrst 0>;
reset-names = "wocpu_rst";
diff --git a/arch/arm64/boot/dts/mediatek/mt7986b.dtsi b/arch/arm64/boot/dts/mediatek/mt7986b.dtsi
-index 67bf86f6a..6710b388b 100644
+index 043e509..bfd2a02 100644
--- a/arch/arm64/boot/dts/mediatek/mt7986b.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt7986b.dtsi
@@ -65,6 +65,12 @@
@@ -170,7 +169,7 @@
resets = <ðsysrst 0>;
reset-names = "wocpu_rst";
diff --git a/drivers/net/ethernet/mediatek/Makefile b/drivers/net/ethernet/mediatek/Makefile
-index 3528f1b..0c724a5 100644
+index 4090132..fdbb90f 100644
--- a/drivers/net/ethernet/mediatek/Makefile
+++ b/drivers/net/ethernet/mediatek/Makefile
@@ -10,5 +10,5 @@ mtk_eth-$(CONFIG_NET_MEDIATEK_SOC_WED) += mtk_wed.o
@@ -181,7 +180,7 @@
+obj-$(CONFIG_NET_MEDIATEK_SOC_WED) += mtk_wed_ops.o mtk_wed_wo.o mtk_wed_mcu.o mtk_wed_ccif.o
obj-$(CONFIG_NET_MEDIATEK_HNAT) += mtk_hnat/
diff --git a/drivers/net/ethernet/mediatek/mtk_wed.c b/drivers/net/ethernet/mediatek/mtk_wed.c
-index 2700176..b037d00 100644
+index 23e3dc5..4b2f1a2 100644
--- a/drivers/net/ethernet/mediatek/mtk_wed.c
+++ b/drivers/net/ethernet/mediatek/mtk_wed.c
@@ -13,11 +13,19 @@
@@ -1139,7 +1138,7 @@
static u32
mtk_wed_irq_get(struct mtk_wed_device *dev, u32 mask)
{
-@@ -1020,6 +1558,8 @@ void mtk_wed_add_hw(struct device_node *np, struct mtk_eth *eth,
+@@ -1022,6 +1560,8 @@ void mtk_wed_add_hw(struct device_node *np, struct mtk_eth *eth,
.attach = mtk_wed_attach,
.tx_ring_setup = mtk_wed_tx_ring_setup,
.txfree_ring_setup = mtk_wed_txfree_ring_setup,
@@ -1148,7 +1147,7 @@
.start = mtk_wed_start,
.stop = mtk_wed_stop,
.reset_dma = mtk_wed_reset_dma,
-@@ -1028,6 +1568,7 @@ void mtk_wed_add_hw(struct device_node *np, struct mtk_eth *eth,
+@@ -1030,6 +1570,7 @@ void mtk_wed_add_hw(struct device_node *np, struct mtk_eth *eth,
.irq_get = mtk_wed_irq_get,
.irq_set_mask = mtk_wed_irq_set_mask,
.detach = mtk_wed_detach,
@@ -1156,7 +1155,7 @@
};
struct device_node *eth_np = eth->dev->of_node;
struct platform_device *pdev;
-@@ -1067,6 +1608,7 @@ void mtk_wed_add_hw(struct device_node *np, struct mtk_eth *eth,
+@@ -1069,6 +1610,7 @@ void mtk_wed_add_hw(struct device_node *np, struct mtk_eth *eth,
hw->wdma_phy = wdma_phy;
hw->index = index;
hw->irq = irq;
@@ -1164,7 +1163,7 @@
if (!MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) {
hw->mirror = syscon_regmap_lookup_by_phandle(eth_np,
-@@ -1083,6 +1625,7 @@ void mtk_wed_add_hw(struct device_node *np, struct mtk_eth *eth,
+@@ -1085,6 +1627,7 @@ void mtk_wed_add_hw(struct device_node *np, struct mtk_eth *eth,
regmap_write(hw->mirror, 0, 0);
regmap_write(hw->mirror, 4, 0);
}
@@ -2301,7 +2300,7 @@
+
+#endif
diff --git a/drivers/net/ethernet/mediatek/mtk_wed_regs.h b/drivers/net/ethernet/mediatek/mtk_wed_regs.h
-index b189761..9d021e2 100644
+index 14e0e21..31871f7 100644
--- a/drivers/net/ethernet/mediatek/mtk_wed_regs.h
+++ b/drivers/net/ethernet/mediatek/mtk_wed_regs.h
@@ -4,6 +4,8 @@
@@ -2366,8 +2365,8 @@
+ MTK_WED_EXT_INT_STATUS_RX_FBUF_DMAD_ER | \
MTK_WED_EXT_INT_STATUS_RX_DRV_R_RESP_ERR | \
MTK_WED_EXT_INT_STATUS_RX_DRV_W_RESP_ERR | \
- MTK_WED_EXT_INT_STATUS_RX_DRV_COHERENT | \
-@@ -97,6 +106,8 @@ struct mtk_wdma_desc {
+ MTK_WED_EXT_INT_STATUS_RX_DRV_INIT_WDMA_EN | \
+@@ -96,6 +105,8 @@ struct mtk_wdma_desc {
MTK_WED_EXT_INT_STATUS_TX_DMA_W_RESP_ERR)
#define MTK_WED_EXT_INT_MASK 0x028
@@ -2376,7 +2375,7 @@
#define MTK_WED_STATUS 0x060
#define MTK_WED_STATUS_TX GENMASK(15, 8)
-@@ -184,6 +195,9 @@ struct mtk_wdma_desc {
+@@ -183,6 +194,9 @@ struct mtk_wdma_desc {
#define MTK_WED_RING_RX(_n) (0x400 + (_n) * 0x10)
@@ -2386,7 +2385,7 @@
#define MTK_WED_WPDMA_INT_TRIGGER 0x504
#define MTK_WED_WPDMA_INT_TRIGGER_RX_DONE BIT(1)
#define MTK_WED_WPDMA_INT_TRIGGER_TX_DONE GENMASK(5, 4)
-@@ -240,13 +254,19 @@ struct mtk_wdma_desc {
+@@ -239,13 +253,19 @@ struct mtk_wdma_desc {
#define MTK_WED_WPDMA_INT_CTRL_TX 0x530
#define MTK_WED_WPDMA_INT_CTRL_TX0_DONE_EN BIT(0)
@@ -2407,7 +2406,7 @@
#define MTK_WED_WPDMA_INT_CTRL_TX_FREE 0x538
#define MTK_WED_WPDMA_INT_CTRL_TX_FREE_DONE_EN BIT(0)
-@@ -271,13 +291,40 @@ struct mtk_wdma_desc {
+@@ -270,13 +290,40 @@ struct mtk_wdma_desc {
#define MTK_WED_WPDMA_TX_MIB(_n) (0x5a0 + (_n) * 4)
#define MTK_WED_WPDMA_TX_COHERENT_MIB(_n) (0x5d0 + (_n) * 4)
@@ -2448,7 +2447,7 @@
#define MTK_WED_WDMA_GLO_CFG_RX_DRV_EN BIT(2)
#define MTK_WED_WDMA_GLO_CFG_RX_DRV_BUSY BIT(3)
#define MTK_WED_WDMA_GLO_CFG_BT_SIZE GENMASK(5, 4)
-@@ -321,6 +368,20 @@ struct mtk_wdma_desc {
+@@ -320,6 +367,20 @@ struct mtk_wdma_desc {
#define MTK_WED_WDMA_RX_RECYCLE_MIB(_n) (0xae8 + (_n) * 4)
#define MTK_WED_WDMA_RX_PROCESSED_MIB(_n) (0xaf0 + (_n) * 4)
@@ -2469,7 +2468,7 @@
#define MTK_WED_RING_OFS_BASE 0x00
#define MTK_WED_RING_OFS_COUNT 0x04
#define MTK_WED_RING_OFS_CPU_IDX 0x08
-@@ -331,12 +392,13 @@ struct mtk_wdma_desc {
+@@ -330,12 +391,13 @@ struct mtk_wdma_desc {
#define MTK_WDMA_GLO_CFG 0x204
#define MTK_WDMA_GLO_CFG_TX_DMA_EN BIT(0)
@@ -2484,7 +2483,7 @@
#define MTK_WDMA_RESET_IDX 0x208
#define MTK_WDMA_RESET_IDX_TX GENMASK(3, 0)
#define MTK_WDMA_RESET_IDX_RX GENMASK(17, 16)
-@@ -360,4 +422,70 @@ struct mtk_wdma_desc {
+@@ -359,4 +421,70 @@ struct mtk_wdma_desc {
/* DMA channel mapping */
#define HIFSYS_DMA_AG_MAP 0x008
diff --git a/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3011-add-wed-ser-support.patch b/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3009-add-wed-ser-support.patch
old mode 100755
new mode 100644
similarity index 97%
rename from autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3011-add-wed-ser-support.patch
rename to autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3009-add-wed-ser-support.patch
index 0d6a50f..c53746f
--- a/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3011-add-wed-ser-support.patch
+++ b/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3009-add-wed-ser-support.patch
@@ -1,9 +1,8 @@
-From f70e83ccdca85840c3bf9e7a31fb871a12724dc2 Mon Sep 17 00:00:00 2001
+From de9cc10d4e2d5aad4801dc92fb37c42478a4ab68 Mon Sep 17 00:00:00 2001
From: Sujuan Chen <sujuan.chen@mediatek.com>
-Date: Thu, 28 Jul 2022 14:49:16 +0800
-Subject: [PATCH 3/3] add wed ser support
+Date: Mon, 18 Sep 2023 11:05:45 +0800
+Subject: [PATCH 10/22] add-wed-ser-support
-Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
---
drivers/net/ethernet/mediatek/mtk_eth_soc.c | 8 +
drivers/net/ethernet/mediatek/mtk_wed.c | 361 ++++++++++++++-----
@@ -13,10 +12,10 @@
5 files changed, 320 insertions(+), 99 deletions(-)
diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-index 2b52fa0..2f98525 100644
+index 2cab49a..c1399c5 100644
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -3680,6 +3680,9 @@ static void mtk_pending_work(struct work_struct *work)
+@@ -4158,6 +4158,9 @@ static void mtk_pending_work(struct work_struct *work)
for (i = 0; i < MTK_MAC_COUNT; i++) {
if (!eth->netdev[i])
continue;
@@ -26,15 +25,15 @@
if (mtk_reset_flag == MTK_FE_STOP_TRAFFIC) {
pr_info("send MTK_FE_STOP_TRAFFIC event\n");
call_netdevice_notifiers(MTK_FE_STOP_TRAFFIC,
-@@ -3693,6 +3696,7 @@ static void mtk_pending_work(struct work_struct *work)
- if (!wait_for_completion_timeout(&wait_ser_done, 3000))
+@@ -4183,6 +4186,7 @@ static void mtk_pending_work(struct work_struct *work)
pr_warn("wait for MTK_FE_START_RESET\n");
+ }
rtnl_lock();
+#endif
break;
}
-@@ -3731,6 +3735,9 @@ static void mtk_pending_work(struct work_struct *work)
+@@ -4221,6 +4225,9 @@ static void mtk_pending_work(struct work_struct *work)
for (i = 0; i < MTK_MAC_COUNT; i++) {
if (!eth->netdev[i])
continue;
@@ -44,7 +43,7 @@
if (mtk_reset_flag == MTK_FE_STOP_TRAFFIC) {
pr_info("send MTK_FE_START_TRAFFIC event\n");
call_netdevice_notifiers(MTK_FE_START_TRAFFIC,
-@@ -3740,6 +3747,7 @@ static void mtk_pending_work(struct work_struct *work)
+@@ -4230,6 +4237,7 @@ static void mtk_pending_work(struct work_struct *work)
call_netdevice_notifiers(MTK_FE_RESET_DONE,
eth->netdev[i]);
}
@@ -53,7 +52,7 @@
eth->netdev[i]);
break;
diff --git a/drivers/net/ethernet/mediatek/mtk_wed.c b/drivers/net/ethernet/mediatek/mtk_wed.c
-index ff8f658..0917a5a 100644
+index 4b2f1a2..ae31412 100644
--- a/drivers/net/ethernet/mediatek/mtk_wed.c
+++ b/drivers/net/ethernet/mediatek/mtk_wed.c
@@ -13,8 +13,10 @@
@@ -613,7 +612,7 @@
if (dev->ver == MTK_WED_V1)
regmap_update_bits(hw->hifsys, HIFSYS_DMA_AG_MAP,
BIT(hw->index), 0);
-@@ -1374,7 +1549,8 @@ out:
+@@ -1374,7 +1549,8 @@ mtk_wed_attach(struct mtk_wed_device *dev)
}
static int
@@ -706,7 +705,7 @@
#ifdef CONFIG_DEBUG_FS
diff --git a/drivers/net/ethernet/mediatek/mtk_wed_regs.h b/drivers/net/ethernet/mediatek/mtk_wed_regs.h
-index 9d021e2..cfcd94f 100644
+index 31871f7..403a36b 100644
--- a/drivers/net/ethernet/mediatek/mtk_wed_regs.h
+++ b/drivers/net/ethernet/mediatek/mtk_wed_regs.h
@@ -38,11 +38,15 @@ struct mtk_wdma_desc {
@@ -725,7 +724,7 @@
#define MTK_WED_RESET_WDMA_RX_DRV BIT(17)
#define MTK_WED_RESET_WDMA_INT_AGENT BIT(19)
#define MTK_WED_RESET_RX_RRO_QM BIT(20)
-@@ -186,7 +190,12 @@ struct mtk_wdma_desc {
+@@ -185,7 +189,12 @@ struct mtk_wdma_desc {
#define MTK_WED_RESET_IDX 0x20c
#define MTK_WED_RESET_IDX_TX GENMASK(3, 0)
@@ -738,7 +737,7 @@
#define MTK_WED_TX_MIB(_n) (0x2a0 + (_n) * 4)
#define MTK_WED_RX_MIB(_n) (0x2e0 + (_n) * 4)
-@@ -300,6 +309,9 @@ struct mtk_wdma_desc {
+@@ -299,6 +308,9 @@ struct mtk_wdma_desc {
#define MTK_WED_WPDMA_RX_D_GLO_CFG 0x75c
#define MTK_WED_WPDMA_RX_D_RX_DRV_EN BIT(0)
diff --git a/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3012-ethernet-update-ppe-backward-compatible-two-way-hash.patch b/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3010-ethernet-update-ppe-backward-compatible-two-way-hash.patch
old mode 100755
new mode 100644
similarity index 75%
rename from autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3012-ethernet-update-ppe-backward-compatible-two-way-hash.patch
rename to autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3010-ethernet-update-ppe-backward-compatible-two-way-hash.patch
index 338939e..b547328
--- a/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3012-ethernet-update-ppe-backward-compatible-two-way-hash.patch
+++ b/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3010-ethernet-update-ppe-backward-compatible-two-way-hash.patch
@@ -1,8 +1,20 @@
+From 84fd451dd7379943e6957e9ceb749be4d6c41540 Mon Sep 17 00:00:00 2001
+From: Bc-bocun Chen <bc-bocun.chen@mediatek.com>
+Date: Mon, 18 Sep 2023 11:07:14 +0800
+Subject: [PATCH 11/22] ethernet-update-ppe-backward-compatible-two-way-hash
+
+---
+ drivers/net/ethernet/mediatek/mtk_eth_soc.c | 10 ++++++++-
+ drivers/net/ethernet/mediatek/mtk_eth_soc.h | 1 +
+ drivers/net/ethernet/mediatek/mtk_ppe.c | 24 ++++++++++++++-------
+ drivers/net/ethernet/mediatek/mtk_ppe.h | 5 +++--
+ 4 files changed, 29 insertions(+), 11 deletions(-)
+
diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-index 2c54c9c..d3ba9eb 100644
+index c1399c5..bd622d3 100644
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -4442,7 +4442,8 @@ static int mtk_probe(struct platform_dev
+@@ -5252,7 +5252,8 @@ static int mtk_probe(struct platform_device *pdev)
for (i = 0; i < eth->ppe_num; i++) {
eth->ppe[i] = mtk_ppe_init(eth,
@@ -12,7 +24,7 @@
if (!eth->ppe[i]) {
err = -ENOMEM;
goto err_free_dev;
-@@ -4558,6 +4559,7 @@ static const struct mtk_soc_data mt2701_
+@@ -5359,6 +5360,7 @@ static const struct mtk_soc_data mt2701_data = {
.required_clks = MT7623_CLKS_BITMAP,
.required_pctl = true,
.has_sram = false,
@@ -20,7 +32,7 @@
.offload_version = 2,
.rss_num = 0,
.txrx = {
-@@ -4573,6 +4575,7 @@ static const struct mtk_soc_data mt7621_
+@@ -5377,6 +5379,7 @@ static const struct mtk_soc_data mt7621_data = {
.required_clks = MT7621_CLKS_BITMAP,
.required_pctl = false,
.has_sram = false,
@@ -28,7 +40,7 @@
.offload_version = 2,
.rss_num = 0,
.txrx = {
-@@ -4589,6 +4592,7 @@ static const struct mtk_soc_data mt7622_
+@@ -5396,6 +5399,7 @@ static const struct mtk_soc_data mt7622_data = {
.required_clks = MT7622_CLKS_BITMAP,
.required_pctl = false,
.has_sram = false,
@@ -36,7 +48,7 @@
.offload_version = 2,
.rss_num = 0,
.txrx = {
-@@ -4604,6 +4608,7 @@ static const struct mtk_soc_data mt7623_
+@@ -5414,6 +5418,7 @@ static const struct mtk_soc_data mt7623_data = {
.required_clks = MT7623_CLKS_BITMAP,
.required_pctl = true,
.has_sram = false,
@@ -44,7 +56,7 @@
.offload_version = 2,
.rss_num = 0,
.txrx = {
-@@ -4635,6 +4640,7 @@ static const struct mtk_soc_data mt7986_
+@@ -5451,6 +5456,7 @@ static const struct mtk_soc_data mt7986_data = {
.required_clks = MT7986_CLKS_BITMAP,
.required_pctl = false,
.has_sram = false,
@@ -52,7 +64,7 @@
.offload_version = 2,
.rss_num = 4,
.txrx = {
-@@ -4651,6 +4657,8 @@ static const struct mtk_soc_data mt7981_
+@@ -5470,6 +5476,8 @@ static const struct mtk_soc_data mt7981_data = {
.required_clks = MT7981_CLKS_BITMAP,
.required_pctl = false,
.has_sram = false,
@@ -62,19 +74,19 @@
.txrx = {
.txd_size = sizeof(struct mtk_tx_dma_v2),
diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.h b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
-index 4a69bd0..35a7543 100644
+index 960b979..68b8ab1 100644
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
-@@ -1472,6 +1472,7 @@ struct mtk_soc_data {
+@@ -1679,6 +1679,7 @@ struct mtk_soc_data {
u64 caps;
- u32 required_clks;
+ u64 required_clks;
bool required_pctl;
+ u8 hash_way;
u8 offload_version;
netdev_features_t hw_features;
bool has_sram;
diff --git a/drivers/net/ethernet/mediatek/mtk_ppe.c b/drivers/net/ethernet/mediatek/mtk_ppe.c
-index e4d50eb..918aa22 100755
+index 96c15b3..4da7e7a 100755
--- a/drivers/net/ethernet/mediatek/mtk_ppe.c
+++ b/drivers/net/ethernet/mediatek/mtk_ppe.c
@@ -88,7 +88,7 @@ static void mtk_ppe_cache_enable(struct mtk_ppe *ppe, bool enable)
@@ -95,7 +107,7 @@
hash &= MTK_PPE_ENTRIES - 1;
return hash;
-@@ -542,10 +542,10 @@ int mtk_foe_entry_commit(struct mtk_ppe *ppe, struct mtk_flow_entry *entry)
+@@ -557,10 +557,10 @@ int mtk_foe_entry_commit(struct mtk_ppe *ppe, struct mtk_flow_entry *entry)
if (type == MTK_PPE_PKT_TYPE_BRIDGE)
return mtk_foe_entry_commit_l2(ppe, entry);
@@ -108,7 +120,7 @@
spin_unlock_bh(&ppe_lock);
return 0;
-@@ -569,7 +569,7 @@ mtk_foe_entry_commit_subflow(struct mtk_ppe *ppe, struct mtk_flow_entry *entry,
+@@ -584,7 +584,7 @@ mtk_foe_entry_commit_subflow(struct mtk_ppe *ppe, struct mtk_flow_entry *entry,
flow_info->l2_data.base_flow = entry;
flow_info->type = MTK_FLOW_TYPE_L2_SUBFLOW;
flow_info->hash = hash;
@@ -117,7 +129,7 @@
hlist_add_head(&flow_info->l2_data.list, &entry->l2_flows);
hwe = &ppe->foe_table[hash];
-@@ -593,7 +593,7 @@ mtk_foe_entry_commit_subflow(struct mtk_ppe *ppe, struct mtk_flow_entry *entry,
+@@ -608,7 +608,7 @@ mtk_foe_entry_commit_subflow(struct mtk_ppe *ppe, struct mtk_flow_entry *entry,
void __mtk_ppe_check_skb(struct mtk_ppe *ppe, struct sk_buff *skb, u16 hash)
{
@@ -126,7 +138,7 @@
struct mtk_foe_entry *hwe = &ppe->foe_table[hash];
struct mtk_flow_entry *entry;
struct mtk_foe_bridge key = {};
-@@ -676,12 +676,12 @@ int mtk_foe_entry_idle_time(struct mtk_ppe *ppe, struct mtk_flow_entry *entry)
+@@ -695,12 +695,12 @@ int mtk_foe_entry_idle_time(struct mtk_ppe *ppe, struct mtk_flow_entry *entry)
return __mtk_foe_entry_idle_time(ppe, entry->data.ib1);
}
@@ -141,7 +153,7 @@
ppe = devm_kzalloc(dev, sizeof(*ppe), GFP_KERNEL);
if (!ppe)
-@@ -695,6 +696,7 @@ struct mtk_ppe *mtk_ppe_init(struct mtk_eth *eth, void __iomem *base, int versio
+@@ -715,6 +715,7 @@ struct mtk_ppe *mtk_ppe_init(struct mtk_eth *eth, void __iomem *base,
ppe->eth = eth;
ppe->dev = dev;
ppe->version = version;
@@ -149,7 +161,7 @@
ppe->id = id;
foe = dmam_alloc_coherent(ppe->dev, MTK_PPE_ENTRIES * sizeof(*foe),
-@@ -704,6 +706,13 @@ struct mtk_ppe *mtk_ppe_init(struct mtk_eth *eth, void __iomem *base, int versio
+@@ -724,6 +725,13 @@ struct mtk_ppe *mtk_ppe_init(struct mtk_eth *eth, void __iomem *base,
ppe->foe_table = foe;
@@ -164,10 +176,10 @@
}
diff --git a/drivers/net/ethernet/mediatek/mtk_ppe.h b/drivers/net/ethernet/mediatek/mtk_ppe.h
-index 21cc551..3d6928c 100644
+index 86bbac8..feb1a4a 100644
--- a/drivers/net/ethernet/mediatek/mtk_ppe.h
+++ b/drivers/net/ethernet/mediatek/mtk_ppe.h
-@@ -276,19 +276,20 @@ struct mtk_ppe {
+@@ -322,19 +322,20 @@ struct mtk_ppe {
void __iomem *base;
int version;
int id;
@@ -190,3 +202,6 @@
int mtk_ppe_start(struct mtk_ppe *ppe);
int mtk_ppe_stop(struct mtk_ppe *ppe);
+--
+2.18.0
+
diff --git a/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3013-flow-offload-add-mtkhnat-flow-accounting.patch b/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3011-flow-offload-add-mtkhnat-flow-accounting.patch
old mode 100755
new mode 100644
similarity index 82%
rename from autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3013-flow-offload-add-mtkhnat-flow-accounting.patch
rename to autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3011-flow-offload-add-mtkhnat-flow-accounting.patch
index b29a907..3699263
--- a/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3013-flow-offload-add-mtkhnat-flow-accounting.patch
+++ b/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3011-flow-offload-add-mtkhnat-flow-accounting.patch
@@ -1,8 +1,24 @@
+From 77bdae190ded4dfafa80dfaf04a77018e33e233c Mon Sep 17 00:00:00 2001
+From: Bc-bocun Chen <bc-bocun.chen@mediatek.com>
+Date: Mon, 18 Sep 2023 11:09:23 +0800
+Subject: [PATCH 12/22] flow-offload-add-mtkhnat-flow-accounting
+
+---
+ drivers/net/ethernet/mediatek/mtk_eth_soc.c | 11 +-
+ drivers/net/ethernet/mediatek/mtk_eth_soc.h | 1 +
+ drivers/net/ethernet/mediatek/mtk_ppe.c | 131 +++++++++++++++++-
+ drivers/net/ethernet/mediatek/mtk_ppe.h | 23 ++-
+ .../net/ethernet/mediatek/mtk_ppe_debugfs.c | 10 +-
+ .../net/ethernet/mediatek/mtk_ppe_offload.c | 7 +
+ drivers/net/ethernet/mediatek/mtk_ppe_regs.h | 14 ++
+ net/netfilter/xt_FLOWOFFLOAD.c | 2 +-
+ 8 files changed, 191 insertions(+), 8 deletions(-)
+
diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-index 4f53794..dc5d050 100644
+index bd622d3..9d8ce07 100644
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -3944,7 +3944,8 @@ static int mtk_probe(struct platform_device *pdev)
+@@ -5253,7 +5253,8 @@ static int mtk_probe(struct platform_device *pdev)
for (i = 0; i < eth->ppe_num; i++) {
eth->ppe[i] = mtk_ppe_init(eth,
eth->base + MTK_ETH_PPE_BASE + i * 0x400,
@@ -12,75 +28,75 @@
if (!eth->ppe[i]) {
err = -ENOMEM;
goto err_free_dev;
-@@ -4057,6 +4058,7 @@ static const struct mtk_soc_data mt2701_data = {
+@@ -5360,6 +5361,7 @@ static const struct mtk_soc_data mt2701_data = {
.required_clks = MT7623_CLKS_BITMAP,
.required_pctl = true,
.has_sram = false,
+ .has_accounting = false,
.hash_way = 2,
.offload_version = 2,
- .rss_num = 0,
-@@ -4073,6 +4075,7 @@ static const struct mtk_soc_data mt7621_data = {
+ .rss_num = 0,
+@@ -5379,6 +5381,7 @@ static const struct mtk_soc_data mt7621_data = {
.required_clks = MT7621_CLKS_BITMAP,
.required_pctl = false,
.has_sram = false,
+ .has_accounting = false,
.hash_way = 2,
.offload_version = 2,
- .rss_num = 0,
-@@ -4090,6 +4093,7 @@ static const struct mtk_soc_data mt7622_data = {
+ .rss_num = 0,
+@@ -5399,6 +5402,7 @@ static const struct mtk_soc_data mt7622_data = {
.required_clks = MT7622_CLKS_BITMAP,
.required_pctl = false,
.has_sram = false,
+ .has_accounting = true,
.hash_way = 2,
.offload_version = 2,
- .rss_num = 0,
-@@ -4106,6 +4110,7 @@ static const struct mtk_soc_data mt7623_data = {
+ .rss_num = 0,
+@@ -5418,6 +5422,7 @@ static const struct mtk_soc_data mt7623_data = {
.required_clks = MT7623_CLKS_BITMAP,
.required_pctl = true,
.has_sram = false,
+ .has_accounting = false,
.hash_way = 2,
.offload_version = 2,
- .rss_num = 0,
-@@ -4123,6 +4128,7 @@ static const struct mtk_soc_data mt7629_data = {
+ .rss_num = 0,
+@@ -5438,6 +5443,7 @@ static const struct mtk_soc_data mt7629_data = {
.required_clks = MT7629_CLKS_BITMAP,
.required_pctl = false,
.has_sram = false,
+ .has_accounting = true,
- .rss_num = 0,
+ .rss_num = 0,
.txrx = {
.txd_size = sizeof(struct mtk_tx_dma),
-@@ -4138,6 +4144,7 @@ static const struct mtk_soc_data mt7986_data = {
+@@ -5456,6 +5462,7 @@ static const struct mtk_soc_data mt7986_data = {
.required_clks = MT7986_CLKS_BITMAP,
.required_pctl = false,
.has_sram = false,
+ .has_accounting = true,
.hash_way = 4,
.offload_version = 2,
- .rss_num = 0,
-@@ -4155,6 +4162,7 @@ static const struct mtk_soc_data mt7981_data = {
+ .rss_num = 4,
+@@ -5476,6 +5483,7 @@ static const struct mtk_soc_data mt7981_data = {
.required_clks = MT7981_CLKS_BITMAP,
.required_pctl = false,
.has_sram = false,
+ .has_accounting = true,
.hash_way = 4,
.offload_version = 2,
- .rss_num = 0,
-@@ -4171,6 +4179,7 @@ static const struct mtk_soc_data rt5350_data = {
+ .rss_num = 4,
+@@ -5513,6 +5521,7 @@ static const struct mtk_soc_data rt5350_data = {
.required_clks = MT7628_CLKS_BITMAP,
.required_pctl = false,
.has_sram = false,
+ .has_accounting = false,
- .rss_num = 0,
+ .rss_num = 0,
.txrx = {
.txd_size = sizeof(struct mtk_tx_dma),
diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.h b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
-index f659633..5e16fa8 100644
+index 68b8ab1..101c233 100644
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
-@@ -1213,6 +1213,7 @@ struct mtk_soc_data {
+@@ -1683,6 +1683,7 @@ struct mtk_soc_data {
u8 offload_version;
netdev_features_t hw_features;
bool has_sram;
@@ -89,7 +105,7 @@
u32 txd_size;
u32 rxd_size;
diff --git a/drivers/net/ethernet/mediatek/mtk_ppe.c b/drivers/net/ethernet/mediatek/mtk_ppe.c
-index 918aa22..8c036cd 100755
+index 4da7e7a..f55a95c 100755
--- a/drivers/net/ethernet/mediatek/mtk_ppe.c
+++ b/drivers/net/ethernet/mediatek/mtk_ppe.c
@@ -74,6 +74,46 @@ static int mtk_ppe_wait_busy(struct mtk_ppe *ppe)
@@ -139,7 +155,7 @@
static void mtk_ppe_cache_clear(struct mtk_ppe *ppe)
{
ppe_set(ppe, MTK_PPE_CACHE_CTL, MTK_PPE_CACHE_CTL_CLEAR);
-@@ -412,7 +452,19 @@ __mtk_foe_entry_clear(struct mtk_ppe *ppe, struct mtk_flow_entry *entry)
+@@ -426,6 +466,18 @@ __mtk_foe_entry_clear(struct mtk_ppe *ppe, struct mtk_flow_entry *entry)
MTK_FOE_STATE_INVALID);
dma_wmb();
mtk_ppe_cache_clear(ppe);
@@ -155,11 +171,10 @@
+ acct_updated->packets = 0;
+ acct_updated->bytes = 0;
+ }
- }
+ }
entry->hash = 0xffff;
- if (entry->type != MTK_FLOW_TYPE_L2_SUBFLOW)
-@@ -513,6 +560,16 @@ __mtk_foe_entry_commit(struct mtk_ppe *ppe, struct mtk_foe_entry *entry,
+@@ -528,6 +580,16 @@ __mtk_foe_entry_commit(struct mtk_ppe *ppe, struct mtk_foe_entry *entry,
wmb();
hwe->ib1 = entry->ib1;
@@ -176,7 +191,7 @@
dma_wmb();
mtk_ppe_cache_clear(ppe);
-@@ -618,8 +675,6 @@ void __mtk_ppe_check_skb(struct mtk_ppe *ppe, struct sk_buff *skb, u16 hash)
+@@ -637,8 +699,6 @@ void __mtk_ppe_check_skb(struct mtk_ppe *ppe, struct sk_buff *skb, u16 hash)
}
if (found || !mtk_flow_entry_match(entry, hwe)) {
@@ -185,7 +200,7 @@
continue;
}
-@@ -676,12 +731,44 @@ int mtk_foe_entry_idle_time(struct mtk_ppe *ppe, struct mtk_flow_entry *entry)
+@@ -695,12 +755,44 @@ int mtk_foe_entry_idle_time(struct mtk_ppe *ppe, struct mtk_flow_entry *entry)
return __mtk_foe_entry_idle_time(ppe, entry->data.ib1);
}
@@ -231,7 +246,7 @@
ppe = devm_kzalloc(dev, sizeof(*ppe), GFP_KERNEL);
if (!ppe)
-@@ -698,6 +781,7 @@ struct mtk_ppe *mtk_ppe_init(struct mtk_eth *eth, void __iomem *base, int versio
+@@ -717,6 +809,7 @@ struct mtk_ppe *mtk_ppe_init(struct mtk_eth *eth, void __iomem *base, int versio
ppe->version = version;
ppe->way = way;
ppe->id = id;
@@ -239,7 +254,7 @@
foe = dmam_alloc_coherent(ppe->dev, MTK_PPE_ENTRIES * sizeof(*foe),
&ppe->foe_phys, GFP_KERNEL);
-@@ -713,6 +797,31 @@ struct mtk_ppe *mtk_ppe_init(struct mtk_eth *eth, void __iomem *base, int versio
+@@ -732,6 +825,31 @@ struct mtk_ppe *mtk_ppe_init(struct mtk_eth *eth, void __iomem *base, int versio
ppe->foe_flow = flow;
@@ -271,9 +286,9 @@
return ppe;
}
-@@ -811,6 +949,13 @@ int mtk_ppe_start(struct mtk_ppe *ppe)
- ppe_w32(ppe, MTK_PPE_DEFAULT_CPU_PORT1, 0xcb777);
+@@ -834,6 +952,13 @@ int mtk_ppe_start(struct mtk_ppe *ppe)
ppe_w32(ppe, MTK_PPE_SBW_CTRL, 0x7f);
+ #endif
+ if (ppe->accounting && ppe->mib_phys) {
+ ppe_w32(ppe, MTK_PPE_MIB_TB_BASE, ppe->mib_phys);
@@ -286,10 +301,10 @@
}
diff --git a/drivers/net/ethernet/mediatek/mtk_ppe.h b/drivers/net/ethernet/mediatek/mtk_ppe.h
-index 3d6928c..8076e5d 100644
+index feb1a4a..86288b0 100644
--- a/drivers/net/ethernet/mediatek/mtk_ppe.h
+++ b/drivers/net/ethernet/mediatek/mtk_ppe.h
-@@ -270,6 +270,20 @@ struct mtk_flow_entry {
+@@ -316,6 +316,20 @@ struct mtk_flow_entry {
unsigned long cookie;
};
@@ -310,7 +325,7 @@
struct mtk_ppe {
struct mtk_eth *eth;
struct device *dev;
-@@ -277,10 +291,14 @@ struct mtk_ppe {
+@@ -323,19 +337,25 @@ struct mtk_ppe {
int version;
int id;
int way;
@@ -325,7 +340,8 @@
u16 foe_check_time[MTK_PPE_ENTRIES];
struct hlist_head *foe_flow;
+ struct rhashtable l2_flows;
+
-@@ -289,7 +307,9 @@ struct mtk_ppe {
void *acct_table;
+ void *acct_updated_table;
};
@@ -336,7 +352,7 @@
int mtk_ppe_start(struct mtk_ppe *ppe);
int mtk_ppe_stop(struct mtk_ppe *ppe);
-@@ -340,5 +359,6 @@ int mtk_foe_entry_set_wdma(struct mtk_foe_entry *entry, int wdma_idx, int txq,
+@@ -386,5 +406,6 @@ int mtk_foe_entry_set_wdma(struct mtk_foe_entry *entry, int wdma_idx, int txq,
int mtk_foe_entry_commit(struct mtk_ppe *ppe, struct mtk_flow_entry *entry);
void mtk_foe_entry_clear(struct mtk_ppe *ppe, struct mtk_flow_entry *entry);
int mtk_foe_entry_idle_time(struct mtk_ppe *ppe, struct mtk_flow_entry *entry);
@@ -380,10 +396,10 @@
return 0;
diff --git a/drivers/net/ethernet/mediatek/mtk_ppe_offload.c b/drivers/net/ethernet/mediatek/mtk_ppe_offload.c
-index 2f7d76d..f258539 100755
+index f256607..b80f72d 100755
--- a/drivers/net/ethernet/mediatek/mtk_ppe_offload.c
+++ b/drivers/net/ethernet/mediatek/mtk_ppe_offload.c
-@@ -504,6 +504,7 @@ static int
+@@ -509,6 +509,7 @@ static int
mtk_flow_offload_stats(struct mtk_eth *eth, struct flow_cls_offload *f)
{
struct mtk_flow_entry *entry;
@@ -391,7 +407,7 @@
u32 idle;
int i;
-@@ -516,6 +517,12 @@ mtk_flow_offload_stats(struct mtk_eth *eth, struct flow_cls_offload *f)
+@@ -521,6 +522,12 @@ mtk_flow_offload_stats(struct mtk_eth *eth, struct flow_cls_offload *f)
idle = mtk_foe_entry_idle_time(eth->ppe[i], entry);
f->stats.lastused = jiffies - idle * HZ;
@@ -405,10 +421,10 @@
}
diff --git a/drivers/net/ethernet/mediatek/mtk_ppe_regs.h b/drivers/net/ethernet/mediatek/mtk_ppe_regs.h
-index d319f18..9eb7a0d 100644
+index d319f18..8d3ebe1 100644
--- a/drivers/net/ethernet/mediatek/mtk_ppe_regs.h
+++ b/drivers/net/ethernet/mediatek/mtk_ppe_regs.h
-@@ -145,6 +146,20 @@ enum {
+@@ -145,6 +145,20 @@ enum {
#define MTK_PPE_MIB_TB_BASE 0x338
@@ -430,10 +446,10 @@
#define MTK_PPE_MIB_CACHE_CTL_EN BIT(0)
#define MTK_PPE_MIB_CACHE_CTL_FLUSH BIT(2)
diff --git a/net/netfilter/xt_FLOWOFFLOAD.c b/net/netfilter/xt_FLOWOFFLOAD.c
-index 8547f4a..c175e4d 100644
+index 2cab008..1defb15 100644
--- a/net/netfilter/xt_FLOWOFFLOAD.c
+++ b/net/netfilter/xt_FLOWOFFLOAD.c
-@@ -700,12 +781,12 @@ static int __init xt_flowoffload_tg_init(void)
+@@ -766,7 +766,7 @@ static int __init xt_flowoffload_tg_init(void)
if (ret)
goto cleanup;
@@ -442,8 +458,6 @@
ret = xt_register_target(&offload_tg_reg);
if (ret)
- goto cleanup2;
-
- return 0;
-
- cleanup2:
+--
+2.18.0
+
diff --git a/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3014-flow-offload-add-mtkhnat-qdma-qos.patch b/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3012-flow-offload-add-mtkhnat-qdma-qos.patch
similarity index 95%
rename from autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3014-flow-offload-add-mtkhnat-qdma-qos.patch
rename to autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3012-flow-offload-add-mtkhnat-qdma-qos.patch
index 74a937e..062dace 100644
--- a/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3014-flow-offload-add-mtkhnat-qdma-qos.patch
+++ b/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3012-flow-offload-add-mtkhnat-qdma-qos.patch
@@ -1,7 +1,7 @@
-From e2277f2ea6c9657b727b082f7baa967ef94861dc Mon Sep 17 00:00:00 2001
-From: Bo-Cun Chen <bc-bocun.chen@mediatek.com>
-Date: Sat, 26 Aug 2023 00:38:09 +0800
-Subject: [PATCH] 999-3014-flow-offload-add-mtkhnat-qdma-qos
+From 9e21d6fa97e93cb2ba9b923810666ddaf7a981ee Mon Sep 17 00:00:00 2001
+From: Bc-bocun Chen <bc-bocun.chen@mediatek.com>
+Date: Mon, 18 Sep 2023 11:11:03 +0800
+Subject: [PATCH 13/22] flow-offload-add-mtkhnat-qdma-qos
---
drivers/net/ethernet/mediatek/Makefile | 2 +-
@@ -30,10 +30,10 @@
ifdef CONFIG_DEBUG_FS
mtk_eth-$(CONFIG_NET_MEDIATEK_SOC_WED) += mtk_wed_debugfs.o
diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-index 9102144..a370547 100644
+index 9d8ce07..0f6613b 100644
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -5085,6 +5085,8 @@ static int mtk_probe(struct platform_device *pdev)
+@@ -5266,6 +5266,8 @@ static int mtk_probe(struct platform_device *pdev)
}
mtk_ppe_debugfs_init(eth);
@@ -42,7 +42,7 @@
}
for (i = 0; i < MTK_MAX_DEVS; i++) {
-@@ -5197,6 +5199,7 @@ static const struct mtk_soc_data mt2701_data = {
+@@ -5371,6 +5373,7 @@ static const struct mtk_soc_data mt2701_data = {
.rx_dma_l4_valid = RX_DMA_L4_VALID,
.dma_max_len = MTK_TX_DMA_BUF_LEN,
.dma_len_offset = MTK_TX_DMA_BUF_SHIFT,
@@ -50,7 +50,7 @@
},
};
-@@ -5217,6 +5220,7 @@ static const struct mtk_soc_data mt7621_data = {
+@@ -5391,6 +5394,7 @@ static const struct mtk_soc_data mt7621_data = {
.rxd_size = sizeof(struct mtk_rx_dma),
.dma_max_len = MTK_TX_DMA_BUF_LEN,
.dma_len_offset = MTK_TX_DMA_BUF_SHIFT,
@@ -58,7 +58,7 @@
},
};
-@@ -5238,6 +5242,7 @@ static const struct mtk_soc_data mt7622_data = {
+@@ -5412,6 +5416,7 @@ static const struct mtk_soc_data mt7622_data = {
.rx_dma_l4_valid = RX_DMA_L4_VALID,
.dma_max_len = MTK_TX_DMA_BUF_LEN,
.dma_len_offset = MTK_TX_DMA_BUF_SHIFT,
@@ -66,7 +66,7 @@
},
};
-@@ -5258,6 +5263,7 @@ static const struct mtk_soc_data mt7623_data = {
+@@ -5432,6 +5437,7 @@ static const struct mtk_soc_data mt7623_data = {
.rx_dma_l4_valid = RX_DMA_L4_VALID,
.dma_max_len = MTK_TX_DMA_BUF_LEN,
.dma_len_offset = MTK_TX_DMA_BUF_SHIFT,
@@ -74,7 +74,7 @@
},
};
-@@ -5298,6 +5304,7 @@ static const struct mtk_soc_data mt7986_data = {
+@@ -5472,6 +5478,7 @@ static const struct mtk_soc_data mt7986_data = {
.rx_dma_l4_valid = RX_DMA_L4_VALID_V2,
.dma_max_len = MTK_TX_DMA_BUF_LEN_V2,
.dma_len_offset = MTK_TX_DMA_BUF_SHIFT_V2,
@@ -82,7 +82,7 @@
},
};
-@@ -5319,6 +5326,7 @@ static const struct mtk_soc_data mt7981_data = {
+@@ -5493,6 +5500,7 @@ static const struct mtk_soc_data mt7981_data = {
.rx_dma_l4_valid = RX_DMA_L4_VALID_V2,
.dma_max_len = MTK_TX_DMA_BUF_LEN_V2,
.dma_len_offset = MTK_TX_DMA_BUF_SHIFT_V2,
@@ -90,7 +90,7 @@
},
};
-@@ -5337,6 +5345,7 @@ static const struct mtk_soc_data mt7988_data = {
+@@ -5511,6 +5519,7 @@ static const struct mtk_soc_data mt7988_data = {
.rx_dma_l4_valid = RX_DMA_L4_VALID_V2,
.dma_max_len = MTK_TX_DMA_BUF_LEN_V2,
.dma_len_offset = MTK_TX_DMA_BUF_SHIFT_V2,
@@ -98,7 +98,7 @@
},
};
-@@ -5355,6 +5364,7 @@ static const struct mtk_soc_data rt5350_data = {
+@@ -5529,6 +5538,7 @@ static const struct mtk_soc_data rt5350_data = {
.rx_dma_l4_valid = RX_DMA_L4_VALID_PDMA,
.dma_max_len = MTK_TX_DMA_BUF_LEN,
.dma_len_offset = MTK_TX_DMA_BUF_SHIFT,
@@ -107,10 +107,10 @@
};
diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.h b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
-index db139a1..a7892e2 100644
+index 101c233..7ea380e 100644
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
-@@ -398,10 +398,21 @@
+@@ -400,10 +400,21 @@
/* QDMA TX Queue Configuration Registers */
#define MTK_QTX_CFG(x) (QDMA_BASE + (x * 0x10))
@@ -132,7 +132,7 @@
/* QDMA RX Base Pointer Register */
#define MTK_QRX_BASE_PTR0 (QDMA_BASE + 0x100)
-@@ -419,7 +430,9 @@
+@@ -421,7 +432,9 @@
#define MTK_QRX_DRX_IDX0 (QDMA_BASE + 0x10c)
/* QDMA Page Configuration Register */
@@ -143,7 +143,7 @@
/* QDMA Global Configuration Register */
#define MTK_QDMA_GLO_CFG (QDMA_BASE + 0x204)
-@@ -456,6 +469,9 @@
+@@ -458,6 +471,9 @@
#define FC_THRES_DROP_EN (7 << 16)
#define FC_THRES_MIN 0x4444
@@ -153,7 +153,7 @@
/* QDMA Interrupt Status Register */
#define MTK_QDMA_INT_STATUS (QDMA_BASE + 0x218)
#if defined(CONFIG_MEDIATEK_NETSYS_RX_V2) || defined(CONFIG_MEDIATEK_NETSYS_V3)
-@@ -492,6 +508,11 @@
+@@ -494,6 +510,11 @@
/* QDMA Interrupt Mask Register */
#define MTK_QDMA_HRED2 (QDMA_BASE + 0x244)
@@ -165,7 +165,7 @@
/* QDMA TX Forward CPU Pointer Register */
#define MTK_QTX_CTX_PTR (QDMA_BASE +0x300)
-@@ -519,6 +540,14 @@
+@@ -521,6 +542,14 @@
/* QDMA FQ Free Page Buffer Length Register */
#define MTK_QDMA_FQ_BLEN (QDMA_BASE +0x32c)
@@ -180,7 +180,7 @@
/* WDMA Registers */
#define MTK_WDMA_CTX_PTR(x) (WDMA_BASE(x) + 0x8)
#define MTK_WDMA_DTX_PTR(x) (WDMA_BASE(x) + 0xC)
-@@ -1682,6 +1711,7 @@ struct mtk_soc_data {
+@@ -1690,6 +1719,7 @@ struct mtk_soc_data {
u32 rx_dma_l4_valid;
u32 dma_max_len;
u32 dma_len_offset;
@@ -188,7 +188,7 @@
} txrx;
};
-@@ -1868,6 +1898,7 @@ struct mtk_eth {
+@@ -1879,6 +1909,7 @@ struct mtk_eth {
spinlock_t syscfg0_lock;
struct timer_list mtk_dma_monitor_timer;
@@ -196,7 +196,7 @@
u8 ppe_num;
struct mtk_ppe *ppe[MTK_MAX_PPE_NUM];
struct rhashtable flow_table;
-@@ -1906,6 +1937,34 @@ extern const struct of_device_id of_mtk_match[];
+@@ -1936,6 +1967,34 @@ extern const struct of_device_id of_mtk_match[];
extern u32 mtk_hwlro_stats_ebl;
extern u32 dbg_show_level;
@@ -231,7 +231,7 @@
/* read the hardware status register */
void mtk_stats_update_mac(struct mtk_mac *mac);
-@@ -1938,4 +1997,6 @@ void mtk_eth_set_dma_device(struct mtk_eth *eth, struct device *dma_dev);
+@@ -1969,4 +2028,6 @@ void mtk_eth_set_dma_device(struct mtk_eth *eth, struct device *dma_dev);
u32 mtk_rss_indr_table(struct mtk_rss_params *rss_params, int index);
int mtk_ppe_debugfs_init(struct mtk_eth *eth);
@@ -239,7 +239,7 @@
+int mtk_qdma_debugfs_init(struct mtk_eth *eth);
#endif /* MTK_ETH_H */
diff --git a/drivers/net/ethernet/mediatek/mtk_ppe.c b/drivers/net/ethernet/mediatek/mtk_ppe.c
-index 107f5a1..0d4ae28 100755
+index f55a95c..6d6c1e4 100755
--- a/drivers/net/ethernet/mediatek/mtk_ppe.c
+++ b/drivers/net/ethernet/mediatek/mtk_ppe.c
@@ -128,7 +128,7 @@ static void mtk_ppe_cache_enable(struct mtk_ppe *ppe, bool enable)
diff --git a/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3015-flow-offload-ovs-support.patch b/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3013-flow-offload-ovs-support.patch
old mode 100755
new mode 100644
similarity index 75%
rename from autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3015-flow-offload-ovs-support.patch
rename to autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3013-flow-offload-ovs-support.patch
index 04e22a4..a164d1a
--- a/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3015-flow-offload-ovs-support.patch
+++ b/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3013-flow-offload-ovs-support.patch
@@ -1,11 +1,20 @@
-Index: net/openvswitch/vport-internal_dev.c
-===================================================================
+From 842a435bd21807447504a387e5ebb8071b0db93f Mon Sep 17 00:00:00 2001
+From: Evelyn Tsai <evelyn.tsai@mediatek.com>
+Date: Mon, 18 Sep 2023 11:11:41 +0800
+Subject: [PATCH 14/22] flow-offload-ovs-support
+
+---
+ net/openvswitch/vport-internal_dev.c | 46 ++++++++++++++++++++++++++++
+ 1 file changed, 46 insertions(+)
+
+diff --git a/net/openvswitch/vport-internal_dev.c b/net/openvswitch/vport-internal_dev.c
+index 58a7b83..8475727 100644
--- a/net/openvswitch/vport-internal_dev.c
+++ b/net/openvswitch/vport-internal_dev.c
-@@ -113,12 +113,58 @@ internal_get_stats(struct net_device *de
+@@ -113,12 +113,58 @@ internal_get_stats(struct net_device *dev, struct rtnl_link_stats64 *stats)
}
}
-
+
+static int internal_dev_fill_forward_path(struct net_device_path_ctx *ctx, struct net_device_path *path)
+{
+ struct vport *vport;
@@ -59,5 +68,8 @@
.ndo_get_stats64 = internal_get_stats,
+ .ndo_fill_forward_path = internal_dev_fill_forward_path,
};
-
+
static struct rtnl_link_ops internal_dev_link_ops __read_mostly = {
+--
+2.18.0
+
diff --git a/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3016-update-net-bridge-for-bridger.patch b/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3014-update-net-bridge-for-bridger.patch
old mode 100755
new mode 100644
similarity index 98%
rename from autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3016-update-net-bridge-for-bridger.patch
rename to autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3014-update-net-bridge-for-bridger.patch
index 6fe3733..b01d689
--- a/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3016-update-net-bridge-for-bridger.patch
+++ b/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3014-update-net-bridge-for-bridger.patch
@@ -1,3 +1,23 @@
+From 120baca4e8b019d03c8d1a29012cea911629247a Mon Sep 17 00:00:00 2001
+From: Bc-bocun Chen <bc-bocun.chen@mediatek.com>
+Date: Mon, 18 Sep 2023 11:13:51 +0800
+Subject: [PATCH 15/22] update-net-bridge-for-bridger
+
+---
+ include/net/switchdev.h | 2 +
+ net/bridge/Makefile | 2 +-
+ net/bridge/br_mdb.c | 32 +-
+ net/bridge/br_netlink.c | 6 +-
+ net/bridge/br_netlink_tunnel.c | 4 +-
+ net/bridge/br_private.h | 293 +++++++++++++-
+ net/bridge/br_private_tunnel.h | 4 +
+ net/bridge/br_vlan.c | 698 +++++++++++++++++++++++++++++++--
+ net/bridge/br_vlan_options.c | 346 ++++++++++++++++
+ net/core/rtnetlink.c | 1 +
+ net/dsa/slave.c | 11 +
+ 11 files changed, 1365 insertions(+), 34 deletions(-)
+ create mode 100644 net/bridge/br_vlan_options.c
+
diff --git a/include/net/switchdev.h b/include/net/switchdev.h
index 191dc34..d4d71d9 100644
--- a/include/net/switchdev.h
@@ -1786,10 +1806,10 @@
+ return false;
+}
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
-index dbc9b2f..706b207 100644
+index da1ef00..b896f71 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
-@@ -1996,6 +1996,7 @@ static int rtnl_dump_ifinfo(struct sk_buff *skb, struct netlink_callback *cb)
+@@ -1998,6 +1998,7 @@ static int rtnl_dump_ifinfo(struct sk_buff *skb, struct netlink_callback *cb)
goto cont;
if (idx < s_idx)
goto cont;
@@ -1821,3 +1841,6 @@
out_phy:
rtnl_lock();
phylink_disconnect_phy(p->dp->pl);
+--
+2.18.0
+
diff --git a/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3017-ethernet-update-ppe-from-mt7986-to-mt7988.patch b/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3015-ethernet-update-ppe-from-mt7986-to-mt7988.patch
old mode 100755
new mode 100644
similarity index 93%
rename from autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3017-ethernet-update-ppe-from-mt7986-to-mt7988.patch
rename to autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3015-ethernet-update-ppe-from-mt7986-to-mt7988.patch
index 872a279..036f531
--- a/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3017-ethernet-update-ppe-from-mt7986-to-mt7988.patch
+++ b/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3015-ethernet-update-ppe-from-mt7986-to-mt7988.patch
@@ -1,7 +1,7 @@
-From 06c3b8d434290affb720808a38315a78e94c9923 Mon Sep 17 00:00:00 2001
-From: Bo-Cun Chen <bc-bocun.chen@mediatek.com>
-Date: Sat, 26 Aug 2023 00:45:40 +0800
-Subject: [PATCH] 999-3017-ethernet-update-ppe-from-mt7986-to-mt7988
+From 6a91e5e7304b98d06b589de7f9f09cc34cb9c231 Mon Sep 17 00:00:00 2001
+From: Bc-bocun Chen <bc-bocun.chen@mediatek.com>
+Date: Mon, 18 Sep 2023 11:15:14 +0800
+Subject: [PATCH 16/22] ethernet-update-ppe-from-mt7986-to-mt7988
---
drivers/net/ethernet/mediatek/mtk_eth_soc.c | 14 ++++---
@@ -12,10 +12,10 @@
5 files changed, 64 insertions(+), 21 deletions(-)
diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-index a370547..239c25d 100644
+index 0f6613b..8bd526a 100644
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -2272,17 +2272,17 @@ static int mtk_poll_rx(struct napi_struct *napi, int budget,
+@@ -2286,17 +2286,17 @@ static int mtk_poll_rx(struct napi_struct *napi, int budget,
skb_checksum_none_assert(skb);
skb->protocol = eth_type_trans(skb, netdev);
@@ -37,7 +37,7 @@
reason = FIELD_GET(MTK_RXD5_PPE_CPU_REASON_V2, trxd.rxd5);
if (reason == MTK_PPE_CPU_REASON_HIT_UNBIND_RATE_REACHED) {
for (i = 0; i < eth->ppe_num; i++) {
-@@ -5071,7 +5071,8 @@ static int mtk_probe(struct platform_device *pdev)
+@@ -5252,7 +5252,8 @@ static int mtk_probe(struct platform_device *pdev)
for (i = 0; i < eth->ppe_num; i++) {
eth->ppe[i] = mtk_ppe_init(eth,
@@ -47,7 +47,7 @@
2, eth->soc->hash_way, i,
eth->soc->has_accounting);
if (!eth->ppe[i]) {
-@@ -5338,6 +5339,9 @@ static const struct mtk_soc_data mt7988_data = {
+@@ -5512,6 +5513,9 @@ static const struct mtk_soc_data mt7988_data = {
.required_clks = MT7988_CLKS_BITMAP,
.required_pctl = false,
.has_sram = true,
@@ -58,7 +58,7 @@
.txrx = {
.txd_size = sizeof(struct mtk_tx_dma_v2),
diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.h b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
-index a7892e2..cd19c8d 100644
+index 7ea380e..23c5f49 100644
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
@@ -130,9 +130,10 @@
@@ -73,7 +73,7 @@
#else
#define MTK_GDMA_TO_PPE0 0x4444
#endif
-@@ -1939,13 +1940,15 @@ extern u32 dbg_show_level;
+@@ -1969,13 +1970,15 @@ extern u32 dbg_show_level;
static inline void mtk_set_ib1_sp(struct mtk_eth *eth, struct mtk_foe_entry *foe, u32 val)
{
@@ -92,7 +92,7 @@
return 0;
diff --git a/drivers/net/ethernet/mediatek/mtk_ppe.c b/drivers/net/ethernet/mediatek/mtk_ppe.c
-index 0d4ae28..308d5a1 100755
+index 6d6c1e4..446acca 100755
--- a/drivers/net/ethernet/mediatek/mtk_ppe.c
+++ b/drivers/net/ethernet/mediatek/mtk_ppe.c
@@ -211,7 +211,7 @@ int mtk_foe_entry_prepare(struct mtk_foe_entry *entry, int type, int l4proto,
@@ -149,7 +149,7 @@
MTK_PPE_TB_CFG_INFO_SEL |
#endif
FIELD_PREP(MTK_PPE_TB_CFG_SEARCH_MISS,
-@@ -992,7 +1000,7 @@ int mtk_ppe_start(struct mtk_ppe *ppe)
+@@ -993,7 +1001,7 @@ int mtk_ppe_start(struct mtk_ppe *ppe)
ppe_w32(ppe, MTK_PPE_DEFAULT_CPU_PORT, 0);
diff --git a/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3018-mediatek-ethernet-add-wifi2wifi-offload-support.patch b/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3016-mediatek-ethernet-add-wifi2wifi-offload-support.patch
old mode 100755
new mode 100644
similarity index 86%
rename from autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3018-mediatek-ethernet-add-wifi2wifi-offload-support.patch
rename to autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3016-mediatek-ethernet-add-wifi2wifi-offload-support.patch
index c810ff1..121db94
--- a/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3018-mediatek-ethernet-add-wifi2wifi-offload-support.patch
+++ b/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3016-mediatek-ethernet-add-wifi2wifi-offload-support.patch
@@ -1,9 +1,8 @@
-From 4c8f0a38d9c2df3815ace32133bb63d8a4345856 Mon Sep 17 00:00:00 2001
+From d3183ad9ed0a8a35047a37f30d85f920a729897c Mon Sep 17 00:00:00 2001
From: Sujuan Chen <sujuan.chen@mediatek.com>
-Date: Tue, 27 Dec 2022 10:14:35 +0800
-Subject: [PATCH] mediatek: ethernet: add wifi2wifi offload support
+Date: Mon, 18 Sep 2023 11:16:18 +0800
+Subject: [PATCH 17/22] mediatek-ethernet-add-wifi2wifi-offload-support
-Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
---
drivers/net/ethernet/mediatek/mtk_eth_soc.h | 2 ++
.../net/ethernet/mediatek/mtk_ppe_offload.c | 35 +++++++++++++------
@@ -13,25 +12,25 @@
mode change 100755 => 100644 drivers/net/ethernet/mediatek/mtk_ppe_offload.c
diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.h b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
-index b935de6..acefa48 100644
+index 23c5f49..ee89b4c 100644
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
-@@ -1767,6 +1767,8 @@ void ethsys_reset(struct mtk_eth *eth, u32 reset_bits);
+@@ -2027,6 +2027,8 @@ void mtk_usxgmii_link_poll(struct work_struct *work);
int mtk_eth_offload_init(struct mtk_eth *eth, int id);
int mtk_eth_setup_tc(struct net_device *dev, enum tc_setup_type type,
void *type_data);
+int mtk_eth_setup_tc_block(struct net_device *dev, struct flow_block_offload *f,
+ struct mtk_eth *eth);
void mtk_eth_set_dma_device(struct mtk_eth *eth, struct device *dma_dev);
+ u32 mtk_rss_indr_table(struct mtk_rss_params *rss_params, int index);
- int mtk_ppe_debugfs_init(struct mtk_eth *eth);
diff --git a/drivers/net/ethernet/mediatek/mtk_ppe_offload.c b/drivers/net/ethernet/mediatek/mtk_ppe_offload.c
old mode 100755
new mode 100644
-index 2787a97..23d2048
+index f0c63da..c1cce76
--- a/drivers/net/ethernet/mediatek/mtk_ppe_offload.c
+++ b/drivers/net/ethernet/mediatek/mtk_ppe_offload.c
-@@ -546,10 +546,20 @@ static int
+@@ -563,10 +563,20 @@ static int
mtk_eth_setup_tc_block_cb(enum tc_setup_type type, void *type_data, void *cb_priv)
{
struct flow_cls_offload *cls = type_data;
@@ -56,7 +55,7 @@
if (!tc_can_offload(dev))
return -EOPNOTSUPP;
-@@ -577,14 +587,19 @@ mtk_eth_setup_tc_block_cb(enum tc_setup_type type, void *type_data, void *cb_pri
+@@ -594,16 +604,21 @@ mtk_eth_setup_tc_block_cb(enum tc_setup_type type, void *type_data, void *cb_pri
return err;
}
@@ -80,7 +79,9 @@
+ }
+
for (i = 0; i < eth->ppe_num; i++) {
-@@ -610,7 +625,7 @@ mtk_eth_setup_tc_block(struct net_device *dev, struct flow_block_offload *f)
+ if (!eth->ppe[i] || !eth->ppe[i]->foe_table)
+ return -EOPNOTSUPP;
+@@ -622,7 +637,7 @@ mtk_eth_setup_tc_block(struct net_device *dev, struct flow_block_offload *f)
flow_block_cb_incref(block_cb);
goto unlock;
}
@@ -89,7 +90,7 @@
if (IS_ERR(block_cb)) {
err = PTR_ERR(block_cb);
goto unlock;
-@@ -647,7 +662,7 @@ int mtk_eth_setup_tc(struct net_device *dev, enum tc_setup_type type,
+@@ -658,7 +673,7 @@ int mtk_eth_setup_tc(struct net_device *dev, enum tc_setup_type type,
switch (type) {
case TC_SETUP_BLOCK:
case TC_SETUP_FT:
@@ -99,10 +100,10 @@
return -EOPNOTSUPP;
}
diff --git a/drivers/net/ethernet/mediatek/mtk_wed.c b/drivers/net/ethernet/mediatek/mtk_wed.c
-index 1a615f2..37a86c3 100644
+index ae31412..3e760f7 100644
--- a/drivers/net/ethernet/mediatek/mtk_wed.c
+++ b/drivers/net/ethernet/mediatek/mtk_wed.c
-@@ -1731,6 +1731,18 @@ out:
+@@ -1733,6 +1733,18 @@ void mtk_wed_flow_remove(int index)
mutex_unlock(&hw_lock);
}
@@ -121,7 +122,7 @@
void mtk_wed_add_hw(struct device_node *np, struct mtk_eth *eth,
void __iomem *wdma, u32 wdma_phy, int index)
-@@ -1749,6 +1761,7 @@ void mtk_wed_add_hw(struct device_node *np, struct mtk_eth *eth,
+@@ -1751,6 +1763,7 @@ void mtk_wed_add_hw(struct device_node *np, struct mtk_eth *eth,
.irq_get = mtk_wed_irq_get,
.irq_set_mask = mtk_wed_irq_set_mask,
.detach = mtk_wed_detach,
diff --git a/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3019-flow-offload-add-mtkhnat-dscp.patch b/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3017-flow-offload-add-mtkhnat-dscp.patch
old mode 100755
new mode 100644
similarity index 94%
rename from autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3019-flow-offload-add-mtkhnat-dscp.patch
rename to autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3017-flow-offload-add-mtkhnat-dscp.patch
index a43261a..478a7a9
--- a/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3019-flow-offload-add-mtkhnat-dscp.patch
+++ b/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3017-flow-offload-add-mtkhnat-dscp.patch
@@ -1,7 +1,7 @@
-From 72dd3b798e3a08122e9a769d6f0197b0f357478e Mon Sep 17 00:00:00 2001
-From: Bo-Cun Chen <bc-bocun.chen@mediatek.com>
-Date: Wed, 23 Aug 2023 14:03:52 +0800
-Subject: [PATCH] 999-3019-flow-offload-add-mtkhnat-dscp
+From 3e4d44d8da90b9ba20abc5cec255d92b67e3fb00 Mon Sep 17 00:00:00 2001
+From: Bc-bocun Chen <bc-bocun.chen@mediatek.com>
+Date: Mon, 18 Sep 2023 11:17:24 +0800
+Subject: [PATCH 18/22] flow-offload-add-mtkhnat-dscp
---
drivers/net/ethernet/mediatek/mtk_ppe.c | 11 +++++++
@@ -13,7 +13,7 @@
6 files changed, 64 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mediatek/mtk_ppe.c b/drivers/net/ethernet/mediatek/mtk_ppe.c
-index 4c17a4e..2860e99 100755
+index 446acca..384e811 100755
--- a/drivers/net/ethernet/mediatek/mtk_ppe.c
+++ b/drivers/net/ethernet/mediatek/mtk_ppe.c
@@ -435,6 +435,17 @@ int mtk_foe_entry_set_qid(struct mtk_foe_entry *entry, int qid)
@@ -35,7 +35,7 @@
{
return !(entry->ib1 & MTK_FOE_IB1_STATIC) &&
diff --git a/drivers/net/ethernet/mediatek/mtk_ppe.h b/drivers/net/ethernet/mediatek/mtk_ppe.h
-index 4abed85..57251d3 100644
+index 5529d64..2a8b6ef 100644
--- a/drivers/net/ethernet/mediatek/mtk_ppe.h
+++ b/drivers/net/ethernet/mediatek/mtk_ppe.h
@@ -430,6 +430,7 @@ int mtk_foe_entry_set_pppoe(struct mtk_foe_entry *entry, int sid);
@@ -44,10 +44,10 @@
int mtk_foe_entry_set_qid(struct mtk_foe_entry *entry, int qid);
+int mtk_foe_entry_set_dscp(struct mtk_foe_entry *entry, int dscp);
bool mtk_foe_entry_match(struct mtk_foe_entry *entry, struct mtk_foe_entry *data);
+ int mtk_foe_entry_set_sp(struct mtk_ppe *ppe, struct mtk_foe_entry *entry);
int mtk_foe_entry_commit(struct mtk_ppe *ppe, struct mtk_flow_entry *entry);
- void mtk_foe_entry_clear(struct mtk_ppe *ppe, struct mtk_flow_entry *entry);
diff --git a/drivers/net/ethernet/mediatek/mtk_ppe_offload.c b/drivers/net/ethernet/mediatek/mtk_ppe_offload.c
-index 989b412..f89875d 100644
+index c1cce76..95174b7 100644
--- a/drivers/net/ethernet/mediatek/mtk_ppe_offload.c
+++ b/drivers/net/ethernet/mediatek/mtk_ppe_offload.c
@@ -262,6 +262,7 @@ mtk_flow_offload_replace(struct mtk_eth *eth, struct flow_cls_offload *f)
diff --git a/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3020-flow-offload-add-mtkhnat-netlink.patch b/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3018-flow-offload-add-mtkhnat-netlink.patch
old mode 100755
new mode 100644
similarity index 91%
rename from autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3020-flow-offload-add-mtkhnat-netlink.patch
rename to autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3018-flow-offload-add-mtkhnat-netlink.patch
index 3b9e863..3bb7e7a
--- a/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3020-flow-offload-add-mtkhnat-netlink.patch
+++ b/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3018-flow-offload-add-mtkhnat-netlink.patch
@@ -1,8 +1,23 @@
+From 6bda18f107acbf04f01c18ad5964be6f7404d3cf Mon Sep 17 00:00:00 2001
+From: Bc-bocun Chen <bc-bocun.chen@mediatek.com>
+Date: Mon, 18 Sep 2023 13:14:08 +0800
+Subject: [PATCH 19/22] flow-offload-add-mtkhnat-netlink
+
+---
+ include/net/netfilter/nf_flow_table.h | 1 +
+ include/uapi/linux/netfilter/nfnetlink.h | 3 +-
+ net/netfilter/Kconfig | 9 +
+ net/netfilter/Makefile | 1 +
+ net/netfilter/nf_flow_table_core.c | 23 +++
+ net/netfilter/nf_flow_table_netlink.c | 239 +++++++++++++++++++++++
+ 6 files changed, 275 insertions(+), 1 deletion(-)
+ create mode 100644 net/netfilter/nf_flow_table_netlink.c
+
diff --git a/include/net/netfilter/nf_flow_table.h b/include/net/netfilter/nf_flow_table.h
-index 8a84de3..1a23c03 100644
+index 97a277d..3490d90 100644
--- a/include/net/netfilter/nf_flow_table.h
+++ b/include/net/netfilter/nf_flow_table.h
-@@ -276,6 +276,7 @@ int nf_flow_table_init(struct nf_flowtable *flow_table);
+@@ -277,6 +277,7 @@ int nf_flow_table_init(struct nf_flowtable *flow_table);
void nf_flow_table_free(struct nf_flowtable *flow_table);
void flow_offload_teardown(struct flow_offload *flow);
@@ -57,7 +72,7 @@
# generic X tables
obj-$(CONFIG_NETFILTER_XTABLES) += x_tables.o xt_tcpudp.o
diff --git a/net/netfilter/nf_flow_table_core.c b/net/netfilter/nf_flow_table_core.c
-index 1036558..a0f52f6 100644
+index c3054af..fb06755 100644
--- a/net/netfilter/nf_flow_table_core.c
+++ b/net/netfilter/nf_flow_table_core.c
@@ -373,6 +373,29 @@ void flow_offload_teardown(struct flow_offload *flow)
@@ -335,3 +350,6 @@
+MODULE_LICENSE("GPL");
+module_init(ftnetlink_init);
+module_exit(ftnetlink_exit);
+--
+2.18.0
+