[PATCH] net/mlx5: fix MPRQ title packet flags in vector Rx

Dariusz Sosnowski dsosnowski at nvidia.com
Tue Dec 1 10:26:21 CET 2026


> -----Original Message-----
> From: Daniil Bobryshev (daniil at peresvet.it) <daniil at peresvet.it>
> Sent: Friday, November 20, 2026 12:13 PM
> To: dev at dpdk.org
> Cc: stable at dpdk.org; Dariusz Sosnowski <dsosnowski at nvidia.com>; Slava
> Ovsiienko <viacheslavo at nvidia.com>; Bing Zhao <bingz at nvidia.com>; Ori
> Kam <orika at nvidia.com>; Suanming Mou <suanmingm at nvidia.com>; Matan
> Azrad <matan at nvidia.com>
> Subject: [PATCH] net/mlx5: fix MPRQ title packet flags in vector Rx
> 
> From: Daniil Bobryshev <daniil at peresvet.it>
> 
> With the enhanced CQE compression layout the vectorized Multi-Packet RQ
> burst keeps a copy of the title packet in rxq->title_pkt, and
> rxq_cq_decompress_v() stores its rearm data and offload flags (one 16-byte
> store) into every packet of the compressed session.
> 
> rxq_burst_mprq_v() takes that copy after rxq_copy_mprq_mbuf_v(). By then
> mprq_buf_to_pkt() has attached a title packet longer than
> mprq_max_memcpy_len to its stride, so the copy carries
> RTE_MBUF_F_EXTERNAL (and nb_segs 2 if a headroom overlap was chained).
> Every packet of the session inherits the flag. A packet that is then attached
> gets a valid shinfo, but a packet that is copied into its own buffer (short
> frames, out of MPRQ buffers, filler CQEs) keeps RTE_MBUF_F_EXTERNAL with
> the shinfo of a fresh mbuf (NULL) or a stale one. Freeing it crashes in
> rte_mbuf_ext_refcnt_update(), or decrements the reference count of a stride
> that is still in use.
> 
> Seen on ConnectX-6 Dx with rxq_cqe_comp_en=129 and mprq_en=1: 1514-
> byte traffic with occasional 60-byte ARP frames between the long ones
> segfaults within a second in rte_pktmbuf_free() of a 60-byte mbuf whose
> buf_addr is its own data room and whose ol_flags are
> 0x2000000000000182 with shinfo NULL. 64-byte traffic, which is always
> copied, and the basic layout, where the title is taken before the stride attach,
> do not hit it.
> 
> MPRQ is never enabled for pools with pinned external buffers, so in this burst
> RTE_MBUF_F_EXTERNAL can only come from the stride attach.
> Clear it and reset nb_segs in the title copy. Moving the copy before
> rxq_copy_mprq_mbuf_v() is not simpler: the check that decides whether to
> take it reads rxq->cq_ci, which rxq_copy_mprq_mbuf_v() advances.
> 
> Fixes: fc3e1798eba2 ("net/mlx5: support enhanced CQE zipping in vector Rx
> burst")
> Cc: stable at dpdk.org
> 
> Signed-off-by: Daniil Bobryshev <daniil at peresvet.it>

Acked-by: Dariusz Sosnowski <dsosnowski at nvidia.com>


More information about the stable mailing list