From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from alln-iport-3.cisco.com (alln-iport-3.cisco.com [173.37.142.90]) by dpdk.org (Postfix) with ESMTP id 90D71206; Wed, 2 Aug 2017 20:34:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=2923; q=dns/txt; s=iport; t=1501698895; x=1502908495; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=z+0zXRycsLzfW/cetdybHg4GHopsu075yshEQhqocdY=; b=YMmhGseg30/k2BkJejUzZGXmRmPE8uAU9GCvEVRYcUUjLBa3SN+w2kH9 /+OqfwOR/M14uXTe6fFmg0hYxI2et3eqkNAPCYVNY1dxNjMbTm/sgRh5T NrYpZS5bbMFRqPKOC4GhirqN4uqKgIJ9m0vcFM/qdBYU1/cTdsQILyChM s=; X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0DwAAAgGYJZ/4cNJK1dGgEBAQECAQEBA?= =?us-ascii?q?QgBAQEBg1pkgRQHjgeQA4FulhCCEiyFGwKENT8YAQIBAQEBAQEBayiFGAEBAQE?= =?us-ascii?q?DJxM/DAQCAQgOAwQBAR8JBzIUCQgCBAENBQiKJxCvdzqLSwEBAQEBAQEBAQEBA?= =?us-ascii?q?QEBAQEBAQEBARgFgyiCAoFMhQqDJoEYhikFl2qIEgKHUYxQkk1IlTIBHziBCnc?= =?us-ascii?q?VhWAcgWd2AYcqgTKBDwEBAQ?= X-IronPort-AV: E=Sophos;i="5.41,312,1498521600"; d="scan'208";a="464940474" Received: from alln-core-2.cisco.com ([173.36.13.135]) by alln-iport-3.cisco.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 02 Aug 2017 18:34:54 +0000 Received: from XCH-RCD-009.cisco.com (xch-rcd-009.cisco.com [173.37.102.19]) by alln-core-2.cisco.com (8.14.5/8.14.5) with ESMTP id v72IYrDO006072 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=FAIL); Wed, 2 Aug 2017 18:34:54 GMT Received: from xch-rcd-007.cisco.com (173.37.102.17) by XCH-RCD-009.cisco.com (173.37.102.19) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Wed, 2 Aug 2017 13:34:53 -0500 Received: from xch-rcd-007.cisco.com ([173.37.102.17]) by XCH-RCD-007.cisco.com ([173.37.102.17]) with mapi id 15.00.1210.000; Wed, 2 Aug 2017 13:34:53 -0500 From: "John Daley (johndale)" To: Aaron Conole , "dev@dpdk.org" CC: "stable@dpdk.org" , Bruce Richardson Thread-Topic: [PATCH] enic: check for nb_free > 0 Thread-Index: AQHTC7l7PXKxGdlklUGC4pWnBgl9/6JxZA0g Date: Wed, 2 Aug 2017 18:34:53 +0000 Message-ID: <1a29ffbed0e442798d0e29b5af90f1fc@XCH-RCD-007.cisco.com> References: <20170802180213.28736-1-aconole@redhat.com> In-Reply-To: <20170802180213.28736-1-aconole@redhat.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.19.145.148] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] enic: check for nb_free > 0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Aug 2017 18:34:56 -0000 > -----Original Message----- > From: Aaron Conole [mailto:aconole@redhat.com] > Sent: Wednesday, August 02, 2017 11:02 AM > To: dev@dpdk.org > Cc: stable@dpdk.org; John Daley (johndale) ; Bruce > Richardson > Subject: [PATCH] enic: check for nb_free > 0 >=20 > Occasionally, the amount of packets to free from the work queue ends > perfectly on a boundary to have nb_free =3D 0 and pool =3D 0. This cause= s a > segfault as follows: >=20 > (gdb) bt > #0 rte_mempool_default_cache (mp=3D, mp=3D out>, > lcore_id=3D) > at /usr/src/debug/openvswitch-2.6.1/dpdk-16.11/x86_64-native- > linuxapp-gcc/include/rte_mempool.h:1017 > #1 rte_mempool_put_bulk (n=3D0, obj_table=3D0x7f10deff2530, mp=3D0x0) > at /usr/src/debug/openvswitch-2.6.1/dpdk-16.11/x86_64-native- > linuxapp-gcc/include/rte_mempool.h:1174 > #2 enic_free_wq_bufs (wq=3Dwq@entry=3D0x7efabffcd5b0, > completed_index=3Dcompleted_index@entry=3D33) > at /usr/src/debug/openvswitch-2.6.1/dpdk- > 16.11/drivers/net/enic/enic_rxtx.c:429 > #3 0x00007f11e9c86e17 in enic_cleanup_wq (enic=3D, > wq=3Dwq@entry=3D0x7efabffcd5b0) > 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=3D0x7efabffcd5b0, > tx_pkts=3D0x7f10deffb1a8, nb_pkts=3D) > 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=3D, > tx_pkts=3D0x7f10deffb1a8, queue_id=3D0, port_id=3D) >=20 > This commit makes the enic wq driver match other drivers who call the bul= k > free, by checking that there are actual packets to free. >=20 > Fixes: 36935afbc53c ("net/enic: refactor Tx mbuf recycling") > CC: stable@dpdk.org > Reported-by: Vincent S. Cojot > Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=3D1468631 > Signed-off-by: Aaron Conole > --- > drivers/net/enic/enic_rxtx.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) >=20 > diff --git a/drivers/net/enic/enic_rxtx.c b/drivers/net/enic/enic_rxtx.c = index > 5867acf..a39172f 100644 > --- a/drivers/net/enic/enic_rxtx.c > +++ b/drivers/net/enic/enic_rxtx.c > @@ -503,7 +503,8 @@ static inline void enic_free_wq_bufs(struct vnic_wq > *wq, u16 completed_index) > tail_idx =3D enic_ring_incr(desc_count, tail_idx); > } >=20 > - rte_mempool_put_bulk(pool, (void **)free, nb_free); > + if (nb_free > 0) > + rte_mempool_put_bulk(pool, (void **)free, nb_free); >=20 > wq->tail_idx =3D tail_idx; > wq->ring.desc_avail +=3D nb_to_free; > -- > 2.9.4 Reviewed-by: John Daley Thank you! johnd