<div dir="auto"><div><br><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">Le jeu. 11 juin 2026, 18:01, Morten Brørup <<a href="mailto:mb@smartsharesystems.com">mb@smartsharesystems.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">> From: Maxime Leroy [mailto:<a href="mailto:maxime.leroys@gmail.com" target="_blank" rel="noreferrer">maxime.leroys@gmail.com</a>] On Behalf Of Maxime<br>
> Leroy<br>
> Sent: Thursday, 11 June 2026 17.49<br>
> <br>
> eth_dev_fp_ops_reset() restores a port's fast-path ops on stop/release<br>
> via a compound literal, so every field it omits is zeroed to NULL. It<br>
> sets only rx_pkt_burst/tx_pkt_burst (and the rxq/txq data), leaving<br>
> rx_queue_count, tx_queue_count, rx/tx_descriptor_status, tx_pkt_prepare<br>
> and the recycle callbacks NULL.<br>
> <br>
> In non-debug builds these ops are reached through an unguarded indirect<br>
> call (the NULL check exists only under RTE_ETHDEV_DEBUG_RX/TX). So a<br>
> thread calling e.g. rte_eth_rx_queue_count() on a port being stopped<br>
> dereferences NULL and crashes, while the same race on<br>
> rte_eth_rx_burst()<br>
> is harmless because the burst ops are reset to dummies. A poll-mode<br>
> worker re-checking rx_queue_count before arming the Rx interrupt and<br>
> sleeping hits exactly this.<br>
> <br>
> Reset these ops to the same dummies eth_dev_set_dummy_fops() installs,<br>
> so a stopped port behaves like a freshly allocated one: every fast-path<br>
> op is a safe no-op, none is NULL.<br>
> <br>
> Fixes: 066f3d9cc21c ("ethdev: remove callback checks from fast path")<br>
> Cc: <a href="mailto:stable@dpdk.org" target="_blank" rel="noreferrer">stable@dpdk.org</a><br>
> Signed-off-by: Maxime Leroy <<a href="mailto:maxime@leroys.fr" target="_blank" rel="noreferrer">maxime@leroys.fr</a>><br>
> ---<br>
<br>
Good catch.<br>
Acked-by: Morten Brørup <<a href="mailto:mb@smartsharesystems.com" target="_blank" rel="noreferrer">mb@smartsharesystems.com</a>><br>
<br>
Not related to the series, consider sending as separate patch.<br></blockquote></div></div><div dir="auto"><div dir="auto">Thanks for the review and Ack.</div><div dir="auto"><br></div><div dir="auto">Agreed, this is a generic ethdev fix. I kept it in this series because the NAPI user depends on it.</div><div dir="auto"><br></div><div dir="auto">The current Grout NAPI loop arms RX queue interrupts and then re-checks rte_eth_rx_queue_count() before blocking, to avoid sleeping when a packet arrived between the last empty poll and epoll_wait.</div><div dir="auto"><br></div><div dir="auto">With the current ethdev reset path, rx_burst is replaced by a dummy callback on stop/release, but rx_queue_count becomes NULL. So if the port is stopped concurrently, the NAPI worker dereferences a NULL function pointer and</div><div dir="auto">segfaults on that recheck.</div><div dir="auto"><br></div><div dir="auto">I can split it out if maintainers prefer, but then the dpaa2 NAPI series has a real dependency on the standalone ethdev fix.</div></div><div dir="auto"><div class="gmail_quote gmail_quote_container"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"></blockquote></div></div></div>