Skip to contentSkip to conversation

net: ethtool: add COALESCE_RX_CQE_FRAMES/NSECS parameters

PATCH Superseded Haiyang Zhang 5 participants 7 messages Feb 22 – Feb 24

Subsystems (7)

v1 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: ethtool: add COALESCE_RX_CQE_FRAMES/NSECS parameters

From: Haiyang Zhang <[email protected]>

Add two parameters for drivers supporting Rx CQE Coalescing.

ETHTOOL_A_COALESCE_RX_CQE_FRAMES:
Maximum number of frames that can be coalesced into a CQE.

ETHTOOL_A_COALESCE_RX_CQE_NSECS:
Time out value in nanoseconds after the first packet arrival in a coalesced CQE to be sent.

---
 Documentation/netlink/specs/ethtool.yaml       |  8 ++++++++
 Documentation/networking/ethtool-netlink.rst   | 10 ++++++++++
 include/linux/ethtool.h                        |  6 +++++-
 include/uapi/linux/ethtool_netlink_generated.h |  2 ++
 net/ethtool/coalesce.c                         | 14 +++++++++++++-
 5 files changed, 38 insertions(+), 2 deletions(-)
Documentation/netlink/specs/ethtool.yaml +8 -0
index 0a2d2343f79a..951d98f6bb12 100644
@@ -861,6 +861,12 @@ attribute-sets:
         name: tx-profile
         type: nest
         nested-attributes: profile
+      -
+        name: rx-cqe-frames
+        type: u32
+      -
+        name: rx-cqe-nsecs
+        type: u32
 
   -
     name: pause-stat
@@ -2244,6 +2250,8 @@ operations:
             - tx-aggr-time-usecs
             - rx-profile
             - tx-profile
+            - rx-cqe-frames
+            - rx-cqe-nsecs
       dump: *coalesce-get-op
     -
       name: coalesce-set
Documentation/networking/ethtool-netlink.rst +10 -0
index af56c304cef4..a3e78b69fd07 100644
@@ -1072,6 +1072,8 @@ Kernel response contents:
   ``ETHTOOL_A_COALESCE_TX_AGGR_TIME_USECS``    u32     time (us), aggr, Tx
   ``ETHTOOL_A_COALESCE_RX_PROFILE``            nested  profile of DIM, Rx
   ``ETHTOOL_A_COALESCE_TX_PROFILE``            nested  profile of DIM, Tx
+  ``ETHTOOL_A_COALESCE_RX_CQE_FRAMES``         u32     max packets, Rx CQE
+  ``ETHTOOL_A_COALESCE_RX_CQE_NSECS``          u32     delay (ns), Rx CQE
   ===========================================  ======  =======================
 
 Attributes are only included in reply if their value is not zero or the
@@ -1105,6 +1107,12 @@ well with frequent small-sized URBs transmissions.
 to DIM parameters, see `Generic Network Dynamic Interrupt Moderation (Net DIM)
 <https://www.kernel.org/doc/Documentation/networking/net_dim.rst>`_.
 
+Rx CQE coalescing allows multiple received packets to be coalesced into a single
+Completion Queue Entry (CQE). ``ETHTOOL_A_COALESCE_RX_CQE_FRAMES`` describes the
+maximum number of frames that can be coalesced into a CQE.
+``ETHTOOL_A_COALESCE_RX_CQE_NSECS`` describes max time in nanoseconds after the
+first packet arrival in a coalesced CQE to be sent.
+
 COALESCE_SET
 ============
 
@@ -1143,6 +1151,8 @@ Request contents:
   ``ETHTOOL_A_COALESCE_TX_AGGR_TIME_USECS``    u32     time (us), aggr, Tx
   ``ETHTOOL_A_COALESCE_RX_PROFILE``            nested  profile of DIM, Rx
   ``ETHTOOL_A_COALESCE_TX_PROFILE``            nested  profile of DIM, Tx
+  ``ETHTOOL_A_COALESCE_RX_CQE_FRAMES``         u32     max packets, Rx CQE
+  ``ETHTOOL_A_COALESCE_RX_CQE_NSECS``          u32     delay (ns), Rx CQE
   ===========================================  ======  =======================
 
 Request is rejected if it attributes declared as unsupported by driver (i.e.
include/linux/ethtool.h +5 -1
index 798abec67a1b..25ccd2d5d4dc 100644
@@ -332,6 +332,8 @@ struct kernel_ethtool_coalesce {
 	u32 tx_aggr_max_bytes;
 	u32 tx_aggr_max_frames;
 	u32 tx_aggr_time_usecs;
+	u32 rx_cqe_frames;
+	u32 rx_cqe_nsecs;
 };
 
 /**
@@ -380,7 +382,9 @@ bool ethtool_convert_link_mode_to_legacy_u32(u32 *legacy_u32,
 #define ETHTOOL_COALESCE_TX_AGGR_TIME_USECS	BIT(26)
 #define ETHTOOL_COALESCE_RX_PROFILE		BIT(27)
 #define ETHTOOL_COALESCE_TX_PROFILE		BIT(28)
-#define ETHTOOL_COALESCE_ALL_PARAMS		GENMASK(28, 0)
+#define ETHTOOL_COALESCE_RX_CQE_FRAMES		BIT(29)
+#define ETHTOOL_COALESCE_RX_CQE_NSECS		BIT(30)
+#define ETHTOOL_COALESCE_ALL_PARAMS		GENMASK(30, 0)
 
 #define ETHTOOL_COALESCE_USECS						\
 	(ETHTOOL_COALESCE_RX_USECS | ETHTOOL_COALESCE_TX_USECS)
include/uapi/linux/ethtool_netlink_generated.h +2 -0
index 556a0c834df5..efc6e4ade77b 100644
@@ -371,6 +371,8 @@ enum {
 	ETHTOOL_A_COALESCE_TX_AGGR_TIME_USECS,
 	ETHTOOL_A_COALESCE_RX_PROFILE,
 	ETHTOOL_A_COALESCE_TX_PROFILE,
+	ETHTOOL_A_COALESCE_RX_CQE_FRAMES,
+	ETHTOOL_A_COALESCE_RX_CQE_NSECS,
 
 	__ETHTOOL_A_COALESCE_CNT,
 	ETHTOOL_A_COALESCE_MAX = (__ETHTOOL_A_COALESCE_CNT - 1)
net/ethtool/coalesce.c +13 -1
index 3e18ca1ccc5e..349bb02c517a 100644
@@ -118,6 +118,8 @@ static int coalesce_reply_size(const struct ethnl_req_info *req_base,
 	       nla_total_size(sizeof(u32)) +	/* _TX_AGGR_MAX_BYTES */
 	       nla_total_size(sizeof(u32)) +	/* _TX_AGGR_MAX_FRAMES */
 	       nla_total_size(sizeof(u32)) +	/* _TX_AGGR_TIME_USECS */
+	       nla_total_size(sizeof(u32)) +	/* _RX_CQE_FRAMES */
+	       nla_total_size(sizeof(u32)) +	/* _RX_CQE_NSECS */
 	       total_modersz * 2;		/* _{R,T}X_PROFILE */
 }
 
@@ -269,7 +271,11 @@ static int coalesce_fill_reply(struct sk_buff *skb,
 	    coalesce_put_u32(skb, ETHTOOL_A_COALESCE_TX_AGGR_MAX_FRAMES,
 			     kcoal->tx_aggr_max_frames, supported) ||
 	    coalesce_put_u32(skb, ETHTOOL_A_COALESCE_TX_AGGR_TIME_USECS,
-			     kcoal->tx_aggr_time_usecs, supported))
+			     kcoal->tx_aggr_time_usecs, supported) ||
+	    coalesce_put_u32(skb, ETHTOOL_A_COALESCE_RX_CQE_FRAMES,
+			     kcoal->rx_cqe_frames, supported) ||
+	    coalesce_put_u32(skb, ETHTOOL_A_COALESCE_RX_CQE_NSECS,
+			     kcoal->rx_cqe_nsecs, supported))
 		return -EMSGSIZE;
 
 	if (!req_base->dev || !req_base->dev->irq_moder)
@@ -338,6 +344,8 @@ const struct nla_policy ethnl_coalesce_set_policy[] = {
 	[ETHTOOL_A_COALESCE_TX_AGGR_MAX_BYTES] = { .type = NLA_U32 },
 	[ETHTOOL_A_COALESCE_TX_AGGR_MAX_FRAMES] = { .type = NLA_U32 },
 	[ETHTOOL_A_COALESCE_TX_AGGR_TIME_USECS] = { .type = NLA_U32 },
+	[ETHTOOL_A_COALESCE_RX_CQE_FRAMES] = { .type = NLA_U32 },
+	[ETHTOOL_A_COALESCE_RX_CQE_NSECS] = { .type = NLA_U32 },
 	[ETHTOOL_A_COALESCE_RX_PROFILE] =
 		NLA_POLICY_NESTED(coalesce_profile_policy),
 	[ETHTOOL_A_COALESCE_TX_PROFILE] =
@@ -570,6 +578,10 @@ __ethnl_set_coalesce(struct ethnl_req_info *req_info, struct genl_info *info,
 			 tb[ETHTOOL_A_COALESCE_TX_AGGR_MAX_FRAMES], &mod);
 	ethnl_update_u32(&kernel_coalesce.tx_aggr_time_usecs,
 			 tb[ETHTOOL_A_COALESCE_TX_AGGR_TIME_USECS], &mod);
+	ethnl_update_u32(&kernel_coalesce.rx_cqe_frames,
+			 tb[ETHTOOL_A_COALESCE_RX_CQE_FRAMES], &mod);
+	ethnl_update_u32(&kernel_coalesce.rx_cqe_nsecs,
+			 tb[ETHTOOL_A_COALESCE_RX_CQE_NSECS], &mod);
 
 	if (dev->irq_moder && dev->irq_moder->profile_flags & DIM_PROFILE_RX) {
 		ret = ethnl_update_profile(dev, &dev->irq_moder->rx_profile,
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · On Sun, 22 Feb 2026 13:23:17 -0800 Haiyang Zhang…

From: Haiyang Zhang <[email protected]>

Add two parameters for drivers supporting Rx CQE Coalescing.

Quoted 8 lines

ETHTOOL_A_COALESCE_RX_CQE_FRAMES:
Maximum number of frames that can be coalesced into a CQE.

ETHTOOL_A_COALESCE_RX_CQE_NSECS:
Time out value in nanoseconds after the first packet arrival in a coalesced CQE to be sent.

You send this patch one day before the official reopening of net-next. Not sure if this will be taken into account by patchwork. Else:

Thank you!

Signature · 3 lines
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
maintainer
#3 lore raw
In reply to Haiyang Zhang
Quoted 10 lines · Haiyang Zhang

From: Haiyang Zhang <[email protected]>

Add two parameters for drivers supporting Rx CQE Coalescing.

ETHTOOL_A_COALESCE_RX_CQE_FRAMES:
Maximum number of frames that can be coalesced into a CQE.

ETHTOOL_A_COALESCE_RX_CQE_NSECS:
Time out value in nanoseconds after the first packet arrival in a coalesced CQE to be sent.

A new API needs a user. A kAPI especially needs a user. Please add support to at least one driver.

Andrew

---
pw-bot: cr

maintainer
#2 lore raw
In reply to Kory Maincent
Quoted 35 lines

-----Original Message-----
From: Kory Maincent <[email protected]>
Sent: Monday, February 23, 2026 4:26 AM
To: Haiyang Zhang <[email protected]>
Cc: [email protected]; [email protected]; Andrew Lunn <[email protected]>; Jakub Kicinski <[email protected]>; Donald Hunter <[email protected]>; David S. Miller <[email protected]>; Eric Dumazet <[email protected]>; Paolo Abeni <[email protected]>; Simon Horman <[email protected]>; Jonathan Corbet <[email protected]>; Shuah Khan <[email protected]>; Gal Pressman <[email protected]>; Oleksij Rempel <[email protected]>; Vadim Fedorenko <[email protected]>; [email protected]; [email protected]; Haiyang Zhang <[email protected]>; Paul Rosswurm <[email protected]>
Subject: [EXTERNAL] Re: [PATCH net-next] net: ethtool: add COALESCE_RX_CQE_FRAMES/NSECS parameters

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

Quoted 11 lines · On Sun, 22 Feb 2026 13:23:17 -0800 Haiyang Zhang…

From: Haiyang Zhang <[email protected]>

Add two parameters for drivers supporting Rx CQE Coalescing.

ETHTOOL_A_COALESCE_RX_CQE_FRAMES:
Maximum number of frames that can be coalesced into a CQE.

ETHTOOL_A_COALESCE_RX_CQE_NSECS:
Time out value in nanoseconds after the first packet arrival in a coalesced CQE to be sent.

Quoted 6 lines
Quoted 1 line

You send this patch one day before the official reopening of net-next. Not sure if this will be taken into account by patchwork. Else:

Thanks for the review! I sent it a day earlier because of the winter storm :)

- Haiyang

maintainer
#4 lore raw
In reply to Andrew Lunn
Quoted 27 lines

-----Original Message-----
From: Andrew Lunn <[email protected]>
Sent: Monday, February 23, 2026 9:01 AM
To: Haiyang Zhang <[email protected]>
Cc: [email protected]; [email protected]; Jakub Kicinski <[email protected]>; Donald Hunter <[email protected]>; David S. Miller <[email protected]>; Eric Dumazet <[email protected]>; Paolo Abeni <[email protected]>; Simon Horman <[email protected]>; Jonathan Corbet <[email protected]>; Shuah Khan <[email protected]>; Kory Maincent (Dent Project) <[email protected]>; Gal Pressman <[email protected]>; Oleksij Rempel <[email protected]>; Vadim Fedorenko <[email protected]>; [email protected]; [email protected]; Haiyang Zhang <[email protected]>; Paul Rosswurm <[email protected]>
Subject: [EXTERNAL] Re: [PATCH net-next] net: ethtool: add COALESCE_RX_CQE_FRAMES/NSECS parameters

Quoted 7 lines · Haiyang Zhang

From: Haiyang Zhang <[email protected]>

Add two parameters for drivers supporting Rx CQE Coalescing.

ETHTOOL_A_COALESCE_RX_CQE_FRAMES:
Maximum number of frames that can be coalesced into a CQE.

Quoted 6 lines
Quoted 3 lines

ETHTOOL_A_COALESCE_RX_CQE_NSECS:
Time out value in nanoseconds after the first packet arrival in a coalesced CQE to be sent.

A new API needs a user. A kAPI especially needs a user. Please add support to at least one driver.

Sure, next time I will include MANA driver patches using this kAPI in the same series. The MANA HW/FW API is still being worked on by other teams.

Thanks,
- Haiyang

#5 lore raw
In reply to Haiyang Zhang
Quoted 60 lines · Haiyang Zhang

From: Haiyang Zhang <[email protected]>

Add two parameters for drivers supporting Rx CQE Coalescing.

ETHTOOL_A_COALESCE_RX_CQE_FRAMES:
Maximum number of frames that can be coalesced into a CQE.

ETHTOOL_A_COALESCE_RX_CQE_NSECS:
Time out value in nanoseconds after the first packet arrival in a coalesced CQE to be sent.

---
  Documentation/netlink/specs/ethtool.yaml       |  8 ++++++++
  Documentation/networking/ethtool-netlink.rst   | 10 ++++++++++
  include/linux/ethtool.h                        |  6 +++++-
  include/uapi/linux/ethtool_netlink_generated.h |  2 ++
  net/ethtool/coalesce.c                         | 14 +++++++++++++-
  5 files changed, 38 insertions(+), 2 deletions(-)
Documentation/netlink/specs/ethtool.yaml +8 -0
index 0a2d2343f79a..951d98f6bb12 100644
@@ -861,6 +861,12 @@ attribute-sets:
          name: tx-profile
          type: nest
          nested-attributes: profile
+      -
+        name: rx-cqe-frames
+        type: u32
+      -
+        name: rx-cqe-nsecs
+        type: u32
 
    -
      name: pause-stat
@@ -2244,6 +2250,8 @@ operations:
              - tx-aggr-time-usecs
              - rx-profile
              - tx-profile
+            - rx-cqe-frames
+            - rx-cqe-nsecs
        dump: *coalesce-get-op
      -
        name: coalesce-set
Documentation/networking/ethtool-netlink.rst +2 -0
index af56c304cef4..a3e78b69fd07 100644
@@ -1072,6 +1072,8 @@ Kernel response contents:
    ``ETHTOOL_A_COALESCE_TX_AGGR_TIME_USECS``    u32     time (us), aggr, Tx
    ``ETHTOOL_A_COALESCE_RX_PROFILE``            nested  profile of DIM, Rx
    ``ETHTOOL_A_COALESCE_TX_PROFILE``            nested  profile of DIM, Tx
+  ``ETHTOOL_A_COALESCE_RX_CQE_FRAMES``         u32     max packets, Rx CQE
+  ``ETHTOOL_A_COALESCE_RX_CQE_NSECS``          u32     delay (ns), Rx CQE
    ===========================================  ======  =======================
 
  Attributes are only included in reply if their value is not zero or the

Documentation/networking/ethtool-netlink.rst well with frequent small-sized URBs transmissions. · line 1115

Quoted 9 lines
Documentation/networking/ethtool-netlink.rst +6 -0
@@ -1105,6 +1107,12 @@ well with frequent small-sized URBs transmissions.
  to DIM parameters, see `Generic Network Dynamic Interrupt Moderation (Net DIM)
  <https://www.kernel.org/doc/Documentation/networking/net_dim.rst>`_.
 
+Rx CQE coalescing allows multiple received packets to be coalesced into a single
+Completion Queue Entry (CQE). ``ETHTOOL_A_COALESCE_RX_CQE_FRAMES`` describes the
+maximum number of frames that can be coalesced into a CQE.
+``ETHTOOL_A_COALESCE_RX_CQE_NSECS`` describes max time in nanoseconds after the
+first packet arrival in a coalesced CQE to be sent.
+

I am trying to understand how generic this feature/API is. Can you please elaborate on the feature you want to configure here?

A single CQE to describe several packets?
What is the price? What per-packet information/hw offloads do you lose in the process?

For comparison, in mlx5 we have RX CQE compression, which can be applied on multiple near-identical completions that share/match several fields. Still, there is a per-packet mini-cqe with distinctive per-packet fields like csum.

Quoted 95 lines
Documentation/networking/ethtool-netlink.rst +2 -0
  COALESCE_SET
  ============
 
@@ -1143,6 +1151,8 @@ Request contents:
    ``ETHTOOL_A_COALESCE_TX_AGGR_TIME_USECS``    u32     time (us), aggr, Tx
    ``ETHTOOL_A_COALESCE_RX_PROFILE``            nested  profile of DIM, Rx
    ``ETHTOOL_A_COALESCE_TX_PROFILE``            nested  profile of DIM, Tx
+  ``ETHTOOL_A_COALESCE_RX_CQE_FRAMES``         u32     max packets, Rx CQE
+  ``ETHTOOL_A_COALESCE_RX_CQE_NSECS``          u32     delay (ns), Rx CQE
    ===========================================  ======  =======================
 
  Request is rejected if it attributes declared as unsupported by driver (i.e.
include/linux/ethtool.h +5 -1
index 798abec67a1b..25ccd2d5d4dc 100644
@@ -332,6 +332,8 @@ struct kernel_ethtool_coalesce {
  	u32 tx_aggr_max_bytes;
  	u32 tx_aggr_max_frames;
  	u32 tx_aggr_time_usecs;
+	u32 rx_cqe_frames;
+	u32 rx_cqe_nsecs;
  };
 
  /**
@@ -380,7 +382,9 @@ bool ethtool_convert_link_mode_to_legacy_u32(u32 *legacy_u32,
  #define ETHTOOL_COALESCE_TX_AGGR_TIME_USECS	BIT(26)
  #define ETHTOOL_COALESCE_RX_PROFILE		BIT(27)
  #define ETHTOOL_COALESCE_TX_PROFILE		BIT(28)
-#define ETHTOOL_COALESCE_ALL_PARAMS		GENMASK(28, 0)
+#define ETHTOOL_COALESCE_RX_CQE_FRAMES		BIT(29)
+#define ETHTOOL_COALESCE_RX_CQE_NSECS		BIT(30)
+#define ETHTOOL_COALESCE_ALL_PARAMS		GENMASK(30, 0)
 
  #define ETHTOOL_COALESCE_USECS						\
  	(ETHTOOL_COALESCE_RX_USECS | ETHTOOL_COALESCE_TX_USECS)
include/uapi/linux/ethtool_netlink_generated.h +2 -0
index 556a0c834df5..efc6e4ade77b 100644
@@ -371,6 +371,8 @@ enum {
  	ETHTOOL_A_COALESCE_TX_AGGR_TIME_USECS,
  	ETHTOOL_A_COALESCE_RX_PROFILE,
  	ETHTOOL_A_COALESCE_TX_PROFILE,
+	ETHTOOL_A_COALESCE_RX_CQE_FRAMES,
+	ETHTOOL_A_COALESCE_RX_CQE_NSECS,
 
  	__ETHTOOL_A_COALESCE_CNT,
  	ETHTOOL_A_COALESCE_MAX = (__ETHTOOL_A_COALESCE_CNT - 1)
net/ethtool/coalesce.c +13 -1
index 3e18ca1ccc5e..349bb02c517a 100644
@@ -118,6 +118,8 @@ static int coalesce_reply_size(const struct ethnl_req_info *req_base,
  	       nla_total_size(sizeof(u32)) +	/* _TX_AGGR_MAX_BYTES */
  	       nla_total_size(sizeof(u32)) +	/* _TX_AGGR_MAX_FRAMES */
  	       nla_total_size(sizeof(u32)) +	/* _TX_AGGR_TIME_USECS */
+	       nla_total_size(sizeof(u32)) +	/* _RX_CQE_FRAMES */
+	       nla_total_size(sizeof(u32)) +	/* _RX_CQE_NSECS */
  	       total_modersz * 2;		/* _{R,T}X_PROFILE */
  }
 
@@ -269,7 +271,11 @@ static int coalesce_fill_reply(struct sk_buff *skb,
  	    coalesce_put_u32(skb, ETHTOOL_A_COALESCE_TX_AGGR_MAX_FRAMES,
  			     kcoal->tx_aggr_max_frames, supported) ||
  	    coalesce_put_u32(skb, ETHTOOL_A_COALESCE_TX_AGGR_TIME_USECS,
-			     kcoal->tx_aggr_time_usecs, supported))
+			     kcoal->tx_aggr_time_usecs, supported) ||
+	    coalesce_put_u32(skb, ETHTOOL_A_COALESCE_RX_CQE_FRAMES,
+			     kcoal->rx_cqe_frames, supported) ||
+	    coalesce_put_u32(skb, ETHTOOL_A_COALESCE_RX_CQE_NSECS,
+			     kcoal->rx_cqe_nsecs, supported))
  		return -EMSGSIZE;
 
  	if (!req_base->dev || !req_base->dev->irq_moder)
@@ -338,6 +344,8 @@ const struct nla_policy ethnl_coalesce_set_policy[] = {
  	[ETHTOOL_A_COALESCE_TX_AGGR_MAX_BYTES] = { .type = NLA_U32 },
  	[ETHTOOL_A_COALESCE_TX_AGGR_MAX_FRAMES] = { .type = NLA_U32 },
  	[ETHTOOL_A_COALESCE_TX_AGGR_TIME_USECS] = { .type = NLA_U32 },
+	[ETHTOOL_A_COALESCE_RX_CQE_FRAMES] = { .type = NLA_U32 },
+	[ETHTOOL_A_COALESCE_RX_CQE_NSECS] = { .type = NLA_U32 },
  	[ETHTOOL_A_COALESCE_RX_PROFILE] =
  		NLA_POLICY_NESTED(coalesce_profile_policy),
  	[ETHTOOL_A_COALESCE_TX_PROFILE] =
@@ -570,6 +578,10 @@ __ethnl_set_coalesce(struct ethnl_req_info *req_info, struct genl_info *info,
  			 tb[ETHTOOL_A_COALESCE_TX_AGGR_MAX_FRAMES], &mod);
  	ethnl_update_u32(&kernel_coalesce.tx_aggr_time_usecs,
  			 tb[ETHTOOL_A_COALESCE_TX_AGGR_TIME_USECS], &mod);
+	ethnl_update_u32(&kernel_coalesce.rx_cqe_frames,
+			 tb[ETHTOOL_A_COALESCE_RX_CQE_FRAMES], &mod);
+	ethnl_update_u32(&kernel_coalesce.rx_cqe_nsecs,
+			 tb[ETHTOOL_A_COALESCE_RX_CQE_NSECS], &mod);
 
  	if (dev->irq_moder && dev->irq_moder->profile_flags & DIM_PROFILE_RX) {
  		ret = ethnl_update_profile(dev, &dev->irq_moder->rx_profile,
maintainer
#6 lore raw
Quoted 28 lines

-----Original Message-----
From: Tariq Toukan <[email protected]>
Sent: Tuesday, February 24, 2026 5:22 AM
To: Haiyang Zhang <[email protected]>; linux- [email protected]; [email protected]; Andrew Lunn <[email protected]>; Jakub Kicinski <[email protected]>; Donald Hunter <[email protected]>; David S. Miller <[email protected]>; Eric Dumazet <[email protected]>; Paolo Abeni <[email protected]>; Simon Horman <[email protected]>; Jonathan Corbet <[email protected]>; Shuah Khan <[email protected]>; Kory Maincent (Dent Project) <[email protected]>; Gal Pressman <[email protected]>; Oleksij Rempel <[email protected]>; Vadim Fedorenko <[email protected]>; [email protected]; [email protected]
Cc: Haiyang Zhang <[email protected]>; Paul Rosswurm <[email protected]>
Subject: [EXTERNAL] Re: [PATCH net-next] net: ethtool: add COALESCE_RX_CQE_FRAMES/NSECS parameters

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

Quoted 2 lines

+Rx CQE coalescing allows multiple received packets to be coalesced into

a single

Quoted 1 line

+Completion Queue Entry (CQE). ``ETHTOOL_A_COALESCE_RX_CQE_FRAMES``

describes the

Quoted 8 lines
Quoted 2 lines

+maximum number of frames that can be coalesced into a CQE. +``ETHTOOL_A_COALESCE_RX_CQE_NSECS`` describes max time in nanoseconds

after the

Documentation/networking/ethtool-netlink.rst well with frequent small-sized URBs transmissions. · line 1115

Quoted 2 lines
Documentation/networking/ethtool-netlink.rst +2 -0
+first packet arrival in a coalesced CQE to be sent.
+

I am trying to understand how generic this feature/API is. Can you please elaborate on the feature you want to configure here?

It's the similar feature as MLX's "RX CQE compression", which merges "multiple near-identical completions that share/match several fields." I'm adding this kAPI for any drivers that support this feature.

You may find driver details in my previous submission:
[V2,net-next,1/2] net: mana: Add support for coalesced RX packets on CQE
https://patchwork.kernel.org/project/netdevbpf/patch/[email protected]/

Quoted 1 line

A single CQE to describe several packets?

Yes, up to 4 for our MANA driver.

Quoted 1 line

What is the price?

The price is the latency can increase a bit.

Quoted 2 lines

What per-packet information/hw offloads do you lose in the process?

For example, the vlan_id is shared among up to 4 pkts. But, the pkt len & hash are per-pkt.

struct mana_rxcomp_perpkt_info {
        u32 pkt_len     : 16;
        u32 reserved1   : 16;
        u32 reserved2;
        u32 pkt_hash;
}; /* HW DATA */

/* Receive completion OOB */

struct mana_rxcomp_oob {
        struct mana_cqe_header cqe_hdr;

        u32 rx_vlan_id                  : 12;
        u32 rx_vlantag_present          : 1;
        u32 rx_outer_iphdr_csum_succeed : 1;
        u32 rx_outer_iphdr_csum_fail    : 1;
        u32 reserved1                   : 1;
        u32 rx_hashtype                 : 9;
        u32 rx_iphdr_csum_succeed       : 1;
        u32 rx_iphdr_csum_fail          : 1;
        u32 rx_tcp_csum_succeed         : 1;
        u32 rx_tcp_csum_fail            : 1;
        u32 rx_udp_csum_succeed         : 1;
        u32 rx_udp_csum_fail            : 1;
        u32 reserved2                   : 1;

        struct mana_rxcomp_perpkt_info ppi[MANA_RXCOMP_OOB_NUM_PPI];  // MANA_RXCOMP_OOB_NUM_PPI=4

        u32 rx_wqe_offset;
}; /* HW DATA */
Quoted 4 lines

For comparison, in mlx5 we have RX CQE compression, which can be applied on multiple near-identical completions that share/match several fields. Still, there is a per-packet mini-cqe with distinctive per-packet fields like csum.

As said above, we have similar "per-packet mini-cqe":
struct mana_rxcomp_perpkt_info, which has pkt len & hash.

Thanks,
- Haiyang