From: NĂ©lio Laranjeiro Date: Fri, 8 Jul 2016 12:43:26 +0000 (+0200) Subject: net/mlx5: fix crash in Rx X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=a1bdb71a32da35968e2b70897fd7c381bf3d3a32;p=dpdk.git net/mlx5: fix crash in Rx Fixed issue could occur when Mbuf starvation happens in a middle of reception of a segmented packet. In such a situation, the PMD has to release all segments of that packet. The end condition was wrong causing it to free an Mbuf still handled by the NIC. Fixes: 9964b965ad69 ("net/mlx5: re-add Rx scatter support") Reported-by: Yongseok Koh Signed-off-by: Nelio Laranjeiro Acked-by: Adrien Mazarguil --- diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c index 4132fd7422..615de9452c 100644 --- a/drivers/net/mlx5/mlx5_rxtx.c +++ b/drivers/net/mlx5/mlx5_rxtx.c @@ -1572,7 +1572,8 @@ mlx5_rx_burst(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n) rte_prefetch0(wqe); rep = rte_mbuf_raw_alloc(rxq->mp); if (unlikely(rep == NULL)) { - while (pkt) { + while (pkt != seg) { + assert(pkt != (*rxq->elts)[idx]); seg = NEXT(pkt); rte_mbuf_refcnt_set(pkt, 0); __rte_mbuf_raw_free(pkt);