Thread (4 messages) flat view 4 messages, 3 authors, 2026-07-31

RE: [EXTERNAL] Re: [PATCH net-next] net: mana: Extend RX CQE coalescing up to 8 packets

From: Haiyang Zhang <haiyangz@microsoft.com>
Date: 2026-07-30 21:11:02
Also in: linux-hyperv, linux-rdma, lkml

-----Original Message-----
From: Joe Damato <redacted>
Sent: Thursday, July 30, 2026 11:55 AM
To: Haiyang Zhang <redacted>
Cc: linux-hyperv@vger.kernel.org; netdev@vger.kernel.org; KY Srinivasan
[off-list ref]; Haiyang Zhang [off-list ref]; Wei Liu
[off-list ref]; Dexuan Cui [off-list ref]; Long Li
[off-list ref]; Andrew Lunn [off-list ref]; David S.
Miller [off-list ref]; Eric Dumazet [off-list ref]; Jakub
Kicinski [off-list ref]; Paolo Abeni [off-list ref]; Konstantin
Taranov [off-list ref]; Simon Horman [off-list ref]; Erni
Sri Satya Vennela [off-list ref]; Dipayaan Roy
[off-list ref]; Aditya Garg
[off-list ref]; Breno Leitao [off-list ref]; linux-
kernel@vger.kernel.org; linux-rdma@vger.kernel.org; Paul Rosswurm
[off-list ref]
Subject: [EXTERNAL] Re: [PATCH net-next] net: mana: Extend RX CQE
coalescing up to 8 packets

[You don't often get email from joe@dama.to. Learn why this is important
at https://aka.ms/LearnAboutSenderIdentification ]

On Wed, Jul 29, 2026 at 03:52:22PM -0700, Haiyang Zhang wrote:
quoted
From: Haiyang Zhang <haiyangz@microsoft.com>

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@microsoft.com>
---
 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
quoted
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,

[...]
quoted
+static void mana_process_one_rx_pkt(struct device *dev, struct mana_rxq
*rxq,
quoted
+                                 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help