[PATCH] qualcommax: qca_edma: do not set a zero RX hash
John Macias
dencity7 at gmail.com
Wed Oct 21 23:26:58 PDT 2026
The RX preheader can carry a 5-tuple or 3-tuple hash flag with a zero
hash value. edma_rx_hash() still passes that value to skb_set_hash()
as an L4 (or L3) hash, so every such flow gets the same hash and the
stack does not compute a software hash for it. RPS then steers all
of these flows to one CPU.
On a Netgear RAX120 v1 (IPQ8074) with RPS enabled on the conduit,
UDP forwarded at 900 Mb/s LAN->WAN lost 18-21% with one CPU saturated;
skipping zero hashes let the software hash spread flows and the same
test ran at 900 Mb/s without loss (TCP 760 -> 941 Mb/s). This was
measured with the single-queue driver from before commit 207962a8
("qualcommax: qca_edma: add multi-queue RX and TX"); edma_rx_hash() is
unchanged since.
Skip the hash when its value is zero.
Assisted-by: LLM
Signed-off-by: John Macias <dencity7 at gmail.com>
---
.../files/drivers/net/ethernet/qualcomm/qca_edma.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/target/linux/qualcommax/files/drivers/net/ethernet/qualcomm/qca_edma.c b/target/linux/qualcommax/files/drivers/net/ethernet/qualcomm/qca_edma.c
index b17ab7d1..5a0e0379 100644
--- a/target/linux/qualcommax/files/drivers/net/ethernet/qualcomm/qca_edma.c
+++ b/target/linux/qualcommax/files/drivers/net/ethernet/qualcomm/qca_edma.c
@@ -584,6 +584,13 @@ static void edma_rx_hash(struct net_device *netdev, struct sk_buff *skb,
if (flag != EDMA_RXPH_HASH_5TUPLE && flag != EDMA_RXPH_HASH_3TUPLE)
return;
+ /* A zero hash carries no flow information. Setting it as an L4 hash
+ * would stop the stack from computing a software hash, so RPS would
+ * steer every flow to the same CPU.
+ */
+ if (!(pre2 & EDMA_RXPH_HASH_MASK))
+ return;
+
skb_set_hash(skb, hash_32(pre2 & EDMA_RXPH_HASH_MASK, 32),
flag == EDMA_RXPH_HASH_5TUPLE ? PKT_HASH_TYPE_L4 :
PKT_HASH_TYPE_L3);
--
2.47.3
More information about the openwrt-devel
mailing list