DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] condition for calling ixgbe_xmit_cleanup
@ 2014-02-12 22:50 Qing Wan
  2014-02-12 23:31 ` Shaw, Jeffrey B
  0 siblings, 1 reply; 3+ messages in thread
From: Qing Wan @ 2014-02-12 22:50 UTC (permalink / raw)
  To: dev

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] condition for calling ixgbe_xmit_cleanup
  2014-02-12 22:50 [dpdk-dev] condition for calling ixgbe_xmit_cleanup Qing Wan
@ 2014-02-12 23:31 ` Shaw, Jeffrey B
  2014-02-13 14:59   ` Qing Wan
  0 siblings, 1 reply; 3+ messages in thread
From: Shaw, Jeffrey B @ 2014-02-12 23:31 UTC (permalink / raw)
  To: Qing Wan, dev

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] condition for calling ixgbe_xmit_cleanup
  2014-02-12 23:31 ` Shaw, Jeffrey B
@ 2014-02-13 14:59   ` Qing Wan
  0 siblings, 0 replies; 3+ messages in thread
From: Qing Wan @ 2014-02-13 14:59 UTC (permalink / raw)
  To: Shaw, Jeffrey B, dev

Hi Jeff:

Thanks for your quick response.

So with current design, tx_free_thresh has different meaning depends on
whether simple flag is set or not. But in many sample applications where
simple flag is not activated, tx_free_thresh is the default value(32)
and capacity of ring is 512. That is why I'm asking this question since
looks like we clean up the ring when using more than 32 descriptors of
total 512.

Thanks
Qing 

-----Original Message-----
From: Shaw, Jeffrey B [mailto:jeffrey.b.shaw@intel.com] 
Sent: Wednesday, February 12, 2014 6:31 PM
To: Qing Wan; dev@dpdk.org
Subject: RE: condition for calling ixgbe_xmit_cleanup

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-02-13 14:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-12 22:50 [dpdk-dev] condition for calling ixgbe_xmit_cleanup Qing Wan
2014-02-12 23:31 ` Shaw, Jeffrey B
2014-02-13 14:59   ` Qing Wan

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).