<div dir="ltr">Hi Dariusz, <div><br></div><div>Sure! </div><div><br></div><div><font face="monospace">#0  0x0000000001c34912 in __rte_pktmbuf_free_extbuf ()<br>#1  0x0000000001c36a10 in rte_pktmbuf_detach ()<br>#2  0x0000000001c4a9ec in rxq_copy_mprq_mbuf_v ()<br>#3  0x0000000001c4d63b in rxq_burst_mprq_v ()<br>#4  0x0000000001c4d7a7 in mlx5_rx_burst_mprq_vec ()<br>#5  0x000000000050be66 in rte_eth_rx_burst ()<br>#6  0x000000000050c53d in pkt_burst_io_forward ()<br>#7  0x00000000005427b4 in run_pkt_fwd_on_lcore ()<br>#8  0x000000000054289b in start_pkt_forward_on_core ()<br>#9  0x0000000000a473c9 in eal_thread_loop ()<br>#10 0x00007ffff60061ca in start_thread () from /lib64/libpthread.so.0<br>#11 0x00007ffff5c72e73 in clone () from /lib64/libc.so.6</font><br><div><br></div><div>I've raised the bugs as instructed (ID 1776, 1777, 1778 and 1779) and included the stack trace there too.</div><div><br></div><div><br>With regards,</div><div>Joni<br><br></div></div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Wed, Aug 20, 2025 at 8:04 PM Dariusz Sosnowski <<a href="mailto:dsosnowski@nvidia.com">dsosnowski@nvidia.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
On Wed, Aug 20, 2025 at 04:40:16PM +0800, Joni wrote:<br>
> Hi,<br>
> <br>
> I hope this is the correct place to report these issues since it seems to<br>
> be related to DPDK codes. I've reported this to Nvidia a few days ago but<br>
> have yet to receive any response from them.<br>
> <br>
> My server is currently using ConnectX5 MT27800 (mlx5_core 5.7-1.0.2) on<br>
> firmware 16.35.4506 (MT_0000000011). My DPDK library version is 22.11.<br>
> <br>
> I ran the following testpmd command which resulted in segmentation fault (I<br>
> am currently running on filtered traffic with packets >1000 bytes to<br>
> increase the odds of hitting the segmentation fault):<br>
> <br>
> dpdk-testpmd -l 1-5 -n 4 -a<br>
> 0000:1f:00.0,rxq_comp_en=1,rxq_pkt_pad_en=1,rxqs_min_mprq=1,mprq_en=1,mprq_log_stride_num=6,mprq_log_stride_size=9,mprq_max_memcpy_len=64,rx_vec_en=1<br>
> -- -i --rxd=8192 --max-pkt-len=1700 --rxq=1 --total-num-mbufs=16384<br>
> --mbuf-size=3000 --enable_drop_en –enable_scatter<br>
> <br>
> This segmentation fault goes away when I disable vectorization<br>
> (rx_vec_en=0). (Note that the segmentation fault does not occur in<br>
> forward-mode=rxonly). The segmentation fault also seems to happen with<br>
> higher chances when there is a rxnombuf.<br>
<br>
Thank you for reporting and for the analysis.<br>
<br>
Could you please open a bug on <a href="https://bugs.dpdk.org/" rel="noreferrer" target="_blank">https://bugs.dpdk.org/</a> with all the<br>
details?<br>
<br>
Do you happen to have a stack trace from the segmentation fault?<br>
<br>
Slava: Could you please take a look at the issue described by Joni in this mail?<br>
<br>
> <br>
> Upon some investigation, I noticed that in DPDK’s source codes<br>
> drivers/net/mlx5/mlx5_rxtx_vec.c<br>
> (function rxq_copy_mprq_mbuf_v()), there is a possibility where the<br>
> consumed stride exceeds the stride number (64 in this case) which should<br>
> not be happening. I'm suspecting there's some CQE misalignment here upon<br>
> encountering rxnombuf.<br>
> <br>
> rxq_copy_mprq_mbuf_v(...) {<br>
>     ...<br>
>     if(rxq->consumed_strd == strd_n) {<br>
>         // replenish WQE<br>
>     }<br>
>     ...<br>
>     strd_cnt = (elts[i]->pkt_len / strd_sz) +<br>
>                ((elts[i]->pkt_len % strd_sz) ? 1 : 0);<br>
> <br>
>     rxq_code = mprq_buf_to_pkt(rxq, elts[i], elts[i]->pkt_len, buf,<br>
> rxq->consumed_strd, strd_cnt);<br>
>     rxq->consumed_strd += strd_cnt;       // encountering cases where<br>
> rxq->consumed_strd > strd_n<br>
>     ...<br>
> }<br>
> <br>
> In addition, there were also cases in mprq_buf_to_pkt() where the allocated<br>
> seg address is exactly the same as the pkt (elts[i]) address passed in<br>
> which should not happen.<br>
> <br>
> mprq_buf_to_pkt(...) {<br>
>     ...<br>
>     if(hdrm_overlap > 0) {<br>
>         MLX5_ASSERT(rxq->strd_scatter_en);<br>
> <br>
>         struct rte_mbuf *seg = rte_pktmbuf_alloc(rxq->mp);<br>
>         if (unlikely(seg == NULL)) return MLX5_RXQ_CODE_NOMBUF;<br>
>         SET_DATA_OFF(seg, 0);<br>
> <br>
>         // added debug statement<br>
>         DRV_LOG(DEBUG, "pkt %p seg %p", (void *)pkt, (void *)seg);<br>
> <br>
> rte_memcpy(rte_pktmbuf_mtod(seg, void *), RTE_PTR_ADD(addr, len -<br>
> hdrm_overlap), hdrm_overlap); ... } }<br>
> <br>
> I have tried upgrading my DPDK version to 24.11 but the segmentation fault<br>
> still persists.<br>
> <br>
> In addition, there were also a few other issues that I've noticed:<br>
> <br>
>    - max-pkt-len does not seem to work for values < 1500 even though "show<br>
>    port info X" showed that the MTU was set to the value I've passed in<br>
>    - In mprq_buf_to_pkt():<br>
>        - uint32_t seg_len = RTE_MIN(len, (uint32_t)(pkt->buf_len -<br>
>    RTE_PKTMBUF_HEADROOM)) --> seems unnecessary as to hit this code, len has<br>
>    to be greater than (uint32_t)(pkt->buf_len - RTE_PKTMBUF_HEADROOM) due to<br>
>    the if condition<br>
>        - If the allocation struct rte_mbuf *next =<br>
>    rte_pktmbuf_alloc(rxq->mp) fails and packet has more than 2 segs, the segs<br>
>    that were allocated previously do not get freed<br>
> <br>
>     mprq_buf_to_pkt(...) {<br>
>         ...                } else if (rxq->strd_scatter_en) {<br>
> <br>
> struct rte_mbuf *prev = pkt;<br>
> <br>
> uint32_t seg_len = RTE_MIN(len, (uint32_t)<br>
> <br>
> (pkt->buf_len - RTE_PKTMBUF_HEADROOM));<br>
> <br>
> uint32_t rem_len = len - seg_len;<br>
> <br>
> <br>
>       rte_memcpy(rte_pktmbuf_mtod(pkt, void *), addr, seg_len);<br>
>       DATA_LEN(pkt) = seg_len;<br>
>       while (rem_len) {<br>
>          struct rte_mbuf *next = rte_pktmbuf_alloc(rxq->mp);<br>
> <br>
> <br>
>             if (unlikely(next == NULL))<br>
>                 return MLX5_RXQ_CODE_NOMBUF;<br>
>             ...<br>
>     - In the external buffer attach case where hdrm_overlap > 0, the code<br>
> did not decrement the buffer refcnt if allocation struct rte_mbuf *next =<br>
> rte_pktmbuf_alloc(rxq->mp) fails<br>
> <br>
> mprq_buf_to_pkt(...) {<br>
>     ...            if (hdrm_overlap > 0) {<br>
> <br>
>         __atomic_add_fetch(&buf->refcnt, 1, __ATOMIC_RELAXED);<br>
>         ...<br>
>         MLX5_ASSERT(rxq->strd_scatter_en);<br>
>         struct rte_mbuf *seg = rte_pktmbuf_alloc(rxq->mp);<br>
>         if (unlikely(seg == NULL))<br>
>             return MLX5_RXQ_CODE_NOMBUF;<br>
>         SET_DATA_OFF(seg, 0);<br>
>         ...<br>
> <br>
> <br>
> Hope to hear from you soon!<br>
> <br>
> With regards,<br>
> Joni<br>
<br>
Best regards,<br>
Dariusz Sosnowski<br>
</blockquote></div>