All of lore.kernel.org
 help / color / mirror / Atom feed
From: bugzilla@dpdk.org
To: dev@dpdk.org
Subject: [dpdk-dev] [Bug 413] rte_ring: capacity was set uncorrectly
Date: Thu, 27 Feb 2020 15:04:04 +0000	[thread overview]
Message-ID: <bug-413-3@http.bugs.dpdk.org/> (raw)

https://bugs.dpdk.org/show_bug.cgi?id=413

            Bug ID: 413
           Summary: rte_ring: capacity was set uncorrectly
           Product: DPDK
           Version: unspecified
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: core
          Assignee: dev@dpdk.org
          Reporter: 781345688@qq.com
  Target Milestone: ---

In function `rte_ring_init()` in `lib/librte_ring/rte_ring.c`, `capacity` was
set to `mask` when count was power of 2, while `mask` was set to `count - 1`.
But when specified with flag `RING_F_EXACT_SZ`, `capacity` was set to `count`.
I think `capacity` should be set to `count` anyway. It's illogical when you
create a ring of count 4096 but you can only use 4095 of it. And when you
create a ring of count 4095, you can use 4095 of it. Their logic should be
identical.

-- 
You are receiving this mail because:
You are the assignee for the bug.

             reply	other threads:[~2020-02-27 15:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-27 15:04 bugzilla [this message]
2020-08-14 10:40 ` [dpdk-dev] [Bug 413] rte_ring: capacity was set incorrectly bugzilla

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=bug-413-3@http.bugs.dpdk.org/ \
    --to=bugzilla@dpdk.org \
    --cc=dev@dpdk.org \
    /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.