All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net 1/2] eth: bnxt_en: restore Rx coalescing after re-allocating the completion ring
@ 2026-11-20  3:46 Jakub Kicinski
  2026-11-20  3:46 ` [PATCH net 2/2] eth: bnxt_en: restore Tx " Jakub Kicinski
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Jakub Kicinski @ 2026-11-20  3:46 UTC (permalink / raw)
  To: davem
  Cc: netdev, edumazet, pabeni, andrew+netdev, horms, michael.chan,
	pavan.chebbi, somnath.kotur, ajit.khaparde, michal.swiatkowski,
	Jakub Kicinski

With TPH enabled, queue restart frees and re-allocates the Rx
completion ring in the FW, to apply the new Steering Tag. The new
FW ring starts with default interrupt coalescing parameters. The
driver programs coalescing only at open, from ethtool and from DIM,
so after a restart the ring ignores the configured settings, while
ethtool keeps reporting them.

Re-program Rx coalescing of the ring after allocating it. Use DIM's
current profile if adaptive coalescing is enabled, the static
settings otherwise. The per-ring DIM values may be stale when DIM is
off, ethtool changes to static coalescing don't update them.

With rx-usecs 1000, re-allocating the ring on a BCM57508 lowers the
latency of a 1 byte ping-pong on that queue by ~250us. Latency goes
back up once ethtool re-programs coalescing.

Fixes: 6b6bf60fc95f ("bnxt_en: Reallocate RX completion ring for TPH support")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 24 +++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index e78cf7ad3cbc..25d7c4cc3377 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -8618,6 +8618,25 @@ int bnxt_hwrm_set_coal(struct bnxt *bp)
 	return rc;
 }
 
+/* Program Rx coalescing of a single ring, e.g. after its completion ring
+ * was re-allocated in the FW, which resets the coalescing parameters.
+ */
+static int bnxt_hwrm_set_rx_ring_coal(struct bnxt *bp, struct bnxt_napi *bnapi)
+{
+	struct hwrm_ring_cmpl_ring_cfg_aggint_params_input *req;
+	int rc;
+
+	if (bp->flags & BNXT_FLAG_DIM)
+		return bnxt_hwrm_set_ring_coal(bp, bnapi);
+
+	rc = hwrm_req_init(bp, req, HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS);
+	if (rc)
+		return rc;
+
+	bnxt_hwrm_set_coal_params(bp, &bp->rx_coal, req);
+	return bnxt_hwrm_set_rx_coal(bp, bnapi, req);
+}
+
 static void bnxt_hwrm_stat_ctx_free(struct bnxt *bp)
 {
 	struct hwrm_stat_ctx_clr_stats_input *req0 = NULL;
@@ -16643,6 +16662,11 @@ static int bnxt_queue_start(struct net_device *dev,
 		rc = bnxt_hwrm_cp_ring_alloc_p5(bp, rxr->rx_cpr);
 		if (rc)
 			goto err_reset;
+
+		rc = bnxt_hwrm_set_rx_ring_coal(bp, bnapi);
+		if (rc)
+			netdev_warn(bp->dev, "HWRM set coalescing failure rc: %d\n",
+				    rc);
 	}
 
 	rc = bnxt_hwrm_rx_agg_ring_alloc(bp, rxr);
-- 
2.56.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-11-20  4:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-20  3:46 [PATCH net 1/2] eth: bnxt_en: restore Rx coalescing after re-allocating the completion ring Jakub Kicinski
2026-11-20  3:46 ` [PATCH net 2/2] eth: bnxt_en: restore Tx " Jakub Kicinski
2026-11-20  4:33   ` Pavan Chebbi
2026-11-20  3:53 ` [PATCH net 1/2] eth: bnxt_en: restore Rx " netdev-bot+sinfo
2026-11-20  4:32 ` Pavan Chebbi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.