DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Shaw, Jeffrey B" <jeffrey.b.shaw@intel.com>
To: Qing Wan <qwan@evertz.com>, "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] condition for calling ixgbe_xmit_cleanup
Date: Wed, 12 Feb 2014 23:31:07 +0000	[thread overview]
Message-ID: <4032A54B6BB5F04B8C08B6CFF08C5928553F4D6D@FMSMSX103.amr.corp.intel.com> (raw)
In-Reply-To: <C70A636B101FD44999B82525C3E92AFA0348FDAF@otis.burlington.evertz.tv>

Hi Qing,

The idea is that we do not want to clean the descriptor ring until we have used "enough" descriptors.
So (nb_tx_desc -nb_tx_free) tells us how many descriptors we've used.  Once we've used "enough" (i.e. tx_free_thresh) then we will try to clean the descriptor ring.
If you look at the simpler "tx_xmit_pkts()" (simple is kind of a misnomer here... it refers to simplicity of features, not simplicity of implementation), we chose to implement the "nb_tx_free < tx_free_thresh" variant.
The only real difference is that the semantics of "tx_free_thresh" change from "free descriptors after this many are used" to "free descriptors after this many are remaining".

Thanks,
Jeff

-----Original Message-----
From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Qing Wan
Sent: Wednesday, February 12, 2014 3:50 PM
To: dev@dpdk.org
Subject: [dpdk-dev] condition for calling ixgbe_xmit_cleanup

Hi,

 

There are following code in function ixgbe_xmit_pkts,

....

if ((txq->nb_tx_desc - txq->nb_tx_free) > txq->tx_free_thresh) {

                ixgbe_xmit_cleanup(txq);

}

....

My understanding is, nb_tx_desc means total number of descriptors in ring and nx_tx_free represents how many descriptors are available, so
txq->nb_tx_desc - txq->nb_tx_free means how many we have used. I'm not
quite understand the meaning of this comparison.  Why is the condition not something like "if (txq->nb_tx_free < tx_free_thresh)". 

 

really appreciate if someone could help me on this.

 

Thanks

Qing

  reply	other threads:[~2014-02-12 23:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-12 22:50 Qing Wan
2014-02-12 23:31 ` Shaw, Jeffrey B [this message]
2014-02-13 14:59   ` Qing Wan

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=4032A54B6BB5F04B8C08B6CFF08C5928553F4D6D@FMSMSX103.amr.corp.intel.com \
    --to=jeffrey.b.shaw@intel.com \
    --cc=dev@dpdk.org \
    --cc=qwan@evertz.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).