From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f50.google.com (mail-wm0-f50.google.com [74.125.82.50]) by dpdk.org (Postfix) with ESMTP id 603FD68F8 for ; Fri, 8 Jul 2016 14:44:07 +0200 (CEST) Received: by mail-wm0-f50.google.com with SMTP id k123so12228654wme.0 for ; Fri, 08 Jul 2016 05:44:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=+jzjBFkz3KAjXQIjkkBQSsi4rR0iPQgPnHWEHwknnTY=; b=t/nSiLw/YocTUZpO/3EWuz0XDVH2UelvgQb8QJEZIoVwR4lZ+ENE+pnq5tUOmZ7xpE h3/a/f2e6csCmoxEwecKhJBTIKiJbuUS6BD78rzUoyBo5NCZJbNRFF7iqFBwD8NNr+5l qIfZEAVkJmO7gIEmVP016IiB+ICBOSF2cCtZ36zrH2pFJyKPjO086G0+7r27+zEqBNl1 oEZkpOghTBmO13li4TVuj1gICasiDZyT6w0kGdxUbk2IsgtFcwge2yFU2fQrC/GJGCMl G4/yu2xbnJ1yGSv/Uee/I1U5RzwyS5G28l25knuZ1rxdqHsjh6GBcYaLGPmlI6pzs1At HpBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=+jzjBFkz3KAjXQIjkkBQSsi4rR0iPQgPnHWEHwknnTY=; b=CzBrDwpoaO6BYCsZuAhTQ+c+COcZJeZL/F1heHGRsszgCeIk7+2gIuU7nuLYrzGb1R R+74Yfr4kNexW0YIX2qZeGyZBz1XjoL74mjPxOpPatq+eJeh1Bys62PvrBklm/nCaJHE 98KAvijjxTA9ALRso2omuMg2iIUL8L5KoPOxhHK8pTojubo7RF34b/RQgX2+IMCAqHfq aDwzhE2Hf+AQtAwB4F8JGfVYKEHNZjZKQibrNhcifGhvwAFOcZx5zgJLOJ2GjtGnQEDR XoGCrFTZnU2ttmW79+O8SbfKRaAk9YmII3ab+VyckmYAsQyzUkT0ZCkmP0XDgZe60ggN XbgA== X-Gm-Message-State: ALyK8tJsh+1R4hlP42qBL2dtnEU+vH8JF1dgt+VFEMb1hyJFBOM9Sokpd0bZ2K1AVTJPTOtd X-Received: by 10.28.152.202 with SMTP id a193mr3357326wme.98.1467981847174; Fri, 08 Jul 2016 05:44:07 -0700 (PDT) Received: from ping.vm.6wind.com (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by smtp.gmail.com with ESMTPSA id d137sm2898438wmd.12.2016.07.08.05.44.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 08 Jul 2016 05:44:06 -0700 (PDT) From: Nelio Laranjeiro To: dev@dpdk.org Cc: Adrien Mazarguil , Olga Shern , Yongseok Koh Date: Fri, 8 Jul 2016 14:43:26 +0200 Message-Id: X-Mailer: git-send-email 2.1.4 Subject: [dpdk-dev] [PATCH] net/mlx5: fix a segmentation fault in Rx X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jul 2016 12:44:07 -0000 Fixed issue could occur when a Mbuf starvation happens in a middle of reception of a segmented packet, in such situation, the PMD has to release all segments of such packet. The end condition was wrong causing it to free a Mbuf still handled by the NIC. Fixes: 9964b965ad69 ("net/mlx5: re-add Rx scatter support") Reported-by: Yongseok Koh Signed-off-by: Nelio Laranjeiro --- drivers/net/mlx5/mlx5_rxtx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c index 0c352f3..3564937 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); -- 2.1.4