DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: "Schumm, Ken" <ken.schumm@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] When are mbufs released back to the mempool?
Date: Thu, 19 Dec 2013 11:35:55 -0800	[thread overview]
Message-ID: <20131219113555.59122dca@nehalam.linuxnetplumber.net> (raw)
In-Reply-To: <B35F7300EA51774C974164D11E30E3E42DFA1BFD@ORSMSX103.amr.corp.intel.com>

On Thu, 19 Dec 2013 19:09:48 +0000
"Schumm, Ken" <ken.schumm@intel.com> 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);

  reply	other threads:[~2013-12-19 19:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-17 18:13 Schumm, Ken
2013-12-18  9:02 ` Olivier MATZ
2013-12-19 19:09   ` Schumm, Ken
2013-12-19 19:35     ` Stephen Hemminger [this message]
2013-12-19 23:56       ` Schumm, Ken

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131219113555.59122dca@nehalam.linuxnetplumber.net \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=ken.schumm@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).