DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: "Morten Brørup" <mb@smartsharesystems.com>
Cc: olivier.matz@6wind.com, konstantin.ananyev@intel.com,
	Honnappa.Nagarahalli@arm.com, nd@arm.com, dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH 2/2] ring: empty optimization
Date: Tue, 19 May 2020 08:52:23 -0700	[thread overview]
Message-ID: <20200519085223.079bc2ac@hermes.lan> (raw)
In-Reply-To: <20200519152725.63486-3-mb@smartsharesystems.com>

On Tue, 19 May 2020 15:27:25 +0000
Morten Brørup <mb@smartsharesystems.com> wrote:

> diff --git a/lib/librte_ring/rte_ring.h b/lib/librte_ring/rte_ring.h
> index 9078e7c24..f67141482 100644
> --- a/lib/librte_ring/rte_ring.h
> +++ b/lib/librte_ring/rte_ring.h
> @@ -733,7 +733,9 @@ rte_ring_full(const struct rte_ring *r)
>  static inline int
>  rte_ring_empty(const struct rte_ring *r)
>  {
> -	return rte_ring_count(r) == 0;
> +	uint32_t prod_tail = r->prod.tail;
> +	uint32_t cons_tail = r->cons.tail;
> +	return cons_tail == prod_tail;
>  }

Blank line after declarations?

Are the temporary variable even needed?

  reply	other threads:[~2020-05-19 15:52 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-13 15:31 [dpdk-dev] [PATCH] ring: empty and count optimizations Morten Brørup
2020-05-13 15:35 ` Morten Brørup
2020-05-13 17:08 ` Morten Brørup
2020-05-14 12:23   ` Ananyev, Konstantin
2020-05-14 13:45     ` Morten Brørup
2020-05-14 16:46       ` Ananyev, Konstantin
2020-05-14 18:00         ` Morten Brørup
2020-05-19 15:27 ` [dpdk-dev] [PATCH 0/2] ring: empty optimization Morten Brørup
2020-05-19 15:27   ` [dpdk-dev] [PATCH 1/2] ring: coding style cleanup Morten Brørup
2020-05-22 12:34     ` Ananyev, Konstantin
2020-05-19 15:27   ` [dpdk-dev] [PATCH 2/2] ring: empty optimization Morten Brørup
2020-05-19 15:52     ` Stephen Hemminger [this message]
2020-05-19 16:02       ` Morten Brørup
2020-07-01  9:19         ` David Marchand
2020-05-22 12:32     ` Ananyev, Konstantin
2020-07-01  9:20   ` [dpdk-dev] [PATCH 0/2] " David Marchand

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=20200519085223.079bc2ac@hermes.lan \
    --to=stephen@networkplumber.org \
    --cc=Honnappa.Nagarahalli@arm.com \
    --cc=dev@dpdk.org \
    --cc=konstantin.ananyev@intel.com \
    --cc=mb@smartsharesystems.com \
    --cc=nd@arm.com \
    --cc=olivier.matz@6wind.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).