🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
4 messages
4 total messages Started by Jakub Kicinski Fri, 20 Nov 2026 03:46
[PATCH net 1/2] eth: bnxt_en: restore Rx coalescing after re-allocating the completion ring
#19596
Author: Jakub Kicinski
Date: Fri, 20 Nov 2026 03:46
67 lines
9981 bytes
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
[PATCH net 2/2] eth: bnxt_en: restore Tx coalescing after re-allocating the completion ring
#19595
Author: Jakub Kicinski
Date: Fri, 20 Nov 2026 03:46
64 lines
10127 bytes
With TPH enabled, queue restart also frees and re-allocates the Tx
completion rings which share the NAPI instance with the Rx queue.
Same as on the Rx side, the new FW rings start with default interrupt
coalescing parameters, and the configured settings are applied again
only at the next open or ethtool change.

On P5+ chips the Tx completion rings are separate from the Rx ones
even in combined channels, and the Tx settings do take effect. On a
BCM57508 the completion latency of sparse Tx traffic follows
tx-usecs, it's ~20us with tx-usecs 1 and ~220us with tx-usecs 200.

Re-program Tx coalescing of each completion ring after allocating it.
DIM only manages Rx, the static settings always apply to Tx.

Fixes: fe96d717d38e ("bnxt_en: Extend queue stop/start for TX rings")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 25d7c4cc3377..52606db3f7b4 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -8637,6 +8637,24 @@ static int bnxt_hwrm_set_rx_ring_coal(struct bnxt *bp, struct bnxt_napi *bnapi)
 	return bnxt_hwrm_set_rx_coal(bp, bnapi, req);
 }
 
+/* Program Tx coalescing of the completion ring of a single Tx ring, e.g.
+ * after it was re-allocated in the FW.
+ */
+static int bnxt_hwrm_set_tx_ring_coal(struct bnxt *bp,
+				      struct bnxt_tx_ring_info *txr)
+{
+	struct hwrm_ring_cmpl_ring_cfg_aggint_params_input *req;
+	int rc;
+
+	rc = hwrm_req_init(bp, req, HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS);
+	if (rc)
+		return rc;
+
+	bnxt_hwrm_set_coal_params(bp, &bp->tx_coal, req);
+	req->ring_id = cpu_to_le16(bnxt_cp_ring_for_tx(bp, txr));
+	return hwrm_req_send(bp, req);
+}
+
 static void bnxt_hwrm_stat_ctx_free(struct bnxt *bp)
 {
 	struct hwrm_stat_ctx_clr_stats_input *req0 = NULL;
@@ -11857,6 +11875,11 @@ static int bnxt_tx_queue_start(struct bnxt *bp, int idx)
 		if (rc)
 			return rc;
 
+		rc = bnxt_hwrm_set_tx_ring_coal(bp, txr);
+		if (rc)
+			netdev_warn(bp->dev, "HWRM set coalescing failure rc: %d\n",
+				    rc);
+
 		rc = bnxt_hwrm_tx_ring_alloc(bp, txr, false);
 		if (rc)
 			return rc;
-- 
2.56.1
Re: [PATCH net 1/2] eth: bnxt_en: restore Rx coalescing after re-allocating the completion ring
#19609
Author: netdev-bot+sinfo
Date: Fri, 20 Nov 2026 03:53
19 lines
8511 bytes
Hi!

This is an automated message. This series looks like a fix, but its
commit messages seem to be missing some information:

 - How the issue was discovered, e.g. hit in production, hit during
   development, syzbot report, manual code inspection, LLM or static
   analysis tool scan.

Please do not repost the series just to address the above. Instead,
reply to this email with the missing information, so that reviewers
can take it into account.

*IMPORTANT*: If you do repost (for other reasons) - please include
the relevant info in the cover letter or commit messages.
-- 
The evaluation is done by an LLM so it may be wrong, if you think
that is the case please reply and explain.
Re: [PATCH net 1/2] eth: bnxt_en: restore Rx coalescing after re-allocating the completion ring
#22177
Author: patchwork-bot+netdevbpf
Date: Tue, 24 Nov 2026 23:30
26 lines
8932 bytes
Hello:

This series was applied to netdev/net.git (main)
by Willem de Bruijn <willemb@google.com>:

On Thu, 19 Nov 2026 19:46:44 -0800 you wrote:
> 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.
> 
> [...]

Here is the summary with links:
  - [net,1/2] eth: bnxt_en: restore Rx coalescing after re-allocating the completion ring
    https://git.kernel.org/netdev/net/c/a6ea69915a23
  - [net,2/2] eth: bnxt_en: restore Tx coalescing after re-allocating the completion ring
    https://git.kernel.org/netdev/net/c/32756b82fde8

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads