From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f179.google.com (mail-pf0-f179.google.com [209.85.192.179]) by dpdk.org (Postfix) with ESMTP id E4FBC2B9D for ; Wed, 9 Aug 2017 05:47:50 +0200 (CEST) Received: by mail-pf0-f179.google.com with SMTP id h68so22585306pfk.0 for ; Tue, 08 Aug 2017 20:47:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fridaylinux-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Uo3bwzRbmHu7qR317VtmlEAo4qyNxZvMhufl2OQEgW8=; b=vwjLdqNkTWiSQMKYw/EOV2cOHeiZ6pDwgzDBPJtClat5ijEVHlWUaJGUSACK0L24Wl AmpRV4vG91zsz3DkkihbXitZgHvTItLtdiUQctHGCTiHCnofJ2NFks/wj7LGQ3cqO8Mo Or4DZE+LSukmvp7sxTMj/jkS5HgVwt+XJ1yY4x0MbH3rHu3vHfoBHFjPrwakiHNnvAUS lBmDZLUVSitY0q83wQm4VT1UpWrjMOdyYrS8jgKL2uyg0ZhtLu82n1JxXeeN5BXrjZbp w4777L5vuWam0XmxQw0EJdH8WqDI0GWqTBF/UeyM+g1zQr3LG+WHVWveng+ygwcmjRwD 3Euw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Uo3bwzRbmHu7qR317VtmlEAo4qyNxZvMhufl2OQEgW8=; b=TXjnAc60s2hGbgQnADNUEAJUVjw5bv+j5wyQNAT5e09BFLDOMy5qh8ToMEf1/m1HDn hZHSlkoxpqxdSBIY9v20eq0giPFrajB4qu+dcWyHooQ4tcyoQwwSq4MI3Q+7HWMSP+eP vOOSQ0+LwRorM7UEw24/N4uB6Stqd6RUQgjzB5t6H7/8ccs6/iWING3iXH2ylFc5v5OS V1QUxgpE51HMbsFBBL7ogJUwEUJr6KkyKxqLmOKIAi4tXiUu+8cr2iiavlNMe5Jlleq5 9dsl5+mGPiRGIur/qk7Wn4rNg5zUOXzB7iA3GM5bxJL7fq39VkKvrrG5R6F7nefqlnyy iriQ== X-Gm-Message-State: AHYfb5hAG2Xs/EGqqX/Vuq+ssYUogtrWxjx8Bzl66KokhH3EAXfzUey0 loiRNhfeeNmXbifT X-Received: by 10.99.179.74 with SMTP id x10mr6218355pgt.37.1502250470166; Tue, 08 Aug 2017 20:47:50 -0700 (PDT) Received: from localhost.localdomain ([45.63.61.64]) by smtp.gmail.com with ESMTPSA id q3sm5093921pfl.89.2017.08.08.20.47.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 08 Aug 2017 20:47:48 -0700 (PDT) From: Yuanhan Liu To: Aaron Conole Cc: "Vincent S . Cojot" , John Daley , dpdk stable , Yuanhan Liu Date: Wed, 9 Aug 2017 11:43:58 +0800 Message-Id: <1502250240-6599-16-git-send-email-yliu@fridaylinux.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1502250240-6599-1-git-send-email-yliu@fridaylinux.org> References: <1502250240-6599-1-git-send-email-yliu@fridaylinux.org> Subject: [dpdk-stable] patch 'net/enic: fix crash when freeing 0 packet to mempool' has been queued to LTS release 16.11.3 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Aug 2017 03:47:51 -0000 Hi, FYI, your patch has been queued to LTS release 16.11.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 08/11/17. So please shout if anyone has objections. Thanks. --yliu --- >>From d471e9aabecec383a1e9187461ba88a70ce256cb Mon Sep 17 00:00:00 2001 From: Aaron Conole Date: Wed, 2 Aug 2017 14:02:13 -0400 Subject: [PATCH] net/enic: fix crash when freeing 0 packet to mempool [ upstream commit f7a58af502e08368a267886535367f205d4a5de6 ] Occasionally, the amount of packets to free from the work queue ends perfectly on a boundary to have nb_free = 0 and pool = 0. This causes a segfault as follows: (gdb) bt #0 rte_mempool_default_cache #1 rte_mempool_put_bulk (n=0, obj_table=0x7f10deff2530, mp=0x0) #2 enic_free_wq_bufs (wq=wq@entry=0x7efabffcd5b0, completed_index=completed_index@entry=33) #3 0x00007f11e9c86e17 in enic_cleanup_wq (enic=, wq=wq@entry=0x7efabffcd5b0) at /usr/src/debug/openvswitch-2.6.1/dpdk-16.11/drivers/net/enic/enic_rxtx.c:442 #4 0x00007f11e9c86e5f in enic_xmit_pkts (tx_queue=0x7efabffcd5b0, tx_pkts=0x7f10deffb1a8, nb_pkts=) at /usr/src/debug/openvswitch-2.6.1/dpdk-16.11/drivers/net/enic/enic_rxtx.c:470 #5 0x00007f11e9e147ad in rte_eth_tx_burst (nb_pkts=, tx_pkts=0x7f10deffb1a8, queue_id=0, port_id=) This commit makes the enic wq driver match other drivers who call the bulk free, by checking that there are actual packets to free. Fixes: 36935afbc53c ("net/enic: refactor Tx mbuf recycling") Reported-by: Vincent S. Cojot Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=1468631 Signed-off-by: Aaron Conole Reviewed-by: John Daley --- drivers/net/enic/enic_rxtx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/enic/enic_rxtx.c b/drivers/net/enic/enic_rxtx.c index 912ea15..1934f8b 100644 --- a/drivers/net/enic/enic_rxtx.c +++ b/drivers/net/enic/enic_rxtx.c @@ -426,7 +426,8 @@ static inline void enic_free_wq_bufs(struct vnic_wq *wq, u16 completed_index) tail_idx = enic_ring_incr(desc_count, tail_idx); } - rte_mempool_put_bulk(pool, (void **)free, nb_free); + if (nb_free > 0) + rte_mempool_put_bulk(pool, (void **)free, nb_free); wq->tail_idx = tail_idx; wq->ring.desc_avail += nb_to_free; -- 2.7.4