[][MAC80211][hnat][Improve ETH to ETH performace in an unbalanced PHY rate test for mt7981/7986]

[Description]
Change patch to improve ETH to ETH performace in an unbalanced PHY
rate test for mt7981/7986

This patch would enable to dispatch the short packet into a higher
priority HQoS queue in PPPQ mode, which used to only enable in MT7988.

Without this patch, the performance of ETH to ETH cannot reach line rate
in an unbalanced PHY rate test for the mt7981/7986.

[Release-log]
N/A


Change-Id: I7fe14d1c2a975767311c3e281478f4933c65ff7d
Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/8829197
diff --git a/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3023-mtk-ppe-dispatch-short-packets-to-high-prio.patch b/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3023-mtk-ppe-dispatch-short-packets-to-high-prio.patch
index 92591a5..d0ad23e 100644
--- a/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3023-mtk-ppe-dispatch-short-packets-to-high-prio.patch
+++ b/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3023-mtk-ppe-dispatch-short-packets-to-high-prio.patch
@@ -9,22 +9,26 @@
  1 file changed, 27 insertions(+)
 
 diff --git a/drivers/net/ethernet/mediatek/mtk_ppe.c b/drivers/net/ethernet/mediatek/mtk_ppe.c
-index ae0acd5..84d9763 100644
+index ae0acd5..547b5a0 100644
 --- a/drivers/net/ethernet/mediatek/mtk_ppe.c
 +++ b/drivers/net/ethernet/mediatek/mtk_ppe.c
-@@ -451,6 +451,28 @@ int mtk_foe_entry_set_qid(struct mtk_foe_entry *entry, int qid)
+@@ -451,6 +451,31 @@ int mtk_foe_entry_set_qid(struct mtk_foe_entry *entry, int qid)
  	return 0;
  }
  
-+#if defined(CONFIG_MEDIATEK_NETSYS_V3)
 +void mtk_foe_entry_adjust_qid(struct mtk_ppe *ppe, struct mtk_flow_entry *entry)
 +{
 +	struct mtk_foe_mac_info *l2 = mtk_foe_entry_l2(&entry->data);
 +	u32 *ib2 = mtk_foe_entry_ib2(&entry->data);
 +	u8 qid;
 +
++#if defined(CONFIG_MEDIATEK_NETSYS_V3)
 +	if (l2->tport_id != 1)
 +		return;
++#else
++	if (!(*ib2 & MTK_FOE_IB2_PSE_QOS))
++		return;
++#endif
 +
 +	qid = FIELD_GET(MTK_FOE_IB2_QID, *ib2);
 +	/* To enhance performance in the unbalanced PHY rate test,
@@ -36,23 +40,19 @@
 +		*ib2 |= FIELD_PREP(MTK_FOE_IB2_QID, qid);
 +	}
 +}
-+#endif
 +
  int mtk_foe_entry_set_dscp(struct mtk_foe_entry *entry, int dscp)
  {
  	u32 *ib2 = mtk_foe_entry_ib2(entry);
-@@ -790,6 +812,11 @@ void __mtk_ppe_check_skb(struct mtk_ppe *ppe, struct sk_buff *skb, u16 hash)
+@@ -790,6 +815,9 @@ void __mtk_ppe_check_skb(struct mtk_ppe *ppe, struct sk_buff *skb, u16 hash)
  			continue;
  		}
  
-+#if defined(CONFIG_MEDIATEK_NETSYS_V3)
 +		if (skb && skb->len < 100)
 +			mtk_foe_entry_adjust_qid(ppe, entry);
-+#endif
 +
  		entry->hash = hash;
  		__mtk_foe_entry_commit(ppe, &entry->data, hash);
  		found = true;
 -- 
 2.18.0
-