summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorNĂ©lio Laranjeiro <nelio.laranjeiro@6wind.com>2016-07-08 14:43:26 +0200
committerBruce Richardson <bruce.richardson@intel.com>2016-07-08 22:51:10 +0200
commita1bdb71a32da35968e2b70897fd7c381bf3d3a32 (patch)
treec3aceb42728d393a4eec062c2626ba6164ed8ada /drivers
parent0ac64846254aa2ca12de1aaa1ccc292a75181af6 (diff)
downloaddpdk-a1bdb71a32da35968e2b70897fd7c381bf3d3a32.zip
dpdk-a1bdb71a32da35968e2b70897fd7c381bf3d3a32.tar.gz
dpdk-a1bdb71a32da35968e2b70897fd7c381bf3d3a32.tar.xz
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 <yskoh@mellanox.com> Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com> Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/mlx5/mlx5_rxtx.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c
index 4132fd7..615de94 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);