From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-f42.google.com (mail-pg0-f42.google.com [74.125.83.42]) by dpdk.org (Postfix) with ESMTP id 36CF19970 for ; Mon, 21 Aug 2017 11:38:21 +0200 (CEST) Received: by mail-pg0-f42.google.com with SMTP id i12so97000231pgr.3 for ; Mon, 21 Aug 2017 02:38:21 -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=mlRqwczF3UBm1JD8/3SIyh0zgzodNlPHP6MjVPWnz1k=; b=Rm360Vsa1+mYT0eDT466vQ1RR+eJvSJfeErfKUc1uoTvE0tQe6Lt5qyWzerXpQgUe8 IJ0ISipzz4uuhvEf6gb/3VJasOIFrwaDlR7g4z+GjdxfXIw88l8zuPnwPpM1BReNKiZJ ojBrVDw/8R0/K2Ssc85wMp40+jnkBy8FNnOuvG4TcqLkQIfgraDdKyUSKQDRBiXr8ap1 KhtGTCHxq3VQ9RnItxyHJTecGzGKsMG3/XhGVCKSWHetFDqoL/n8WrEQGM8tOPCVmp1z CFKYvRnccmyVzdxVyVkZdMEkWJIOau50UrrL3ZQva7Tw+CMiDa4+mEkTXllmWwvh/Dtp IT0Q== 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=mlRqwczF3UBm1JD8/3SIyh0zgzodNlPHP6MjVPWnz1k=; b=kSfLyrXh3tfXayfI2Yy2GxqxmSIgpnT0tBi8hlW6xsP4QmtYXbwP5U7UZ5pJr3mKO1 E9sOwJBWxOl20haLeMSNtI7WMSdixEYAb40bJi1Ct5GPcbkUOGCB29oUk5sHzWsvboOo ruGdwmQwbUyLZoEHRNLO3Bo8ZMbCQa+jEFMnunIwwebvqwBLIojtlUxbNUh7Oi6IyacH V/gRH2mcsJhY1blw0Sck+RGFMLSyaJn01iCc8P8+Ddmr0UYL8JziX0t7pMRLk10KR2aa uiNvEu7mNjYZdDyifrYlZAV94GOZPqF0YQj2UFxIbj25koSCPh7WbE8wMvHwaCmUz0fR kvTg== X-Gm-Message-State: AHYfb5icpo9uv1OBpLZxyHXujEHF2MYpk6FEXQjARaBEW126TyUSsgOO w+AXW6a4u4G8hvx0 X-Received: by 10.99.1.203 with SMTP id 194mr15860044pgb.315.1503308300513; Mon, 21 Aug 2017 02:38:20 -0700 (PDT) Received: from localhost.localdomain ([45.63.61.64]) by smtp.gmail.com with ESMTPSA id 69sm23355087pfh.186.2017.08.21.02.38.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 21 Aug 2017 02:38:19 -0700 (PDT) From: Yuanhan Liu To: Aaron Conole Cc: "Vincent S . Cojot" , John Daley , dpdk stable , Yuanhan Liu Date: Mon, 21 Aug 2017 17:31:14 +0800 Message-Id: <1503307878-16728-60-git-send-email-yliu@fridaylinux.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503307878-16728-1-git-send-email-yliu@fridaylinux.org> References: <1503307878-16728-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 stable release 17.05.2 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: Mon, 21 Aug 2017 09:38:21 -0000 Hi, FYI, your patch has been queued to stable release 17.05.2 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/24/17. So please shout if anyone has objections. Thanks. --yliu --- >>From 370cc76578a3c61aaec3b91ef91d8ae3fcf95632 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 ba0cfd0..2862205 100644 --- a/drivers/net/enic/enic_rxtx.c +++ b/drivers/net/enic/enic_rxtx.c @@ -491,7 +491,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