On the YT6801, an RI or TI set while the DMA channel interrupt is masked for NAPI raises no MSI on unmask. During a 64-byte UDP TX flood, bpftrace shows over 1300 gaps longer than 2 ms between stmmac_napi_poll_tx() calls per 10 s run. The glue INT_MODERATION register, set to 200 us by motorcomm_init(), adds up to 200 us of RX latency on top of RIWT (ethtool -C rx-usecs). With rx-usecs 33, the median ping RTT is 0.32-0.36 ms with INT_MODERATION at 0 and 0.53-0.54 ms at 200. Set STMMAC_FLAG_NAPI_MASK_MSI_VEC under MSI-X and INT_MODERATION to 0. The vector mask alone keeps ping RTT at 0.80-0.87 ms, and moderation 0 alone drops 64-byte UDP TX to 50.2-50.8 kpps. Orange Pi 5 Pro (RK3588S, YT6801 on PCIe 2.0 x1), 7.3.6 backport, default coalescing (rx-usecs 328, tx-usecs 5000, tx-frames 25), iperf3 to a peer one routed hop away, 10 s per test, 5 interleaved runs, min-max. TX poll gaps are gaps over 2 ms traced with bpftrace. before after ping RTT (ms) 0.82-0.86 0.60-0.66 TCP RX (Mb/s) 917-923 931-935 TCP TX (Mb/s) 826-866 839-867 UDP 64B TX (kpps) 67.3-68.1 76.9-78.7 TX poll gaps per run 1381-1587 14-298 UDP 64B RX loss (%) 0.65-1.60 0.01-0.06 CPU, TCP RX (%) 10.1-12.4 11.6-13.9 RX interrupts/s, TCP RX 1751-1776 2999-3007 TX interrupts/s, UDP TX 884-928 7684-8492 RIWT alone now times RX interrupts, which accounts for the extra CPU. motorcomm_resume() calls motorcomm_init(), so the setting survives resume. Link down/up during a UDP flood left no unbalanced enable_irq() warning. With a single MSI only the moderation change applies: before after ping RTT (ms) 0.62-0.74 0.63-0.66 UDP 64B RX loss (%) 0.68-2.20 0.01-0.03 CPU, TCP RX (%) 9.2-13.2 13.6-14.1 TCP throughput did not change. Signed-off-by: Johan Alvarado --- drivers/net/ethernet/stmicro/stmmac/dwmac-motorcomm.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-motorcomm.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-motorcomm.c index 42f0b11a7b60..627cf4000dea 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-motorcomm.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-motorcomm.c @@ -174,8 +174,9 @@ static void motorcomm_init(struct dwmac_motorcomm_priv *priv) { writel(0x0, priv->base + MGMT_INT_CTRL0); - writel(FIELD_PREP(INT_MODERATION_RX, 200) | - FIELD_PREP(INT_MODERATION_TX, 200), + /* Interrupt coalescing is left to the stmmac core */ + writel(FIELD_PREP(INT_MODERATION_RX, 0) | + FIELD_PREP(INT_MODERATION_TX, 0), priv->base + INT_MODERATION); /* @@ -272,7 +273,8 @@ static int motorcomm_setup_irq(struct pci_dev *pdev, res->tx_irq[0] = pci_irq_vector(pdev, 4); res->irq = pci_irq_vector(pdev, 5); - plat->flags |= STMMAC_FLAG_MULTI_MSI_EN; + plat->flags |= STMMAC_FLAG_MULTI_MSI_EN | + STMMAC_FLAG_NAPI_MASK_MSI_VEC; } else { dev_info(&pdev->dev, "failed to allocate MSI-X vector: %d\n", ret); -- 2.56.1