From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adrien Mazarguil Subject: Re: [PATCH] net/mlx5: fix a segmentation fault in Rx Date: Fri, 8 Jul 2016 15:29:02 +0200 Message-ID: <20160708132902.GF7621@6wind.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: dev@dpdk.org, Olga Shern , Yongseok Koh To: Nelio Laranjeiro Return-path: Received: from mail-wm0-f41.google.com (mail-wm0-f41.google.com [74.125.82.41]) by dpdk.org (Postfix) with ESMTP id 80B0D6C9F for ; Fri, 8 Jul 2016 15:29:05 +0200 (CEST) Received: by mail-wm0-f41.google.com with SMTP id z126so13303573wme.0 for ; Fri, 08 Jul 2016 06:29:05 -0700 (PDT) Content-Disposition: inline In-Reply-To: List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Fri, Jul 08, 2016 at 02:43:26PM +0200, Nelio Laranjeiro wrote: > 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 > Acked-by: Adrien Mazarguil -- Adrien Mazarguil 6WIND