From: Simon Horman <horms@kernel.org>
To: Haiyang Zhang <haiyangz@linux.microsoft.com>
Cc: linux-hyperv@vger.kernel.org, netdev@vger.kernel.org,
"K. Y. Srinivasan" <kys@microsoft.com>,
Haiyang Zhang <haiyangz@microsoft.com>,
Wei Liu <wei.liu@kernel.org>, Dexuan Cui <decui@microsoft.com>,
Long Li <longli@microsoft.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Konstantin Taranov <kotaranov@microsoft.com>,
Erni Sri Satya Vennela <ernis@linux.microsoft.com>,
Dipayaan Roy <dipayanroy@linux.microsoft.com>,
Shradha Gupta <shradhagupta@linux.microsoft.com>,
Shiraz Saleem <shirazsaleem@microsoft.com>,
Kees Cook <kees@kernel.org>,
Subbaraya Sundeep <sbhatta@marvell.com>,
Aditya Garg <gargaditya@linux.microsoft.com>,
Breno Leitao <leitao@debian.org>,
linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org,
paulros@microsoft.com
Subject: Re: [PATCH net-next,V4, 3/3] net: mana: Add ethtool counters for RX CQEs in coalesced type
Date: Wed, 11 Mar 2026 17:58:35 +0000 [thread overview]
Message-ID: <20260311175835.GV461701@kernel.org> (raw)
In-Reply-To: <20260309212106.764156-4-haiyangz@linux.microsoft.com>
On Mon, Mar 09, 2026 at 02:20:45PM -0700, Haiyang Zhang wrote:
> From: Haiyang Zhang <haiyangz@microsoft.com>
>
> For RX CQEs with type CQE_RX_COALESCED_4, to measure the coalescing
> efficiency, add counters to count how many contains 2, 3, 4 packets
> respectively.
> Also, add a counter for the error case of first packet with length == 0.
>
> Reviewed-by: Long Li <longli@microsoft.com>
> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
> ---
> drivers/net/ethernet/microsoft/mana/mana_en.c | 21 ++++++++++++++++++-
> .../ethernet/microsoft/mana/mana_ethtool.c | 15 +++++++++++--
> include/net/mana/mana.h | 9 +++++---
> 3 files changed, 39 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/net/ethernet/microsoft/mana/mana_en.c b/drivers/net/ethernet/microsoft/mana/mana_en.c
> index fa30046dcd3d..85f7a56d0d90 100644
> --- a/drivers/net/ethernet/microsoft/mana/mana_en.c
> +++ b/drivers/net/ethernet/microsoft/mana/mana_en.c
> @@ -2148,11 +2148,23 @@ static void mana_process_rx_cqe(struct mana_rxq *rxq, struct mana_cq *cq,
> old_buf = NULL;
> pktlen = oob->ppi[i].pkt_len;
> if (pktlen == 0) {
> - if (i == 0)
> + /* Collect coalesced CQE count based on packets processed.
> + * Coalesced CQEs have at least 2 packets, so index is i - 2.
> + */
> + if (i > 1) {
> + u64_stats_update_begin(&rxq->stats.syncp);
> + rxq->stats.coalesced_cqe[i - 2]++;
> + u64_stats_update_end(&rxq->stats.syncp);
> + } else if (i == 0) {
> + /* Error case stat */
> + u64_stats_update_begin(&rxq->stats.syncp);
> + rxq->stats.pkt_len0_err++;
> + u64_stats_update_end(&rxq->stats.syncp);
> netdev_err_once(
> ndev,
> "RX pkt len=0, rq=%u, cq=%u, rxobj=0x%llx\n",
> rxq->gdma_id, cq->gdma_id, rxq->rxobj);
> + }
> break;
Hi Haiyang Zhang,
As there is a break here, can the accounting logic above be move out of the
loop, and merged with the "Coalesced CQE with all 4 packets" accounting
logic that is already there?
As is, accounting seems split between and slightly duplicated in two locations.
> }
>
> @@ -2175,6 +2187,13 @@ static void mana_process_rx_cqe(struct mana_rxq *rxq, struct mana_cq *cq,
> if (!coalesced)
> break;
> }
> +
> + /* Coalesced CQE with all 4 packets */
> + if (coalesced && i == MANA_RXCOMP_OOB_NUM_PPI) {
> + u64_stats_update_begin(&rxq->stats.syncp);
> + rxq->stats.coalesced_cqe[MANA_RXCOMP_OOB_NUM_PPI - 2]++;
> + u64_stats_update_end(&rxq->stats.syncp);
> + }
> }
>
> static void mana_poll_rx_cq(struct mana_cq *cq)
...
next prev parent reply other threads:[~2026-03-11 17:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-09 21:20 [PATCH net-next,V4, 0/3] add ethtool COALESCE_RX_CQE_FRAMES/NSECS and use it in MANA driver Haiyang Zhang
2026-03-09 21:20 ` [PATCH net-next,V4, 1/3] net: ethtool: add ethtool COALESCE_RX_CQE_FRAMES/NSECS Haiyang Zhang
2026-03-09 21:20 ` [PATCH net-next,V4, 2/3] net: mana: Add support for RX CQE Coalescing Haiyang Zhang
2026-03-09 21:20 ` [PATCH net-next,V4, 3/3] net: mana: Add ethtool counters for RX CQEs in coalesced type Haiyang Zhang
2026-03-11 17:58 ` Simon Horman [this message]
2026-03-12 16:34 ` [EXTERNAL] " Haiyang Zhang
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=20260311175835.GV461701@kernel.org \
--to=horms@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=decui@microsoft.com \
--cc=dipayanroy@linux.microsoft.com \
--cc=edumazet@google.com \
--cc=ernis@linux.microsoft.com \
--cc=gargaditya@linux.microsoft.com \
--cc=haiyangz@linux.microsoft.com \
--cc=haiyangz@microsoft.com \
--cc=kees@kernel.org \
--cc=kotaranov@microsoft.com \
--cc=kuba@kernel.org \
--cc=kys@microsoft.com \
--cc=leitao@debian.org \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=longli@microsoft.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=paulros@microsoft.com \
--cc=sbhatta@marvell.com \
--cc=shirazsaleem@microsoft.com \
--cc=shradhagupta@linux.microsoft.com \
--cc=wei.liu@kernel.org \
/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.