Re: [PATCH net-next v1] net/mlx5e: TX, Do not open a multi-packet WQE for a single packet

From: Xuanqiang Luo

Date: Wed Nov 18 2026 - 22:06:18 EST


On 2026/11/18 at 20:14 Tariq Toukan wrote:


On 17/11/2026 10:50, Xuanqiang Luo wrote:
From: Xuanqiang Luo <luoxuanqiang@xxxxxxxxxx>


[...]

@@ -678,11 +679,13 @@ netdev_tx_t mlx5e_xmit(struct sk_buff *skb, struct net_device *dev)
      mlx5e_sq_xmit_prepare(sq, skb, &accel, &attr);
      if (test_bit(MLX5E_SQ_STATE_MPWQE, &sq->state)) {
-        if (mlx5e_tx_skb_supports_mpwqe(skb, &attr)) {
+        /* An MPWQE for a lone packet saves nothing, use a regular WQE. */
+        if (mlx5e_tx_skb_supports_mpwqe(skb, &attr) &&
+            (xmit_more || mlx5e_tx_mpwqe_session_is_active(sq))) {

I'd swap the two conditions:

    if ((xmit_more || mlx5e_tx_mpwqe_session_is_active(sq)) &&
        mlx5e_tx_skb_supports_mpwqe(skb, &attr)) {

A lone packet, which is the case you optimize, then skips the skb checks, and it reads in the natural order: is there a batch to join, and can this skb join it.


Makes sense, thanks for the suggestion. I will swap the conditions in v2.

Also, it's be nice if you could test for traffic that goes through the stack, for example UDP_RR / TCP_RR and a UDP stream with netperf, in addition to pktgen.

I will run the tests again with the new code, including the ones you
mentioned.

Thanks!
Xuanqiang