[][Refine Ethernet t-put bound for MT7981]

[Description]
Refactor and refine Ethernet t-put bound issue for MT7981.

This patch includes two major changes:
1. "Re-organize the mapping relationship between queue & sch"
   Currently, the sw data path is adjusted as below
      * CPU(eth0) --> QDMA queue0 --> QDMA sch0 --> GMAC1
      * CPU(eth1) --> QDMA queue8 --> QDMA sch1 --> GMAC2

2. "Disable bridge netfilter module by default"
   After mtkhnat module is loaded to system, mtkhnat init
   script will automatically disable bridge netfilter module
   in order to reduce high cpu usage.
   Then, whenever HQoS is activated, bridge netfilter module
   will be enabled to allow skb being marked. In that way,
   HQoS can properly operate as before.

If without this patch, there is a 1500M performance bound situation
on Ethernet LAN->WAN sw path.

[Release-log]
N/A

Change-Id: I5c4f78e33f449bc64ca17a071378976e21b59865
Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/5457061
diff --git a/feed/mtkhnat_util/files/mtkhnat b/feed/mtkhnat_util/files/mtkhnat
index ce3ef9a..1b2fbfd 100755
--- a/feed/mtkhnat_util/files/mtkhnat
+++ b/feed/mtkhnat_util/files/mtkhnat
@@ -10,11 +10,19 @@
 config_get sch0_bw global sch0_bw 100000
 config_get sch1_bw global sch1_bw 100000
 
+# disable bridge netfilter module to avoid high cpu usage
+echo 0 > /proc/sys/net/bridge/bridge-nf-call-arptables
+echo 0 > /proc/sys/net/bridge/bridge-nf-call-iptables
+echo 0 > /proc/sys/net/bridge/bridge-nf-call-ip6tables
+echo 0 > /proc/sys/net/bridge/bridge-nf-filter-pppoe-tagged
+echo 0 > /proc/sys/net/bridge/bridge-nf-filter-vlan-tagged
+echo 0 > /proc/sys/net/bridge/bridge-nf-pass-vlan-input-dev
+
 #if enable=0, disable qdma_sch & qdma_txq
 [ "${enable}" -eq 1 ] || {
 	echo 0 ${scheduling} ${sch0_bw} > /sys/kernel/debug/hnat/qdma_sch0
 	echo 0 ${scheduling} ${sch1_bw} > /sys/kernel/debug/hnat/qdma_sch1
-	echo 1 0 0 0 0 0 4 > /sys/kernel/debug/hnat/qdma_txq0
+	echo 0 0 0 0 0 0 4 > /sys/kernel/debug/hnat/qdma_txq0
 	for i in $(seq 1 $((txq_num - 1)))
 	do
 		echo 0 0 0 0 0 0 0 > /sys/kernel/debug/hnat/qdma_txq$i
@@ -30,10 +38,14 @@
 [ "${hqos}" -eq 1 ] || {
 	echo 0 ${scheduling} ${sch0_bw} > /sys/kernel/debug/hnat/qdma_sch0
 	echo 0 ${scheduling} ${sch1_bw} > /sys/kernel/debug/hnat/qdma_sch1
-	echo 1 0 0 0 0 0 4 > /sys/kernel/debug/hnat/qdma_txq0
-	for i in $(seq 1 $((txq_num - 1)))
+
+	for i in $(seq 0 $((txq_num - 1)))
 	do
-		echo 0 0 0 0 0 0 0 > /sys/kernel/debug/hnat/qdma_txq$i
+		if [ "${i}" -le $(((txq_num / 2) - 1)) ]; then
+			echo 0 0 0 0 0 0 4 > /sys/kernel/debug/hnat/qdma_txq$i
+		else
+			echo 1 0 0 0 0 0 4 > /sys/kernel/debug/hnat/qdma_txq$i
+		fi
 	done
 
 	exit 0
@@ -43,6 +55,10 @@
 echo 1 ${scheduling} ${sch0_bw} > /sys/kernel/debug/hnat/qdma_sch0
 echo 1 ${scheduling} ${sch1_bw} > /sys/kernel/debug/hnat/qdma_sch1
 
+# enable bridge netfilter module to allow skb being marked
+echo 1 > /proc/sys/net/bridge/bridge-nf-call-iptables
+echo 1 > /proc/sys/net/bridge/bridge-nf-call-ip6tables
+
 setup_queue() {
 	local queue_id queue_scheduler queue_minebl queue_maxebl
 	local queue_minrate queue_maxrate queue_resv minrate maxrate queue_weight
diff --git a/target/linux/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_hnat/hnat_debugfs.c b/target/linux/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_hnat/hnat_debugfs.c
index a7453af..17ab837 100644
--- a/target/linux/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_hnat/hnat_debugfs.c
+++ b/target/linux/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_hnat/hnat_debugfs.c
@@ -1774,10 +1774,9 @@
 	int resv;
 	int scheduler;
 	size_t size;
-	u32 qtx_sch;
+	u32 qtx_sch = 0;
 
 	cr_set_field(h->fe_base + QDMA_PAGE, QTX_CFG_PAGE, (id / NUM_OF_Q_PER_PAGE));
-	qtx_sch = readl(h->fe_base + QTX_SCH(id % NUM_OF_Q_PER_PAGE));
 	if (length >= sizeof(line))
 		return -EINVAL;
 
@@ -1800,7 +1799,6 @@
 		min_exp++;
 	}
 
-	qtx_sch &= 0x70000000;
 	if (hnat_priv->data->num_of_sch == 4)
 		qtx_sch |= (scheduler & 0x3) << 30;
 	else