From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 26D3A5906 for ; Fri, 20 Dec 2013 00:55:05 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 19 Dec 2013 15:52:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.95,516,1384329600"; d="scan'208";a="455169707" Received: from orsmsx110.amr.corp.intel.com ([10.22.240.8]) by orsmga002.jf.intel.com with ESMTP; 19 Dec 2013 15:56:11 -0800 Received: from orsmsx154.amr.corp.intel.com (10.22.226.12) by ORSMSX110.amr.corp.intel.com (10.22.240.8) with Microsoft SMTP Server (TLS) id 14.3.123.3; Thu, 19 Dec 2013 15:56:11 -0800 Received: from orsmsx103.amr.corp.intel.com ([169.254.2.114]) by ORSMSX154.amr.corp.intel.com ([169.254.11.175]) with mapi id 14.03.0123.003; Thu, 19 Dec 2013 15:56:11 -0800 From: "Schumm, Ken" To: Stephen Hemminger Thread-Topic: [dpdk-dev] When are mbufs released back to the mempool? Thread-Index: Ac77U7KrHCnCMBiYSBelk4UK5b93tgAvz/uAADaqQ7AAEb7IgAAHroFQ Date: Thu, 19 Dec 2013 23:56:11 +0000 Message-ID: References: <52B164AB.9000002@6wind.com> <20131219113555.59122dca@nehalam.linuxnetplumber.net> In-Reply-To: <20131219113555.59122dca@nehalam.linuxnetplumber.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.22.254.140] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] When are mbufs released back to the mempool? X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 23:55:06 -0000 Thanks very much, that clears it all up. -----Original Message----- From: Stephen Hemminger [mailto:stephen@networkplumber.org]=20 Sent: Thursday, December 19, 2013 11:36 AM To: Schumm, Ken Cc: Olivier MATZ; dev@dpdk.org Subject: Re: [dpdk-dev] When are mbufs released back to the mempool? On Thu, 19 Dec 2013 19:09:48 +0000 "Schumm, Ken" wrote: > Hello Olivier, >=20 > Do you know what the reason is for the tx rings filling up and holding on= to mbufs? Optimization to defer freeing. Note, there is no interrupts with DPDK so Transmit done can not be detected= until the next transmit. >=20 > It seems they could be freed when the DMA xfer is acknowledged instead of= waiting until the ring was full. You should also look at tx_free_thresh value in the rte_eth_txconf structur= e. Several drivers use it to control when to free as in: ixgbe_rxtx.c: =20 static inline uint16_t tx_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) { struct igb_tx_queue *txq =3D (struct igb_tx_queue *)tx_queue; volatile union ixgbe_adv_tx_desc *tx_r =3D txq->tx_ring; uint16_t n =3D 0; /* * Begin scanning the H/W ring for done descriptors when the * number of available descriptors drops below tx_free_thresh. For * each done descriptor, free the associated buffer. */ if (txq->nb_tx_free < txq->tx_free_thresh) ixgbe_tx_free_bufs(txq);