From: Jakub Kicinski <kuba@kernel.org>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, edumazet@google.com, pabeni@redhat.com,
andrew+netdev@lunn.ch, horms@kernel.org,
michael.chan@broadcom.com, pavan.chebbi@broadcom.com,
somnath.kotur@broadcom.com, ajit.khaparde@broadcom.com,
michal.swiatkowski@linux.intel.com,
Jakub Kicinski <kuba@kernel.org>
Subject: [PATCH net 2/2] eth: bnxt_en: restore Tx coalescing after re-allocating the completion ring
Date: Thu, 19 Nov 2026 19:46:45 -0800 [thread overview]
Message-ID: <20261120034645.364630-2-kuba@kernel.org> (raw)
In-Reply-To: <20261120034645.364630-1-kuba@kernel.org>
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
next prev parent reply other threads:[~2026-11-20 3:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Jakub Kicinski [this message]
2026-11-20 4:33 ` [PATCH net 2/2] eth: bnxt_en: restore Tx " 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261120034645.364630-2-kuba@kernel.org \
--to=kuba@kernel.org \
--cc=ajit.khaparde@broadcom.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=michael.chan@broadcom.com \
--cc=michal.swiatkowski@linux.intel.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pavan.chebbi@broadcom.com \
--cc=somnath.kotur@broadcom.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.