On Tue, 19 May 2026 11:01:21 +0800
[email protected] wrote:
> From: Jie Liu <[email protected]>
>
> This patch set addresses the feedback received on the v10 submission
> for the sxe2 PMD. The primary focus is on fixing vector path selection,
> ensuring memory safety during mbuf initialization, and cleaning up
> redundant logic in the configuration functions.
>
> v17 Changes:
> - Fixed vector Rx burst function being overwritten by scalar selection.
> - Refactored Rx/Tx mode set functions to seed flags from caps first,
> eliminating tautological checks.
> - Added memset for mbuf_def in vector init to avoid uninitialized reads.
> - Converted pci_map_addr_info to designated initializers.
> - Removed dead Windows-only code in meson.build.
> - Added NULL checks for mbuf free for driver-wide consistency.
> - Updated burst_mode_get to accurately report AVX paths.
> - Adjusted SXE2_ETH_OVERHEAD to match actual VLAN capabilities.
>
> Jie Liu (11):
> mailmap: add Jie Liu
> doc: add sxe2 guide and release notes
> common/sxe2: add sxe2 basic structures
> drivers: add base driver skeleton
> drivers: add base driver probe skeleton
> drivers: support PCI BAR mapping
> common/sxe2: add ioctl interface for DMA map and unmap
> net/sxe2: support queue setup and control
> drivers: add data path for Rx and Tx
> net/sxe2: add vectorized Rx and Tx
> net/sxe2: implement Tx done cleanup
>
> .mailmap | 1 +
> doc/guides/nics/features/sxe2.ini | 29 +
> doc/guides/nics/index.rst | 1 +
> doc/guides/nics/sxe2.rst | 34 +
> doc/guides/rel_notes/release_26_07.rst | 4 +
> drivers/common/sxe2/meson.build | 15 +
> drivers/common/sxe2/sxe2_common.c | 683 +++++++++++++
> drivers/common/sxe2/sxe2_common.h | 85 ++
> drivers/common/sxe2/sxe2_common_log.h | 81 ++
> drivers/common/sxe2/sxe2_host_regs.h | 707 +++++++++++++
> drivers/common/sxe2/sxe2_internal_ver.h | 33 +
> drivers/common/sxe2/sxe2_ioctl_chnl.c | 325 ++++++
> drivers/common/sxe2/sxe2_ioctl_chnl.h | 130 +++
> drivers/common/sxe2/sxe2_ioctl_chnl_func.h | 62 ++
> drivers/common/sxe2/sxe2_osal.h | 153 +++
> drivers/meson.build | 1 +
> drivers/net/meson.build | 1 +
> drivers/net/sxe2/meson.build | 32 +
> drivers/net/sxe2/sxe2_cmd_chnl.c | 323 ++++++
> drivers/net/sxe2/sxe2_cmd_chnl.h | 37 +
> drivers/net/sxe2/sxe2_drv_cmd.h | 388 ++++++++
> drivers/net/sxe2/sxe2_ethdev.c | 968 ++++++++++++++++++
> drivers/net/sxe2/sxe2_ethdev.h | 318 ++++++
> drivers/net/sxe2/sxe2_irq.h | 48 +
> drivers/net/sxe2/sxe2_queue.c | 66 ++
> drivers/net/sxe2/sxe2_queue.h | 195 ++++
> drivers/net/sxe2/sxe2_rx.c | 554 +++++++++++
> drivers/net/sxe2/sxe2_rx.h | 32 +
> drivers/net/sxe2/sxe2_tx.c | 420 ++++++++
> drivers/net/sxe2/sxe2_tx.h | 32 +
> drivers/net/sxe2/sxe2_txrx.c | 351 +++++++
> drivers/net/sxe2/sxe2_txrx.h | 23 +
> drivers/net/sxe2/sxe2_txrx_common.h | 540 ++++++++++
> drivers/net/sxe2/sxe2_txrx_poll.c | 1044 ++++++++++++++++++++
> drivers/net/sxe2/sxe2_txrx_poll.h | 20 +
> drivers/net/sxe2/sxe2_txrx_vec.c | 201 ++++
> drivers/net/sxe2/sxe2_txrx_vec.h | 63 ++
> drivers/net/sxe2/sxe2_txrx_vec_common.h | 235 +++++
> drivers/net/sxe2/sxe2_txrx_vec_sse.c | 549 ++++++++++
> drivers/net/sxe2/sxe2_vsi.c | 214 ++++
> drivers/net/sxe2/sxe2_vsi.h | 204 ++++
> 41 files changed, 9202 insertions(+)
> create mode 100644 doc/guides/nics/features/sxe2.ini
> create mode 100644 doc/guides/nics/sxe2.rst
> create mode 100644 drivers/common/sxe2/meson.build
> create mode 100644 drivers/common/sxe2/sxe2_common.c
> create mode 100644 drivers/common/sxe2/sxe2_common.h
> create mode 100644 drivers/common/sxe2/sxe2_common_log.h
> create mode 100644 drivers/common/sxe2/sxe2_host_regs.h
> create mode 100644 drivers/common/sxe2/sxe2_internal_ver.h
> create mode 100644 drivers/common/sxe2/sxe2_ioctl_chnl.c
> create mode 100644 drivers/common/sxe2/sxe2_ioctl_chnl.h
> create mode 100644 drivers/common/sxe2/sxe2_ioctl_chnl_func.h
> create mode 100644 drivers/common/sxe2/sxe2_osal.h
> create mode 100644 drivers/net/sxe2/meson.build
> create mode 100644 drivers/net/sxe2/sxe2_cmd_chnl.c
> create mode 100644 drivers/net/sxe2/sxe2_cmd_chnl.h
> create mode 100644 drivers/net/sxe2/sxe2_drv_cmd.h
> create mode 100644 drivers/net/sxe2/sxe2_ethdev.c
> create mode 100644 drivers/net/sxe2/sxe2_ethdev.h
> create mode 100644 drivers/net/sxe2/sxe2_irq.h
> create mode 100644 drivers/net/sxe2/sxe2_queue.c
> create mode 100644 drivers/net/sxe2/sxe2_queue.h
> create mode 100644 drivers/net/sxe2/sxe2_rx.c
> create mode 100644 drivers/net/sxe2/sxe2_rx.h
> create mode 100644 drivers/net/sxe2/sxe2_tx.c
> create mode 100644 drivers/net/sxe2/sxe2_tx.h
> create mode 100644 drivers/net/sxe2/sxe2_txrx.c
> create mode 100644 drivers/net/sxe2/sxe2_txrx.h
> create mode 100644 drivers/net/sxe2/sxe2_txrx_common.h
> create mode 100644 drivers/net/sxe2/sxe2_txrx_poll.c
> create mode 100644 drivers/net/sxe2/sxe2_txrx_poll.h
> create mode 100644 drivers/net/sxe2/sxe2_txrx_vec.c
> create mode 100644 drivers/net/sxe2/sxe2_txrx_vec.h
> create mode 100644 drivers/net/sxe2/sxe2_txrx_vec_common.h
> create mode 100644 drivers/net/sxe2/sxe2_txrx_vec_sse.c
> create mode 100644 drivers/net/sxe2/sxe2_vsi.c
> create mode 100644 drivers/net/sxe2/sxe2_vsi.h
>
Overall I am pleased with this and no AI review feedback.
But noticed some discrepancy between documentation and implementation
around feature; so asked AI to double check that.
Addendum to v17 review: features matrix vs code
================================================
Patch 02/11: doc: add sxe2 guide and release notes
--------------------------------------------------
The doc/guides/nics/features/sxe2.ini file claims a number of
features that the code does not implement. Cross-referencing
each "Y"/"P" line against drivers/net/sxe2/sxe2_ethdev.c
(sxe2_dev_info_init) and the final dev_ops table:
VLAN offload = Y
Neither RTE_ETH_RX_OFFLOAD_VLAN_STRIP,
RTE_ETH_RX_OFFLOAD_VLAN_FILTER, nor
RTE_ETH_TX_OFFLOAD_VLAN_INSERT is in dev_info->rx_offload_capa
or dev_info->tx_offload_capa. Applications cannot request
these offloads. No .vlan_offload_set, .vlan_filter_set,
.vlan_strip_queue_set, or .vlan_tpid_set callbacks are
registered. The only references to the VLAN offload macros
are inside SXE2_RX_VEC_SUPPORT_OFFLOAD / SXE2_TX_VEC_SUPPORT_OFFLOAD
(the vector-path allow-list), where they are filtered, not
advertised.
QinQ offload = P
No RTE_ETH_RX_OFFLOAD_QINQ_STRIP / RTE_ETH_TX_OFFLOAD_QINQ_INSERT
in offload_capa. The Tx path does handle RTE_MBUF_F_TX_QINQ
in the descriptor builder, but with no offload-capability
advertisement an application has no way to request it.
Timestamp offload = P
RTE_ETH_RX_OFFLOAD_TIMESTAMP is not in rx_offload_capa.
No .timesync_enable / disable / read_rx_timestamp /
read_tx_timestamp / adjust_time / read_time / write_time
callbacks are registered. The only occurrence of the
timestamp offload symbol is inside SXE2_RX_VEC_NO_SUPPORT_OFFLOAD
(i.e. the list of things the vector path filters out).
FreeBSD = Y
drivers/common/sxe2/meson.build and drivers/net/sxe2/meson.build
set "reason = 'only supported on Linux'" when excluding
Windows. doc/guides/nics/sxe2.rst states the PMD "is
designed to operate alongside the sxe2 kernel network driver"
and "communicates with the kernel driver via ioctl
interfaces" — that kernel driver exists only for Linux.
Either (a) drop "FreeBSD = Y" and gate the meson build with
"if not is_linux: build = false", or (b) provide a FreeBSD
kernel companion and update the meson reason string.
Inner L3 checksum = P
Inner L4 checksum = P
These could plausibly map to RTE_ETH_TX_OFFLOAD_OUTER_IPV4_CKSUM
/ RTE_ETH_TX_OFFLOAD_OUTER_UDP_CKSUM (which are in
tx_offload_capa) plus the TNL_TSO offloads. Worth confirming
the mapping is what is intended.
What the matrix gets right (verified):
Fast mbuf free = P -> RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE
advertised in tx_offload_capa.
Free Tx mbuf on demand = Y -> .tx_done_cleanup registered
(patch 11).
Burst mode info = Y -> .rx_burst_mode_get and
.tx_burst_mode_get registered.
Queue start/stop = Y -> .{rx,tx}_queue_{start,stop}
registered.
Buffer split on Rx = P -> RTE_ETH_RX_OFFLOAD_BUFFER_SPLIT
in rx_offload_capa.
Scattered Rx = Y -> sxe2_rx_pkts_scattered{,_split}
burst functions present.
CRC offload = Y -> RTE_ETH_RX_OFFLOAD_KEEP_CRC in
rx_offload_capa.
L3 checksum offload = Y -> IPV4_CKSUM (rx+tx) in offload_capa.
L4 checksum offload = Y -> TCP/UDP_CKSUM (rx+tx) in
offload_capa.
Rx descriptor status = Y -> dev->rx_descriptor_status set
(typo'd name "sxe2_rx_desciptor_status"
— missing 'r' — but functionally
wired up).
Tx descriptor status = Y -> same; sxe2_tx_desciptor_status
with the same typo.
Suggested fix
-------------
For the v18, please either:
(1) Add the missing offload bits (VLAN_STRIP, VLAN_FILTER,
VLAN_INSERT, QINQ_STRIP, QINQ_INSERT, RX_TIMESTAMP) to
offload_capa and implement the corresponding callbacks; or
(2) Drop the corresponding rows ("VLAN offload",
"QinQ offload", "Timestamp offload") from sxe2.ini to "N"
or remove them entirely.
Also rename sxe2_{rx,tx}_desciptor_status -> _descriptor_status
to match the dev_ops field name, and decide what to do about
the FreeBSD / Linux-only contradiction.