| From 8306aa4c52abf96af2c229762207369f279c89e2 Mon Sep 17 00:00:00 2001 |
| From: Bo-Cun Chen <bc-bocun.chen@mediatek.com> |
| Date: Tue, 28 Nov 2023 13:25:03 +0800 |
| Subject: [PATCH] 999-3024-mtk-ppe-dispatch-short-packets-to-high-priority-TXQ-in-PPPQ |
| |
| --- |
| drivers/net/ethernet/mediatek/mtk_ppe.c | 27 +++++++++++++++++++++++++ |
| 1 file changed, 27 insertions(+) |
| |
| diff --git a/drivers/net/ethernet/mediatek/mtk_ppe.c b/drivers/net/ethernet/mediatek/mtk_ppe.c |
| index 16aec2e..1e2b96e 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) |
| 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 (l2->tport_id != 1) |
| + return; |
| + |
| + qid = FIELD_GET(MTK_FOE_IB2_QID, *ib2); |
| + /* To enhance performance in the unbalanced PHY rate test, |
| + * dispatching short packets to the high priority TXQ. |
| + */ |
| + if (ppe->eth->qos_toggle == 2 && qid < 6) { |
| + qid += 6; |
| + *ib2 &= ~MTK_FOE_IB2_QID; |
| + *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) |
| 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 |
| |