Re: [PATCH v19 00/13] net/sxe: added Linkdata sxe ethernet driver

Stephen Hemminger
2026-03-21T17:22:14Z

On Sat, 14 Mar 2026 16:51:52 +0800
liujie5@linkdatatechnology.com wrote:

> From: Jie Liu <liujie5@linkdatatechnology.com>
>
> This patch set implements core functionality for the SXE PMD,
> including basic driver framework, data path setup, and advanced
> offload features (VLAN, RSS, DCB, PTP etc.).
>
> V19:
> - Addressed AI comments
>
> v18:
> - Addressed AI comments
>
> Jie Liu (13):
> net/sxe: add base driver directory and doc
> net/sxe: add ethdev probe and remove
> net/sxe: add tx rx setup and data path
> net/sxe: add link and mac layer operations
> net/sxe: support vlan filter
> net/sxe: add filter function
> net/sxe: support rss offload
> net/sxe: add dcb function
> net/sxe: support ptp
> net/sxe: add xstats function
> net/sxe: add custom cmd led ctrl
> net/sxe: add simd function
> net/sxe: add virtual function
>
> MAINTAINERS | 6 +
> doc/guides/nics/features/sxe.ini | 51 +
> doc/guides/nics/features/sxe_vf.ini | 37 +
> doc/guides/nics/index.rst | 1 +
> doc/guides/nics/sxe.rst | 71 +
> doc/guides/rel_notes/release_26_03.rst | 6 +
> drivers/net/meson.build | 1 +
> drivers/net/sxe/base/sxe_common.c | 45 +
> drivers/net/sxe/base/sxe_common.h | 13 +
> drivers/net/sxe/base/sxe_compat_platform.h | 73 +
> drivers/net/sxe/base/sxe_compat_version.h | 34 +
> drivers/net/sxe/base/sxe_errno.h | 61 +
> drivers/net/sxe/base/sxe_hw.c | 3271 ++++++++++++++++++++
> drivers/net/sxe/base/sxe_hw.h | 1010 ++++++
> drivers/net/sxe/base/sxe_logs.h | 105 +
> drivers/net/sxe/base/sxe_offload_common.c | 54 +
> drivers/net/sxe/base/sxe_offload_common.h | 14 +
> drivers/net/sxe/base/sxe_queue_common.c | 450 +++
> drivers/net/sxe/base/sxe_queue_common.h | 240 ++
> drivers/net/sxe/base/sxe_rx_common.c | 358 +++
> drivers/net/sxe/base/sxe_rx_common.h | 17 +
> drivers/net/sxe/base/sxe_tx_common.c | 40 +
> drivers/net/sxe/base/sxe_tx_common.h | 12 +
> drivers/net/sxe/base/sxe_types.h | 40 +
> drivers/net/sxe/base/sxevf_hw.c | 819 +++++
> drivers/net/sxe/base/sxevf_hw.h | 318 ++
> drivers/net/sxe/base/sxevf_regs.h | 119 +
> drivers/net/sxe/include/drv_msg.h | 18 +
> drivers/net/sxe/include/sxe/sxe_cli.h | 218 ++
> drivers/net/sxe/include/sxe/sxe_hdc.h | 43 +
> drivers/net/sxe/include/sxe/sxe_ioctl.h | 21 +
> drivers/net/sxe/include/sxe/sxe_msg.h | 135 +
> drivers/net/sxe/include/sxe/sxe_regs.h | 1270 ++++++++
> drivers/net/sxe/include/sxe_type.h | 795 +++++
> drivers/net/sxe/include/sxe_version.h | 29 +
> drivers/net/sxe/meson.build | 65 +
> drivers/net/sxe/pf/rte_pmd_sxe.h | 19 +
> drivers/net/sxe/pf/sxe.h | 93 +
> drivers/net/sxe/pf/sxe_dcb.c | 945 ++++++
> drivers/net/sxe/pf/sxe_dcb.h | 99 +
> drivers/net/sxe/pf/sxe_ethdev.c | 928 ++++++
> drivers/net/sxe/pf/sxe_ethdev.h | 28 +
> drivers/net/sxe/pf/sxe_filter.c | 923 ++++++
> drivers/net/sxe/pf/sxe_filter.h | 109 +
> drivers/net/sxe/pf/sxe_flow_ctrl.c | 98 +
> drivers/net/sxe/pf/sxe_flow_ctrl.h | 16 +
> drivers/net/sxe/pf/sxe_irq.c | 516 +++
> drivers/net/sxe/pf/sxe_irq.h | 48 +
> drivers/net/sxe/pf/sxe_main.c | 196 ++
> drivers/net/sxe/pf/sxe_offload.c | 336 ++
> drivers/net/sxe/pf/sxe_offload.h | 51 +
> drivers/net/sxe/pf/sxe_phy.c | 953 ++++++
> drivers/net/sxe/pf/sxe_phy.h | 117 +
> drivers/net/sxe/pf/sxe_pmd_hdc.c | 661 ++++
> drivers/net/sxe/pf/sxe_pmd_hdc.h | 42 +
> drivers/net/sxe/pf/sxe_ptp.c | 209 ++
> drivers/net/sxe/pf/sxe_ptp.h | 26 +
> drivers/net/sxe/pf/sxe_queue.c | 774 +++++
> drivers/net/sxe/pf/sxe_queue.h | 132 +
> drivers/net/sxe/pf/sxe_rx.c | 1459 +++++++++
> drivers/net/sxe/pf/sxe_rx.h | 188 ++
> drivers/net/sxe/pf/sxe_stats.c | 586 ++++
> drivers/net/sxe/pf/sxe_stats.h | 69 +
> drivers/net/sxe/pf/sxe_tx.c | 1051 +++++++
> drivers/net/sxe/pf/sxe_tx.h | 50 +
> drivers/net/sxe/pf/sxe_vec_common.h | 321 ++
> drivers/net/sxe/pf/sxe_vec_neon.c | 600 ++++
> drivers/net/sxe/pf/sxe_vec_sse.c | 622 ++++
> drivers/net/sxe/pf/sxe_vf.c | 1199 +++++++
> drivers/net/sxe/pf/sxe_vf.h | 200 ++
> drivers/net/sxe/sxe_drv_type.h | 15 +
> drivers/net/sxe/sxe_testpmd.c | 196 ++
> drivers/net/sxe/vf/sxevf.h | 42 +
> drivers/net/sxe/vf/sxevf_ethdev.c | 752 +++++
> drivers/net/sxe/vf/sxevf_ethdev.h | 16 +
> drivers/net/sxe/vf/sxevf_filter.c | 493 +++
> drivers/net/sxe/vf/sxevf_filter.h | 70 +
> drivers/net/sxe/vf/sxevf_irq.c | 432 +++
> drivers/net/sxe/vf/sxevf_irq.h | 34 +
> drivers/net/sxe/vf/sxevf_main.c | 82 +
> drivers/net/sxe/vf/sxevf_msg.c | 624 ++++
> drivers/net/sxe/vf/sxevf_msg.h | 201 ++
> drivers/net/sxe/vf/sxevf_offload.c | 30 +
> drivers/net/sxe/vf/sxevf_offload.h | 16 +
> drivers/net/sxe/vf/sxevf_queue.c | 208 ++
> drivers/net/sxe/vf/sxevf_queue.h | 69 +
> drivers/net/sxe/vf/sxevf_rx.c | 162 +
> drivers/net/sxe/vf/sxevf_rx.h | 18 +
> drivers/net/sxe/vf/sxevf_stats.c | 162 +
> drivers/net/sxe/vf/sxevf_stats.h | 31 +
> drivers/net/sxe/vf/sxevf_tx.c | 46 +
> drivers/net/sxe/vf/sxevf_tx.h | 14 +
> 92 files changed, 27237 insertions(+)
> create mode 100644 doc/guides/nics/features/sxe.ini
> create mode 100644 doc/guides/nics/features/sxe_vf.ini
> create mode 100644 doc/guides/nics/sxe.rst
> create mode 100644 drivers/net/sxe/base/sxe_common.c
> create mode 100644 drivers/net/sxe/base/sxe_common.h
> create mode 100644 drivers/net/sxe/base/sxe_compat_platform.h
> create mode 100644 drivers/net/sxe/base/sxe_compat_version.h
> create mode 100644 drivers/net/sxe/base/sxe_errno.h
> create mode 100644 drivers/net/sxe/base/sxe_hw.c
> create mode 100644 drivers/net/sxe/base/sxe_hw.h
> create mode 100644 drivers/net/sxe/base/sxe_logs.h
> create mode 100644 drivers/net/sxe/base/sxe_offload_common.c
> create mode 100644 drivers/net/sxe/base/sxe_offload_common.h
> create mode 100644 drivers/net/sxe/base/sxe_queue_common.c
> create mode 100644 drivers/net/sxe/base/sxe_queue_common.h
> create mode 100644 drivers/net/sxe/base/sxe_rx_common.c
> create mode 100644 drivers/net/sxe/base/sxe_rx_common.h
> create mode 100644 drivers/net/sxe/base/sxe_tx_common.c
> create mode 100644 drivers/net/sxe/base/sxe_tx_common.h
> create mode 100644 drivers/net/sxe/base/sxe_types.h
> create mode 100644 drivers/net/sxe/base/sxevf_hw.c
> create mode 100644 drivers/net/sxe/base/sxevf_hw.h
> create mode 100644 drivers/net/sxe/base/sxevf_regs.h
> create mode 100644 drivers/net/sxe/include/drv_msg.h
> create mode 100644 drivers/net/sxe/include/sxe/sxe_cli.h
> create mode 100644 drivers/net/sxe/include/sxe/sxe_hdc.h
> create mode 100644 drivers/net/sxe/include/sxe/sxe_ioctl.h
> create mode 100644 drivers/net/sxe/include/sxe/sxe_msg.h
> create mode 100644 drivers/net/sxe/include/sxe/sxe_regs.h
> create mode 100644 drivers/net/sxe/include/sxe_type.h
> create mode 100644 drivers/net/sxe/include/sxe_version.h
> create mode 100644 drivers/net/sxe/meson.build
> create mode 100644 drivers/net/sxe/pf/rte_pmd_sxe.h
> create mode 100644 drivers/net/sxe/pf/sxe.h
> create mode 100644 drivers/net/sxe/pf/sxe_dcb.c
> create mode 100644 drivers/net/sxe/pf/sxe_dcb.h
> create mode 100644 drivers/net/sxe/pf/sxe_ethdev.c
> create mode 100644 drivers/net/sxe/pf/sxe_ethdev.h
> create mode 100644 drivers/net/sxe/pf/sxe_filter.c
> create mode 100644 drivers/net/sxe/pf/sxe_filter.h
> create mode 100644 drivers/net/sxe/pf/sxe_flow_ctrl.c
> create mode 100644 drivers/net/sxe/pf/sxe_flow_ctrl.h
> create mode 100644 drivers/net/sxe/pf/sxe_irq.c
> create mode 100644 drivers/net/sxe/pf/sxe_irq.h
> create mode 100644 drivers/net/sxe/pf/sxe_main.c
> create mode 100644 drivers/net/sxe/pf/sxe_offload.c
> create mode 100644 drivers/net/sxe/pf/sxe_offload.h
> create mode 100644 drivers/net/sxe/pf/sxe_phy.c
> create mode 100644 drivers/net/sxe/pf/sxe_phy.h
> create mode 100644 drivers/net/sxe/pf/sxe_pmd_hdc.c
> create mode 100644 drivers/net/sxe/pf/sxe_pmd_hdc.h
> create mode 100644 drivers/net/sxe/pf/sxe_ptp.c
> create mode 100644 drivers/net/sxe/pf/sxe_ptp.h
> create mode 100644 drivers/net/sxe/pf/sxe_queue.c
> create mode 100644 drivers/net/sxe/pf/sxe_queue.h
> create mode 100644 drivers/net/sxe/pf/sxe_rx.c
> create mode 100644 drivers/net/sxe/pf/sxe_rx.h
> create mode 100644 drivers/net/sxe/pf/sxe_stats.c
> create mode 100644 drivers/net/sxe/pf/sxe_stats.h
> create mode 100644 drivers/net/sxe/pf/sxe_tx.c
> create mode 100644 drivers/net/sxe/pf/sxe_tx.h
> create mode 100644 drivers/net/sxe/pf/sxe_vec_common.h
> create mode 100644 drivers/net/sxe/pf/sxe_vec_neon.c
> create mode 100644 drivers/net/sxe/pf/sxe_vec_sse.c
> create mode 100644 drivers/net/sxe/pf/sxe_vf.c
> create mode 100644 drivers/net/sxe/pf/sxe_vf.h
> create mode 100644 drivers/net/sxe/sxe_drv_type.h
> create mode 100644 drivers/net/sxe/sxe_testpmd.c
> create mode 100644 drivers/net/sxe/vf/sxevf.h
> create mode 100644 drivers/net/sxe/vf/sxevf_ethdev.c
> create mode 100644 drivers/net/sxe/vf/sxevf_ethdev.h
> create mode 100644 drivers/net/sxe/vf/sxevf_filter.c
> create mode 100644 drivers/net/sxe/vf/sxevf_filter.h
> create mode 100644 drivers/net/sxe/vf/sxevf_irq.c
> create mode 100644 drivers/net/sxe/vf/sxevf_irq.h
> create mode 100644 drivers/net/sxe/vf/sxevf_main.c
> create mode 100644 drivers/net/sxe/vf/sxevf_msg.c
> create mode 100644 drivers/net/sxe/vf/sxevf_msg.h
> create mode 100644 drivers/net/sxe/vf/sxevf_offload.c
> create mode 100644 drivers/net/sxe/vf/sxevf_offload.h
> create mode 100644 drivers/net/sxe/vf/sxevf_queue.c
> create mode 100644 drivers/net/sxe/vf/sxevf_queue.h
> create mode 100644 drivers/net/sxe/vf/sxevf_rx.c
> create mode 100644 drivers/net/sxe/vf/sxevf_rx.h
> create mode 100644 drivers/net/sxe/vf/sxevf_stats.c
> create mode 100644 drivers/net/sxe/vf/sxevf_stats.h
> create mode 100644 drivers/net/sxe/vf/sxevf_tx.c
> create mode 100644 drivers/net/sxe/vf/sxevf_tx.h
>

More observations with wordy AI information:

The base layer has several problematic patterns where it pulls in raw
POSIX/libc syscalls instead of using DPDK's own abstractions. This
matters because DPDK abstractions exist specifically to handle
portability (Windows support), to integrate with the EAL runtime model,
and to avoid surprising behavior in a userspace poll-mode environment.

Here's what I found:

clock_gettime(CLOCK_MONOTONIC) in sxe_common.c — Used by
sxe_time_get_real_ms() to get a millisecond timestamp that's sent to
firmware via the HDC time sync command. DPDK provides
rte_get_timer_cycles() and rte_get_timer_hz() for exactly this purpose.
If wall-clock time is specifically needed for the firmware protocol (as
opposed to monotonic elapsed time), that's a slightly different
situation, but the function name says "real ms" and it uses
CLOCK_MONOTONIC, so rte_get_timer_cycles() / (rte_get_timer_hz() /
1000) is a direct replacement.

clock_gettime(CLOCK_REALTIME) in the PTP code (patch 09) — This one is
for PTP initialization, where wall-clock time is arguably needed. But
DPDK's rte_timespec_get() (or even just using the PTP hardware clock
directly) would be more appropriate than a raw syscall.

pthread_sigmask() / sigaddset() / sigemptyset() in sxe_pmd_hdc.c — The
HDC command path blocks SIGINT/SIGTERM during firmware transactions to
avoid being interrupted mid-protocol. This is a Linux-specific pattern
and won't work on other platforms. More fundamentally, DPDK drivers
shouldn't need to manipulate signal masks — the EAL owns signal
handling. If the concern is that a firmware transaction must complete
atomically, the proper approach is to not use signals for cancellation
in the first place. In DPDK's model, control operations run on the main
thread which is not expected to receive asynchronous signals during
normal operation.

gettimeofday() / localtime() / strftime() in the TIME() macro in
sxe_logs.h — This macro is defined but appears unused, which is good
because gettimeofday is a syscall and localtime is not thread-safe. It
should just be removed. The RTE_LOG infrastructure already handles
timestamps.

#include <pthread.h> in sxe_common.c and sxe_logs.h — These includes
appear to be unnecessary leftovers. sxe_common.c doesn't use any
pthread functions (the trace_id uses rte_atomic). sxe_logs.h includes
pthread.h but doesn't use it either — presumably it was for a
pthread_self() call in a logging macro that was removed.

pthread_t and pthread_barrier_t in VF adapter struct (patch 12) — These
are declared in the struct but never used in the patch. If they're
intended for a link-check thread, the DPDK equivalent is
rte_thread_create_internal_control() with rte_thread_t.

The usleep_range() / mdelay() / msleep() macros in
sxe_compat_platform.h — These are defined as wrappers around
rte_delay_us / rte_delay_ms, which is the right approach. But the macro
names are Linux kernel conventions (usleep_range, mdelay, msleep),
which suggests this base code was ported from a kernel driver. While
the macros themselves map to DPDK functions, the kernel-style naming
throughout the base layer is a signal that the port wasn't fully
adapted to DPDK conventions.

The overall pattern is that this base/ directory looks like a kernel
driver compat layer that was mechanically ported — the Linux-isms
(__iomem, __force, usleep_range, mdelay, BIT(), ARRAY_SIZE(),
kernel-style type names) are papered over with macros, but some raw
POSIX calls leaked through. The driver would be cleaner if the base
layer used DPDK APIs directly rather than maintaining a Linux kernel
compatibility shim.