net/mlx5: fix redundant free of Tx buffer

SW completion ring of Tx (txq->elts) stores individual mbufs even if a
multi-segmented packet is sent. rte_pktmbuf_free_seg() must be used when
cleaning up the completion ring. Otherwise, chained mbufs are redundantly
freed and finally it would cause a crash.

Fixes: 1d88ba1719 ("net/mlx5: refactor Tx data path")
CC: stable@dpdk.org

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
This commit is contained in:
Yongseok Koh 2017-05-31 10:48:45 -07:00 committed by Ferruh Yigit
parent 70aee77ec6
commit c80711c3fb

View File

@ -117,7 +117,7 @@ txq_free_elts(struct txq_ctrl *txq_ctrl)
struct rte_mbuf *elt = (*elts)[elts_tail];
assert(elt != NULL);
rte_pktmbuf_free(elt);
rte_pktmbuf_free_seg(elt);
#ifndef NDEBUG
/* Poisoning. */
memset(&(*elts)[elts_tail],