From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6E4D43E63B6; Wed, 11 Mar 2026 17:58:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773251923; cv=none; b=m6P7Sa382kH0MNTNXtPUIl+G3qvL5mEPbjFY9E6PNfXReIykv3cEOtkhXWjHqTzFYDvtVJ0gPd/YNw5OPwqQmH8teMgYS9B+LZGH3GgdRKdc942L8FUHICA0/KNzMyHxs6sI5+oB/NezUm+FeiiONuYeaeKAYE4t3FUP2nxXWOw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773251923; c=relaxed/simple; bh=lPNDgdfcB4TUNnHS7VI9JE0TmqQLeybQYRP4UcSSaNY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=nFLmsMfaGUGU2m3fNHvzYPr892B1Et05RfALaibsl8wvRmPd1n5zr0BmVuotgxR8GE8ZSh2Egab8ROic2EChGvlcUAJcOthC6qVcxQoycVxJRVqAzU+CgL16H4/wykcq8xD4XXltkL6DCh1ta1VT5HxDJ6D5oWUceui0d8pxTx4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=kscVPh9b; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="kscVPh9b" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 795DFC4CEF7; Wed, 11 Mar 2026 17:58:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773251923; bh=lPNDgdfcB4TUNnHS7VI9JE0TmqQLeybQYRP4UcSSaNY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=kscVPh9buXHldR5cSapRZK5225/CEjCNzGPhQydrc59SS4rH33BGJcmYOT45JjO+I YwiDKdHat0/pTBdjqiTWakdtqK/PN4e7qPd6WxNNEMu1y+A0xGQ9ujvIF1Evro1LOE nQnaKKz5x08nkFAcka2TpT7vNlr/sd3vTfF3IL1NEvV5/B6VX0l9EA/JJ8LVqm3YkW Sm66rsrcwMAonFEzSAhdmSb/5evAL3M3991WOUo2YMGKvOK9V1aFM/WharohMrz43o LkbR75XtL9uBhZ2B515XLsILb/co+P0d2Zagu+PVDXwAZp+1dD3OP3GQlP/cqcnn/I +jyCpXwHim+8w== Date: Wed, 11 Mar 2026 17:58:35 +0000 From: Simon Horman To: Haiyang Zhang Cc: linux-hyperv@vger.kernel.org, netdev@vger.kernel.org, "K. Y. Srinivasan" , Haiyang Zhang , Wei Liu , Dexuan Cui , Long Li , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Konstantin Taranov , Erni Sri Satya Vennela , Dipayaan Roy , Shradha Gupta , Shiraz Saleem , Kees Cook , Subbaraya Sundeep , Aditya Garg , Breno Leitao , 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 Message-ID: <20260311175835.GV461701@kernel.org> References: <20260309212106.764156-1-haiyangz@linux.microsoft.com> <20260309212106.764156-4-haiyangz@linux.microsoft.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 > > 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 > Signed-off-by: Haiyang Zhang > --- > 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) ...