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 DBD64A04B3; Mon, 30 Dec 2019 04:29:23 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 29A081C069; Mon, 30 Dec 2019 04:29:23 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 69B861BF7A for ; Mon, 30 Dec 2019 04:29:21 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Dec 2019 19:29:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,373,1571727600"; d="scan'208";a="220587592" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga006.jf.intel.com with ESMTP; 29 Dec 2019 19:29:19 -0800 Received: from FMSMSX110.amr.corp.intel.com (10.18.116.10) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 29 Dec 2019 19:29:19 -0800 Received: from shsmsx107.ccr.corp.intel.com (10.239.4.96) by fmsmsx110.amr.corp.intel.com (10.18.116.10) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 29 Dec 2019 19:29:19 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.30]) by SHSMSX107.ccr.corp.intel.com ([169.254.9.210]) with mapi id 14.03.0439.000; Mon, 30 Dec 2019 11:29:17 +0800 From: "Yang, Qiming" To: "Di, ChenxuX" , "dev@dpdk.org" CC: "Xing, Beilei" Thread-Topic: [PATCH v5 2/4] net/ice: cleanup Tx buffers Thread-Index: AQHVvGptmFYr2RooH0699LBBxTAa9afSCW7w Date: Mon, 30 Dec 2019 03:29:17 +0000 Message-ID: References: <20191227034520.78613-1-chenxux.di@intel.com> <20191227034520.78613-3-chenxux.di@intel.com> In-Reply-To: <20191227034520.78613-3-chenxux.di@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v5 2/4] net/ice: cleanup Tx buffers 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: Di, ChenxuX=20 Sent: Friday, December 27, 2019 11:45 To: dev@dpdk.org Cc: Yang, Qiming ; Xing, Beilei ; Di, ChenxuX Subject: [PATCH v5 2/4] net/ice: cleanup Tx buffers Add support to the ice driver for the API rte_eth_tx_done_cleanup to force = free consumed buffers on Tx ring. Signed-off-by: Chenxu Di --- drivers/net/ice/ice_ethdev.c | 1 + drivers/net/ice/ice_rxtx.c | 123 +++++++++++++++++++++++++++++++++++ drivers/net/ice/ice_rxtx.h | 1 + 3 files changed, 125 insertions(+) ....... + /* + * Loop through each packet. For each packet, verify that an + * mbuf exists and that the last segment is free. If so, free + * it and move on. + */ + while (1) { + tx_last =3D sw_ring[tx_id].last_id; + + if (sw_ring[tx_last].mbuf) { + if ((txr[tx_last].cmd_type_offset_bsz & + rte_cpu_to_le_64(ICE_TXD_QW1_DTYPE_M)) =3D=3D + rte_cpu_to_le_64(ICE_TX_DESC_DTYPE_DESC_DONE)) { + /* Get the start of the next packet. */ + tx_next =3D sw_ring[tx_last].next_id; + + /* + * Loop through all segments in a + * packet. + */ + do { + rte_pktmbuf_free_seg(sw_ring[tx_id].mbuf); + sw_ring[tx_id].mbuf =3D NULL; + sw_ring[tx_id].last_id =3D tx_id; + + /* Move to next segment. */ + tx_id =3D sw_ring[tx_id].next_id; + + } while (tx_id !=3D tx_next); + + /* + * Increment the number of packets + * freed. + */ + count++; + + if (unlikely(count =3D=3D (int)free_cnt)) + break; + } else { + /* + * mbuf still in use, nothing left to + * free. + */ + break; Same comment as patch 1 + } .....