All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Bruce Richardson <bruce.richardson@intel.com>
Cc: Mohammad El-Shabani <mohammad.elshabani@gmail.com>, dev@dpdk.org
Subject: Re: librte_pmd_ixgbe implementation of ixgbe_dev_rx_queue_count
Date: Tue, 29 Mar 2016 09:54:18 -0700	[thread overview]
Message-ID: <20160329095418.5a0edd4e@xeon-e3> (raw)
In-Reply-To: <20160329093119.GC17800@bricha3-MOBL3>

On Tue, 29 Mar 2016 10:31:19 +0100
Bruce Richardson <bruce.richardson@intel.com> wrote:

> On Mon, Mar 28, 2016 at 06:45:26PM -0700, Mohammad El-Shabani wrote:
> > Hi,
> > Looking into why it hurts performance, I see that ixgbe_dev_rx_queue_count
> > is implemented a scan of elements of rx descriptors, which is very
> > expensive. I am wondering why its implemented the way it is. Could it not
> > just read the head location from the driver?
> > 
> > Thanks!
> > Mohammad El-Shabani
> 
> It's likely that reading the head location from the driver will be even slower
> than scanning the descriptor rings in memory. Access to PCI is very much slower
> than accessing memory - especially since on platforms with DDIO, many memory
> accesses will actually be cache reads.
> 
> That being said, I haven't actually written a test to prove this out, so feel
> free to try out the head pointer read method instead and see if it improves
> things. The results may vary depending on how far ahead needs to be scanned,
> but certainly for the empty ring case, the descriptor scan method will be far
> faster than a head read.
> 
> Regards,
> /Bruce

Also the most common use case is "is there any more packets ready before
I go to sleep on epoll", and the descriptor done API tells more than
is needed.

  reply	other threads:[~2016-03-29 16:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-29  1:45 librte_pmd_ixgbe implementation of ixgbe_dev_rx_queue_count Mohammad El-Shabani
2016-03-29  2:22 ` Lu, Wenzhuo
2016-03-29  9:31 ` Bruce Richardson
2016-03-29 16:54   ` Stephen Hemminger [this message]
2016-03-30 14:23     ` Bruce Richardson

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=20160329095418.5a0edd4e@xeon-e3 \
    --to=stephen@networkplumber.org \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=mohammad.elshabani@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.