From: Stephen Hemminger <stephen@networkplumber.org>
To: liujie5@linkdatatechnology.com
Cc: dev@dpdk.org
Subject: Re: [PATCH v15 00/11] net/sxe2: fix logic errors and address feedback
Date: Sun, 17 May 2026 17:02:33 -0700 [thread overview]
Message-ID: <20260517170233.66915942@phoenix.local> (raw)
In-Reply-To: <20260516074618.2343883-1-liujie5@linkdatatechnology.com>
On Sat, 16 May 2026 15:46:07 +0800
liujie5@linkdatatechnology.com wrote:
> From: Jie Liu <liujie5@linkdatatechnology.com>
>
> 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.
Driver is in much better shape now.
AI is still finding a few things.
Review of [PATCH v15 00/11] sxe2 PMD
====================================
Overall comments
----------------
Most of the issues called out in the v13 review have been
addressed in v15:
- Inverted "if (!ret)" error checks in sxe2_dev_pci_map_init()
are now "if (ret)".
- Non-ASCII characters in sxe2_net_map_addr_info_pf[] removed.
- rte_ticketlock_t around blocking ioctl() replaced with
pthread_mutex_t.
- Driver-private u8/s8/u16/... typedefs, __le*/__be* aliases,
sxe2_errno.h, STATIC macro, and the reinvented
LIST_FOR_EACH_ENTRY / COMPILER_BARRIER / sxe2_*_lock /
udelay/mdelay/msleep / __iomem / IS_ERR helpers are gone.
- "MTU update = Y" claim in the features matrix dropped;
"Free Tx mbuf on demand = Y" is now backed by the new
.tx_done_cleanup callback added in patch 11.
- Redundant queue_idx bounds checks at the top of
rx_queue_setup / tx_queue_setup removed.
- "reseted" log-message typo fixed.
What remains:
Patch 11/11: net/sxe2: implement Tx done cleanup
------------------------------------------------
Error: NULL pointer dereference of tx_queue parameter.
sxe2_tx_done_cleanup() dereferences txq before checking it for
NULL:
int32_t sxe2_tx_done_cleanup(void *tx_queue, uint32_t free_cnt)
{
struct sxe2_tx_queue *txq = (struct sxe2_tx_queue *)tx_queue;
struct sxe2_adapter *adapter = txq->vsi->adapter; /* segfault if txq == NULL */
int32_t ret;
if (txq == NULL) { /* too late */
ret = 0;
goto l_end;
}
...
The NULL check must run before any field access:
struct sxe2_tx_queue *txq = tx_queue;
struct sxe2_adapter *adapter;
if (txq == NULL)
return 0;
adapter = txq->vsi->adapter;
...
Patch 03/10 -> 09/10: vector mode probe gated on RTE_PROC_PRIMARY
-----------------------------------------------------------------
Warning: sxe2_rx_mode_func_set() runs the vector capability probe
only in the primary process:
if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
ret = sxe2_rx_vec_support_check(dev, &vec_flags);
...
}
but sxe2_dev_init() calls sxe2_rx_mode_func_set(dev) and
sxe2_tx_mode_func_set(dev) from the secondary-process branch as
well. In a secondary, the vector probe is skipped, rx_mode_flags
stays 0, and dev->rx_pkt_burst lands on
sxe2_rx_pkts_scattered{,_split}. Since dev->rx_pkt_burst is
per-rte_eth_dev and re-written by whichever process attaches
last, the effective Rx burst mode depends on attach ordering.
The same pattern was flagged in v13 and is unchanged in v15.
Either run the same probe in secondaries, or share the primary's
decision through rte_eth_dev_data so secondaries inherit it.
Patch 03/10: common/sxe2: add sxe2 basic structures
---------------------------------------------------
Warning: macro identifier BITS_TO_uint32_t in sxe2_osal.h. This
is the visible result of a wholesale "u32 -> uint32_t" rename
applied to identifier text without manual review. The macro is
unused in the rest of the driver (the only mentions are the
definition itself and a later rename of the right-hand side),
so the cleanest fix is to delete it. If a "bits to 32-bit-word
count" macro is wanted later, name it BITS_TO_U32 or use
RTE_DIM/RTE_ALIGN_MUL_CEIL idioms.
Patch 09/11: drivers: add data path for Rx and Tx
-------------------------------------------------
Info: in sxe2_tx_pkts() the exit chain remains
l_exit_logic:
if (tx_num == 0)
goto l_end;
goto l_end_of_tx;
l_end_of_tx:
SXE2_PCI_REG_WRITE_WC(...);
The unconditional "goto l_end_of_tx;" immediately before the
"l_end_of_tx:" label is dead — fall through. The same pattern
appears in sxe2_rx_mode_func_set() at the end:
dev->rx_pkt_burst = sxe2_rx_pkts_scattered;
goto l_end;
l_end:
PMD_LOG_DEBUG(...);
Both can simply be deleted.
Series hygiene
--------------
Info: several identifiers are introduced with typos in one patch
and corrected in a later patch within the same series:
- sxe2_commoin_inited (patch 03) -> sxe2_common_inited (patch 05)
- sxe2_drv_dev_handshark (patch 03) -> sxe2_drv_dev_handshke
(patch 04). The renamed form is still a typo (missing 'a'
between 'h' and 'k'). Log strings around it were corrected
to "handshake" in patch 05; the function name was not.
- Dead "if (ret != 0)" after two void-returning
sxe2_{rx,tx}_mode_func_set() calls is added in patch 08 and
removed again in patch 09.
Each commit needs to be independently correct so that "git
bisect" lands on meaningful states. Renaming an exported
internal symbol (RTE_EXPORT_INTERNAL_SYMBOL(sxe2_drv_dev_handshke))
mid-series also churns the auto-generated version map. Please
collapse these into the patches that introduce the names, and
fix sxe2_drv_dev_handshke -> sxe2_drv_dev_handshake.
next prev parent reply other threads:[~2026-05-18 0:02 UTC|newest]
Thread overview: 85+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-14 2:01 [PATCH v13 0/5] Support add/remove memory region and get-max-slots pravin.bathija
2026-05-14 2:01 ` [PATCH v13 1/5] vhost: add user to mailmap and define to vhost hdr pravin.bathija
2026-05-14 2:01 ` [PATCH v13 2/5] vhost_user: header defines for add/rem mem region pravin.bathija
2026-05-14 2:01 ` [PATCH v13 3/5] vhost_user: support function defines for back-end pravin.bathija
2026-05-14 2:01 ` [PATCH v13 4/5] vhost_user: Function defs for add/rem mem regions pravin.bathija
2026-05-14 2:01 ` [PATCH v13 5/5] vhost_user: enable configure memory slots pravin.bathija
2026-05-16 2:55 ` [PATCH v14 00/11] net/sxe2: fix logic errors and address feedback liujie5
2026-05-16 2:55 ` [PATCH v14 01/11] mailmap: add Jie Liu liujie5
2026-05-16 2:55 ` [PATCH v14 02/11] doc: add sxe2 guide and release notes liujie5
2026-05-16 2:55 ` [PATCH v14 03/11] common/sxe2: add sxe2 basic structures liujie5
2026-05-16 2:55 ` [PATCH v14 04/11] drivers: add base driver skeleton liujie5
2026-05-16 2:55 ` [PATCH v14 05/11] drivers: add base driver probe skeleton liujie5
2026-05-16 2:55 ` [PATCH v14 06/11] drivers: support PCI BAR mapping liujie5
2026-05-16 2:55 ` [PATCH v14 07/11] common/sxe2: add ioctl interface for DMA map and unmap liujie5
2026-05-16 2:55 ` [PATCH v14 08/11] net/sxe2: support queue setup and control liujie5
2026-05-16 2:55 ` [PATCH v14 09/11] drivers: add data path for Rx and Tx liujie5
2026-05-16 2:55 ` [PATCH v14 10/11] net/sxe2: add vectorized " liujie5
2026-05-16 2:55 ` [PATCH v14 11/11] net/sxe2: implement Tx done cleanup liujie5
2026-05-16 7:46 ` [PATCH v15 00/11] net/sxe2: fix logic errors and address feedback liujie5
2026-05-16 7:46 ` [PATCH v15 01/11] mailmap: add Jie Liu liujie5
2026-05-16 7:46 ` [PATCH v15 02/11] doc: add sxe2 guide and release notes liujie5
2026-05-16 7:46 ` [PATCH v15 03/11] common/sxe2: add sxe2 basic structures liujie5
2026-05-16 7:46 ` [PATCH v15 04/11] drivers: add base driver skeleton liujie5
2026-05-16 7:46 ` [PATCH v15 05/11] drivers: add base driver probe skeleton liujie5
2026-05-16 7:46 ` [PATCH v15 06/11] drivers: support PCI BAR mapping liujie5
2026-05-16 7:46 ` [PATCH v15 07/11] common/sxe2: add ioctl interface for DMA map and unmap liujie5
2026-05-16 7:46 ` [PATCH v15 08/11] net/sxe2: support queue setup and control liujie5
2026-05-16 7:46 ` [PATCH v15 09/11] drivers: add data path for Rx and Tx liujie5
2026-05-16 7:46 ` [PATCH v15 10/11] net/sxe2: add vectorized " liujie5
2026-05-16 7:46 ` [PATCH v15 11/11] net/sxe2: implement Tx done cleanup liujie5
2026-05-18 9:13 ` [PATCH v16 00/11] net/sxe2: fix logic errors and address feedback liujie5
2026-05-18 9:13 ` [PATCH v16 01/11] mailmap: add Jie Liu liujie5
2026-05-18 9:13 ` [PATCH v16 02/11] doc: add sxe2 guide and release notes liujie5
2026-05-18 9:13 ` [PATCH v16 03/11] common/sxe2: add sxe2 basic structures liujie5
2026-05-18 9:13 ` [PATCH v16 04/11] drivers: add base driver skeleton liujie5
2026-05-18 9:13 ` [PATCH v16 05/11] drivers: add base driver probe skeleton liujie5
2026-05-18 9:14 ` [PATCH v16 06/11] drivers: support PCI BAR mapping liujie5
2026-05-18 9:14 ` [PATCH v16 07/11] common/sxe2: add ioctl interface for DMA map and unmap liujie5
2026-05-18 9:14 ` [PATCH v16 08/11] net/sxe2: support queue setup and control liujie5
2026-05-18 9:14 ` [PATCH v16 09/11] drivers: add data path for Rx and Tx liujie5
2026-05-18 9:14 ` [PATCH v16 10/11] net/sxe2: add vectorized " liujie5
2026-05-18 9:14 ` [PATCH v16 11/11] net/sxe2: implement Tx done cleanup liujie5
2026-05-19 3:01 ` [PATCH v17 00/11] net/sxe2: fix logic errors and address feedback liujie5
2026-05-19 3:01 ` [PATCH v17 01/11] mailmap: add Jie Liu liujie5
2026-05-19 3:01 ` [PATCH v17 02/11] doc: add sxe2 guide and release notes liujie5
2026-05-19 3:01 ` [PATCH v17 03/11] common/sxe2: add sxe2 basic structures liujie5
2026-05-19 3:01 ` [PATCH v17 04/11] drivers: add base driver skeleton liujie5
2026-05-19 3:01 ` [PATCH v17 05/11] drivers: add base driver probe skeleton liujie5
2026-05-19 3:01 ` [PATCH v17 06/11] drivers: support PCI BAR mapping liujie5
2026-05-19 3:01 ` [PATCH v17 07/11] common/sxe2: add ioctl interface for DMA map and unmap liujie5
2026-05-19 17:41 ` Stephen Hemminger
2026-05-19 3:01 ` [PATCH v17 08/11] net/sxe2: support queue setup and control liujie5
2026-05-19 3:01 ` [PATCH v17 09/11] drivers: add data path for Rx and Tx liujie5
2026-05-19 3:01 ` [PATCH v17 10/11] net/sxe2: add vectorized " liujie5
2026-05-19 3:01 ` [PATCH v17 11/11] net/sxe2: implement Tx done cleanup liujie5
2026-05-19 14:47 ` [PATCH v18 00/11] net/sxe2: fix logic errors and address feedback liujie5
2026-05-19 14:48 ` [PATCH v18 01/11] mailmap: add Jie Liu liujie5
2026-05-19 14:48 ` [PATCH v18 02/11] doc: add sxe2 guide and release notes liujie5
2026-05-19 14:48 ` [PATCH v18 03/11] common/sxe2: add sxe2 basic structures liujie5
2026-05-19 14:48 ` [PATCH v18 04/11] drivers: add base driver skeleton liujie5
2026-05-19 14:48 ` [PATCH v18 05/11] drivers: add base driver probe skeleton liujie5
2026-05-19 14:48 ` [PATCH v18 06/11] drivers: support PCI BAR mapping liujie5
2026-05-19 14:48 ` [PATCH v18 07/11] common/sxe2: add ioctl interface for DMA map and unmap liujie5
2026-05-19 14:48 ` [PATCH v18 08/11] net/sxe2: support queue setup and control liujie5
2026-05-19 14:48 ` [PATCH v18 09/11] drivers: add data path for Rx and Tx liujie5
2026-05-19 14:48 ` [PATCH v18 10/11] net/sxe2: add vectorized " liujie5
2026-05-19 14:48 ` [PATCH v18 11/11] net/sxe2: implement Tx done cleanup liujie5
2026-05-20 2:17 ` [PATCH v19 00/11]net/sxe2: fix logic errors and address feedback liujie5
2026-05-20 2:17 ` [PATCH v19 01/11] mailmap: add Jie Liu liujie5
2026-05-20 2:18 ` [PATCH v19 02/11] doc: add sxe2 guide and release notes liujie5
2026-05-20 2:18 ` [PATCH v19 03/11] common/sxe2: add sxe2 basic structures liujie5
2026-05-20 2:18 ` [PATCH v19 04/11] drivers: add base driver skeleton liujie5
2026-05-20 2:18 ` [PATCH v19 05/11] drivers: add base driver probe skeleton liujie5
2026-05-20 2:18 ` [PATCH v19 06/11] drivers: support PCI BAR mapping liujie5
2026-05-20 2:18 ` [PATCH v19 07/11] common/sxe2: add ioctl interface for DMA map and unmap liujie5
2026-05-20 2:18 ` [PATCH v19 08/11] net/sxe2: support queue setup and control liujie5
2026-05-20 2:18 ` [PATCH v19 09/11] drivers: add data path for Rx and Tx liujie5
2026-05-20 2:18 ` [PATCH v19 10/11] net/sxe2: add vectorized " liujie5
2026-05-20 2:18 ` [PATCH v19 11/11] net/sxe2: implement Tx done cleanup liujie5
2026-05-20 0:32 ` [PATCH v18 00/11] net/sxe2: fix logic errors and address feedback Stephen Hemminger
2026-05-19 14:16 ` [PATCH v17 " Stephen Hemminger
2026-05-18 17:25 ` [PATCH v16 " Stephen Hemminger
2026-05-18 0:02 ` Stephen Hemminger [this message]
2026-05-18 17:13 ` [PATCH v13 0/5] Support add/remove memory region and get-max-slots Stephen Hemminger
2026-05-20 2:36 ` Bathija, Pravin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260517170233.66915942@phoenix.local \
--to=stephen@networkplumber.org \
--cc=dev@dpdk.org \
--cc=liujie5@linkdatatechnology.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox