> -----Original Message-----
> From: Simon Horman <[email protected]>
> Sent: Wednesday, March 11, 2026 1:59 PM
> To: Haiyang Zhang <[email protected]>
> Cc: [email protected]; [email protected]; KY Srinivasan
> <[email protected]>; Haiyang Zhang <[email protected]>; Wei Liu
> <[email protected]>; Dexuan Cui <[email protected]>; Long Li
> <[email protected]>; Andrew Lunn <[email protected]>; David S.
> Miller <[email protected]>; Eric Dumazet <[email protected]>; Jakub
> Kicinski <[email protected]>; Paolo Abeni <[email protected]>; Konstantin
> Taranov <[email protected]>; Erni Sri Satya Vennela
> <[email protected]>; Dipayaan Roy
> <[email protected]>; Shradha Gupta
> <[email protected]>; Shiraz Saleem
> <[email protected]>; Kees Cook <[email protected]>; Subbaraya
> Sundeep <[email protected]>; Aditya Garg
> <[email protected]>; Breno Leitao <[email protected]>; linux-
> [email protected]; [email protected]; Paul Rosswurm
> <[email protected]>
> Subject: [EXTERNAL] Re: [PATCH net-next,V4, 3/3] net: mana: Add ethtool
> counters for RX CQEs in coalesced type
> 
> On Mon, Mar 09, 2026 at 02:20:45PM -0700, Haiyang Zhang wrote:
> > From: Haiyang Zhang <[email protected]>
> >
> > 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 <[email protected]>
> > Signed-off-by: Haiyang Zhang <[email protected]>
> > ---
> >  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.

Will do.

Thanks,
- Haiyang


Reply via email to