From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 250E9A0599; Fri, 10 Apr 2020 03:41:33 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B5BD31D441; Fri, 10 Apr 2020 03:41:32 +0200 (CEST) Received: from huawei.com (szxga08-in.huawei.com [45.249.212.255]) by dpdk.org (Postfix) with ESMTP id C84601D440; Fri, 10 Apr 2020 03:41:30 +0200 (CEST) Received: from DGGEMM405-HUB.china.huawei.com (unknown [172.30.72.54]) by Forcepoint Email with ESMTP id 03F012D6FB61F8748A6E; Fri, 10 Apr 2020 09:41:29 +0800 (CST) Received: from DGGEMM533-MBX.china.huawei.com ([169.254.5.250]) by DGGEMM405-HUB.china.huawei.com ([10.3.20.213]) with mapi id 14.03.0487.000; Fri, 10 Apr 2020 09:41:19 +0800 From: wangyunjian To: Stephen Hemminger CC: Ferruh Yigit , "dev@dpdk.org" , "keith.wiles@intel.com" , "Lilijun (Jerry)" , xudingke , "stable@dpdk.org" Thread-Topic: [dpdk-dev] [dpdk-stable] [PATCH v3 1/5] net/tap: fix mbuf double free when writev fails Thread-Index: AQHWDn5iSte8sLZ0YEClfSlc8qmf86hxja5g Date: Fri, 10 Apr 2020 01:41:19 +0000 Message-ID: <34EFBCA9F01B0748BEB6B629CE643AE60CF60E87@DGGEMM533-MBX.china.huawei.com> References: <1586233357-2580-1-git-send-email-wangyunjian@huawei.com> <34EFBCA9F01B0748BEB6B629CE643AE60CF5FDB2@DGGEMM533-MBX.china.huawei.com> <20200409075124.018fd49e@hermes.lan> In-Reply-To: <20200409075124.018fd49e@hermes.lan> Accept-Language: en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.173.251.152] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-CFilter-Loop: Reflected Subject: Re: [dpdk-dev] [dpdk-stable] [PATCH v3 1/5] net/tap: fix mbuf double free when writev fails 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > -----Original Message----- > From: Stephen Hemminger [mailto:stephen@networkplumber.org] > Sent: Thursday, April 9, 2020 10:51 PM > To: wangyunjian > Cc: Ferruh Yigit ; dev@dpdk.org; > keith.wiles@intel.com; Lilijun (Jerry) ; xuding= ke > ; stable@dpdk.org > Subject: Re: [dpdk-dev] [dpdk-stable] [PATCH v3 1/5] net/tap: fix mbuf do= uble > free when writev fails >=20 > On Thu, 9 Apr 2020 08:03:23 +0000 > wangyunjian wrote: >=20 > > error =3D tap_write_mbufs(txq, num_mbufs, mbuf, > > &num_packets, &num_tx_bytes); if (error =3D=3D -1)= { > > txq->stats.errs++; > > /* free tso mbufs */ > > for (j =3D 0; j < ret; j++) > > rte_pktmbuf_free(mbuf[j]); > > break; > > } >=20 > There is a free bulk, and normally each buf counts against errors. >=20 > if (error =3D=3D -1) { > txq->stats.errs +=3D num_packets; I think to consider only the original packet number, not sent packets. > rte_pktmbuf_free_bulk(mbuf, num_packets); Thanks for your suggestion, will include it in next version. Yunjian > break; > }