RE: [EXTERNAL] Re: [PATCH net-next] net: mana: Extend RX CQE coalescing up to 8 packets
From: Haiyang Zhang
Date: Thu Jul 30 2026 - 17:20:26 EST
> -----Original Message-----
> From: Joe Damato <joe@xxxxxxx>
> Sent: Thursday, July 30, 2026 11:55 AM
> To: Haiyang Zhang <haiyangz@xxxxxxxxxxxxxxxxxxx>
> Cc: linux-hyperv@xxxxxxxxxxxxxxx; netdev@xxxxxxxxxxxxxxx; KY Srinivasan
> <kys@xxxxxxxxxxxxx>; Haiyang Zhang <haiyangz@xxxxxxxxxxxxx>; Wei Liu
> <wei.liu@xxxxxxxxxx>; Dexuan Cui <DECUI@xxxxxxxxxxxxx>; Long Li
> <longli@xxxxxxxxxxxxx>; Andrew Lunn <andrew+netdev@xxxxxxx>; David S.
> Miller <davem@xxxxxxxxxxxxx>; Eric Dumazet <edumazet@xxxxxxxxxx>; Jakub
> Kicinski <kuba@xxxxxxxxxx>; Paolo Abeni <pabeni@xxxxxxxxxx>; Konstantin
> Taranov <kotaranov@xxxxxxxxxxxxx>; Simon Horman <horms@xxxxxxxxxx>; Erni
> Sri Satya Vennela <ernis@xxxxxxxxxxxxxxxxxxx>; Dipayaan Roy
> <dipayanroy@xxxxxxxxxxxxxxxxxxx>; Aditya Garg
> <gargaditya@xxxxxxxxxxxxxxxxxxx>; Breno Leitao <leitao@xxxxxxxxxx>; linux-
> kernel@xxxxxxxxxxxxxxx; linux-rdma@xxxxxxxxxxxxxxx; Paul Rosswurm
> <paulros@xxxxxxxxxxxxx>
> Subject: [EXTERNAL] Re: [PATCH net-next] net: mana: Extend RX CQE
> coalescing up to 8 packets
>
> [You don't often get email from joe@xxxxxxx. Learn why this is important
> at https://aka.ms/LearnAboutSenderIdentification ]
>
> On Wed, Jul 29, 2026 at 03:52:22PM -0700, Haiyang Zhang wrote:
> > From: Haiyang Zhang <haiyangz@xxxxxxxxxxxxx>
> >
> > To support up to 8 packets per CQE, put two packet lengths and
> > hash values into one PPI entry by using the reserved fields.
> > Update ethtool handlers to set this feature.
> > Update per queue stat to show the coalesced CQE counters.
> > This feature is supported on NIC hardware showing the relevant
> > PF flag.
> >
> > Signed-off-by: Haiyang Zhang <haiyangz@xxxxxxxxxxxxx>
> > ---
> > drivers/net/ethernet/microsoft/mana/mana_en.c | 137 ++++++++++++------
> > .../ethernet/microsoft/mana/mana_ethtool.c | 30 +++-
> > include/net/mana/gdma.h | 4 +
> > include/net/mana/mana.h | 43 ++++--
> > 4 files changed, 150 insertions(+), 64 deletions(-)
> >
> > diff --git a/drivers/net/ethernet/microsoft/mana/mana_en.c
> b/drivers/net/ethernet/microsoft/mana/mana_en.c
> > index a8c329bdbacf..720d22e6aea9 100644
> > --- a/drivers/net/ethernet/microsoft/mana/mana_en.c
> > +++ b/drivers/net/ethernet/microsoft/mana/mana_en.c
> > @@ -1241,6 +1241,9 @@ int mana_gd_query_device_cfg(struct gdma_context
> *gc, u32 proto_major_ver,
>
> [...]
>
> >
> > +static void mana_process_one_rx_pkt(struct device *dev, struct mana_rxq
> *rxq,
> > + struct mana_rxcomp_oob *oob,
> > + u32 pktlen, u32 pkt_hash)
> > +{
> > + struct mana_recv_buf_oob *rxbuf_oob;
> > + struct net_device *ndev = rxq->ndev;
> > + void *old_buf = NULL;
> > + bool old_fp;
> > +
> > + rxbuf_oob = &rxq->rx_oobs[rxq->buf_index];
> > + WARN_ON_ONCE(rxbuf_oob->wqe_inf.wqe_size_in_bu != 1);
> > +
> > + if (unlikely(pktlen > rxq->datasize)) {
> > + /* Increase it even if mana_rx_skb() isn't called. */
> > + rxq->rx_cq.work_done++;
> > +
> > + ++ndev->stats.rx_dropped;
>
> It looks like this code was moved from mana_process_rx_cqe, so this is
> prob
> out of scope, but I saw this and was wondering if maybe rx_length_errors
> is more
> appropriate?
>
> from if_link.h:
>
> * @rx_length_errors: Number of packets dropped due to invalid length.
> * Part of aggregate "frame" errors in `/proc/net/dev`.
Yes, it's moved from mana_process_rx_cqe(). We can consider a separate
patch if any changes are needed here.
I found: "Linux rx_length_errors is a network interface counter that
tracks incoming packets dropped because their actual size does not match
the packet length stated in the header."
But (pktlen > rxq->datasize) is different, it means the len in OOB is
bigger than the data buflen, which is a HW error, and unexpected. So
it probably should not be put into "rx_length_errors"?
Thanks,
- Haiyang