DPDK patches and discussions
 help / color / mirror / Atom feed
From: Olivier Matz <olivier.matz@6wind.com>
To: Tom Barbette <barbette@kth.se>
Cc: Shahaf Shuler <shahafs@mellanox.com>,
	"dev@dpdk.org" <dev@dpdk.org>,
	Ferruh Yigit <ferruh.yigit@intel.com>,
	Thomas Monjalon <thomas@monjalon.net>,
	Andrew Rybchenko <arybchenko@solarflare.com>,
	Yongseok Koh <yskoh@mellanox.com>
Subject: Re: [dpdk-dev] [PATCH v4] mlx5: Support for rte_eth_rx_queue_count
Date: Mon, 5 Nov 2018 10:55:33 +0100	[thread overview]
Message-ID: <20181105095533.yupcifz45metjkgf@platinum> (raw)
In-Reply-To: <1541408462940.66979@kth.se>

Hi Tom,

On Mon, Nov 05, 2018 at 09:01:03AM +0000, Tom Barbette wrote:
> 
> > It will tell you if in a given offset on the rxq you have a packet ready. I think it will fit your needs, see below.
> So we just loose in precision here. We're looking at ML techniques that will play better with a numerical value and benefit from more entropy than arbitrarily poking of some thresholds.
> If one had to remain, I'd say rx_descriptor_* should be removed as it can be deduced from queue_count. Moreover, in the MLX5 case, calling the function 3 times to get "half busy", "partially busy" or "idle" will lead to scanning the queue 3 times...

The rationale of the descriptor_status() API was to avoid to scan the hw
ring in a linear way, like it was done in *_queue_count() functions (on
Intel NICs). This costs a lot, especially for large rings. The
alternative was to do a pci access to read the hw head/tail, but
benchmarks showed that it was also expensive.

With descriptor_status API, it is fast if you only need a threshold info.
If you need a more precise count, it is possible to do a binary search
algorithm, which is faster than the linear traversal.

That said, these assumptions may not be true for all NICs types, since
there are different ways of implementing the queue.

Regards,
Olivier

  reply	other threads:[~2018-11-05  9:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-27 15:10 Tom Barbette
2018-10-28  8:58 ` Tom Barbette
2018-10-28  9:37 ` Shahaf Shuler
2018-10-31  9:01   ` Tom Barbette
2018-11-01  7:21     ` Shahaf Shuler
2018-11-05  9:01       ` Tom Barbette
2018-11-05  9:55         ` Olivier Matz [this message]
2018-11-05 13:18           ` Shahaf Shuler

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=20181105095533.yupcifz45metjkgf@platinum \
    --to=olivier.matz@6wind.com \
    --cc=arybchenko@solarflare.com \
    --cc=barbette@kth.se \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=shahafs@mellanox.com \
    --cc=thomas@monjalon.net \
    --cc=yskoh@mellanox.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).