From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pd0-f178.google.com (mail-pd0-f178.google.com [209.85.192.178]) by dpdk.org (Postfix) with ESMTP id 0D5135906 for ; Thu, 19 Dec 2013 20:34:54 +0100 (CET) Received: by mail-pd0-f178.google.com with SMTP id y10so1528872pdj.37 for ; Thu, 19 Dec 2013 11:36:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=RoX9MVUtWttULdqQvzgDdzvwhgrFDnOAW37VlxxPevU=; b=CE6/gprQizCdGuRILBvJI6bK0eAeGs6BkcYu5fjUZ7Xce8yHth0s+lIyssFshU0Utd 3pAZrPopbfaXSfaEO5T2yZdmZZ1P5UO5MnDA9DTYxZ0Kr8Hno9UV7oTRdOfKe+Yu+LgF jRQwyaJulGxRmY3mWFuPPMJhj2n53+RN2EaEF3GhbM0KtWX4uCWKAaraI2KgqPc1lpds m5o0rEvW3vts1C/wCL7LJxBYO8OSSGtG8hWFrIjCCGwDXmoycMo6AGCBO/yTlfpULGe6 dUky9MuNQ4S8jo2ULfwMllBuJfiRc5AHUnS9eZ4Zi7Z6d2D7fkjD518204/dHsK/xmDn SzKg== X-Gm-Message-State: ALoCoQmH1fxKdNx2h8V0vAAmV34edXEWoZ+pWwYa6ksRC9RBv7olEMMuivyqwjH2DyF+BXwef+Rz X-Received: by 10.66.149.73 with SMTP id ty9mr3775475pab.36.1387481761373; Thu, 19 Dec 2013 11:36:01 -0800 (PST) Received: from nehalam.linuxnetplumber.net (static-50-53-83-51.bvtn.or.frontiernet.net. [50.53.83.51]) by mx.google.com with ESMTPSA id ug2sm11803691pac.21.2013.12.19.11.36.00 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 19 Dec 2013 11:36:01 -0800 (PST) Date: Thu, 19 Dec 2013 11:35:55 -0800 From: Stephen Hemminger To: "Schumm, Ken" Message-ID: <20131219113555.59122dca@nehalam.linuxnetplumber.net> In-Reply-To: References: <52B164AB.9000002@6wind.com> X-Mailer: Claws Mail 3.8.1 (GTK+ 2.24.10; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 19:34:55 -0000 On Thu, 19 Dec 2013 19:09:48 +0000 "Schumm, Ken" wrote: > Hello Olivier, > > 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. > > 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 structure. Several drivers use it to control when to free as in: ixgbe_rxtx.c: static inline uint16_t tx_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) { struct igb_tx_queue *txq = (struct igb_tx_queue *)tx_queue; volatile union ixgbe_adv_tx_desc *tx_r = txq->tx_ring; uint16_t n = 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);