Skip to content

net/zxdh: optimize Rx/Tx path performance

Junlong Wang dpdk-dev 14 versions – Applied

Status from this message: Applied to next-net, with the release notes indentation fixed.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v14 Latest4 patches 1 replyApplied
  2. v134 patches 1 replySuperseded
  3. v124 patches 1 replySuperseded
Earlier versions · 11
VersionPostedPatchesRepliesStatus
v114 patches1 replySuperseded
v104 patches1 replySuperseded
v94 patches1 replySuperseded
v84 patches3 repliesSuperseded
v74 patches1 replySuperseded
v64 patches1 replySuperseded
v54 patches1 replySuperseded
v44 patches1 replySuperseded
v33 patches2 repliesSuperseded
v23 patches4 repliesSuperseded
v11 patch2 repliesSuperseded

Changes in v14 from the cover letter

- All Warnings AI review issues have been modified.
- Some info issues have been fixed, but the remaining info issues cannot be fixed for various reasons.

Patches in v14 Applied

#Subject and filesSizeRepliesApplied
1/4net/zxdh: fix queue enable intr issuesdrivers/net/zxdh/zxdh_queue.h+2 -20 replies
2/4net/zxdh: optimize queue structure to improve performancedrivers/net/zxdh/zxdh_ethdev.c drivers/net/zxdh/zxdh_pci.c drivers/net/zxdh/zxdh_pci.h +3 more+65 -1340 replies
3/4net/zxdh: optimize Rx recv pkts performancedoc/guides/rel_notes/release_26_11.rst drivers/net/zxdh/zxdh_ethdev.c drivers/net/zxdh/zxdh_ethdev_ops.c +4 more+208 -1230 replies
4/4net/zxdh: optimize Tx xmit pkts performancedoc/guides/rel_notes/release_26_11.rst drivers/net/zxdh/zxdh_ethdev.c drivers/net/zxdh/zxdh_queue.h +1 more+57 -860 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v14 yet.

Read the v14 thread

Cover letter [PATCH v14 0/4] net/zxdh: optimize Rx/Tx path performance

v14:
- All Warnings AI review issues have been modified.
- Some info issues have been fixed, but the remaining info issues cannot be fixed for various reasons.

v13:
- Patch 3/4: simplify zxdh_set_rxtx_funcs() (keep the runtime

    `ZXDH_NET_F_MRG_RXBUF` check that is always negotiated);
    remove the unused `size_bins[]` xstats (both Rx and Tx) and
    the long-dead `#ifdef QUEUE_XSTAT` body.

- Patch 4/4: the inner do { ... } while (curr_id != id) is kept (defensive backstop matching the commercial branch, run once under the desc[k].id == k invariant).

v12:
- Patch 3/4 no longer introduces the unused uint64_t offloads field in struct zxdh_virtnet_rx, and patch 4/4's commit log drops the stale "drop offloads" claim so the message matches the actual diff.

v11:
- Restructure queue types for cache locality and dead-code removal (patch 2/4), optimize the packed-ring Rx path with a single-segment fast path, MTU/scatter refactor, and xstats cleanup (patch 3/4), and rework the packed-ring Tx flush with per-descriptor mbuf free, walk budget, and masked prefetch index (patch 4/4).

v10:
- Based on the issues raised in the AI review, Patch 2/4 Patch 3/4 Patch 4/4 have been modified.

v9:
- Remove add simple Tx xmit functions (zxdh_xmit_pkts_simple) in the last patch.

v8:
- Add checked the size of ZXDH_DL_NET_HDR_SIZE and RTE_PKTMBUF_HEADROOM in zxdh_xmit_pkts_simple() before submitting. Add static_assert to reject builds with insufficient default headroom at compile time.

v7:
- Add a new xmit prepare func for xmit_pkts_simple, which will checked the size of ZXDH_DL_NET_HDR_SIZE and RTE_PKTMBUF_HEADROOM.

v6:
- Remove unnecessary error checking code in submit_to_backend_simple() and pkt_padding(). Since as the max dl_net_hdr_len is always less than RTE_PKTMBUF_HEADROOM, rte_pktmbuf_prepend() cannot fail in the simple path (single-segment mbufs).

v5:
- Reorganize patch series, placing interrupt fix as the first patch and fix condition check to properly enable interrupts.
- Fix zxdh_recv_single_pkts() not compacting rcv_pkts[] on failure, which could cause use-after-free and mbuf leak.
- Fix tx_bunch() and tx1() missing store barrier before setting AVAIL flag, preventing data race on weakly-ordered architectures.
- Fix submit_to_backend_simple() writing descriptors for packets that failed pkt_padding(), causing mbuf leak.

v4:
- fix some AI review issues.
- fix queue enable intr bug.

v3:
- remove unnecessary NULL check in zxdh_init_queue.
- Split Ring: Bit[31] is unused and reserved, zxdh_queue_notify(): removing the

    zxdh_pci_with_feature(hw, ZXDH_F_RING_PACKED) check;

- remove unnecessary double-free in in zxdh_recv_single_pkts();
- used rte_pktmbuf_mtod();
- remove rxq_get_vq(q) macro, use q->vq and apply it consistently;
- Refactoring scatter and mtu check logic in zxdh_dev_mtu_set();
- set txdp->id = avail_idx + i in tx_bunch/tx1.
- add comment documenting zxdh_xmit_enqueue_append() now sets dxp->cookie = NULL for the head slot and stores cookies per descriptor via dep[idx].cookie.
- add one-line comment noting tx_bunch() is the simple path handles single-segment.
- remove unnecessary Extra initialization and the uint32_t cast.

v2:
- zxdh_rxtx.c, pkt_padding(): modifyed the return value of pkt_padding();
- zxdh_rxtx.c, zxdh_recv_single_pkts(): modifyed When zxdh_init_mbuf() fails

    the loop does "continue" and free mbufs;
  - zxdh_rxtx.c, refill_desc_unwrap(): Add rte_io_wmb() before writing flags
    in the refill_que_descs();
  - zxdh_queue.h, zxdh_queue_enable_intr(): Remove unnecessary function of zxdh_queue_enable_intr;
  - zxdh_ethdev.c, zxdh_init_queue(): changed the hdr_mz NULL check logic;
  - zxdh_rxtx.c, zxdh_xmit_pkts_simple()、zxdh_recv_single_pkts(): add stats.bytes count;
  - zxdh_rxtx.c, zxdh_init_mbuf():remove  rte_pktmbuf_dump(stdout, rxm, 40);
  - zxdh_ethdev.c, zxdh_dev_free_mbufs(): using rte_pktmbuf_free() to free mbufs;
  - Splitting into separate patches, structure reorganization and sw_ring removal、
    RX recv optimize、Tx xmit optimize、Tx;

v1:
This patch optimizes the ZXDH PMD's receive and transmit path for better performance through several improvements:
- Add simple TX/RX burst functions (zxdh_xmit_pkts_simple and zxdh_recv_single_pkts) for single-segment packet scenarios.
- Remove RX software ring (sw_ring) to reduce memory allocation and copy.
- Optimize descriptor management with prefetching and simplified cleanup.
- Reorganize structure fields for better cache locality.

These changes reduce CPU cycles and memory bandwidth consumption, resulting in improved packet processing throughput.

Junlong Wang (4):
net/zxdh: fix queue enable intr issues
net/zxdh: optimize queue structure to improve performance net/zxdh: optimize Rx recv pkts performance net/zxdh: optimize Tx xmit pkts performance

 doc/guides/rel_notes/release_26_11.rst |   8 +
 drivers/net/zxdh/zxdh_ethdev.c         |  79 +++---
 drivers/net/zxdh/zxdh_ethdev_ops.c     |  38 ++-
 drivers/net/zxdh/zxdh_ethdev_ops.h     |   7 +
 drivers/net/zxdh/zxdh_pci.c            |  21 --
 drivers/net/zxdh/zxdh_pci.h            |   1 -
 drivers/net/zxdh/zxdh_queue.c          |  11 +-
 drivers/net/zxdh/zxdh_queue.h          | 131 ++++-----
 drivers/net/zxdh/zxdh_rxtx.c           | 350 ++++++++++++++-----------
 drivers/net/zxdh/zxdh_rxtx.h           |  15 +-
 10 files changed, 324 insertions(+), 337 deletions(-)
Signature · 1 line
2.27.0