Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
net/memif: fix chained mbuf determination
[ upstream commit 3e3f736 ] Previously, TX functions call rte_pktmbuf_is_contiguous to determine whether an mbuf is chained. However, rte_pktmbuf_is_contiguous is designed to work on the first mbuf of a packet only. In case a packet contains three or more segment mbufs in a chain, it may cause truncated packets or rte_mbuf_sanity_check panics. This patch updates TX functions to determine chained mbufs using mbuf_head->nb_segs field, which works in all cases. Moreover, it maintains that the second cacheline is only accessed when chained mbuf is actually present. Fixes: 09c7e63 ("net/memif: introduce memory interface PMD") Fixes: 43b815d ("net/memif: support zero-copy slave") Signed-off-by: Junxiao Shi <git@mail1.yoursunny.com> Reviewed-by: Jakub Grajciar <jgrajcia@cisco.com>
- Loading branch information