DPDK usage discussions
 help / color / mirror / Atom feed
From: Filip Janiszewski <contact@filipjaniszewski.com>
To: "users@dpdk.org" <users@dpdk.org>
Subject: [dpdk-users] rte_ring_dequeue returns 0 but pointer is null
Date: Fri, 4 Dec 2020 11:20:23 +0100	[thread overview]
Message-ID: <6ba0e4d5-675f-213a-751d-d9f010e04e9d@filipjaniszewski.com> (raw)

Hi,

Given this sample code, running on DPDK 20.08:

    if( rte_ring_dequeue( master->buffers,
                          ( void** )&data ) )
    {
        // Handle situation
    }
    else
    {
        // do stuff with data
    }

We're encountering a situation where data is null but the function
rte_ring_dequeue does not return an error code (returns 0) - This seems
to happen at random times, but always at least after few minutes of
execution.

the ring seems to be correctly configured in MT mode and another
thread/worker from time to time enqueue items into the ring, dumping the
GDB output so maybe someone can spot issues:

.
$4 = {name = "bufm_7572335744434674_fr\000\000\000\000\000\000\000",
flags = 0, memzone = 0x1000056c0, size = 64, mask = 63, capacity = 63,
pad0 = 0 '\000', {prod = {
      head = 124, tail = 124, {sync_type = RTE_RING_SYNC_MT, single =
0}}, hts_prod = {ht = {raw = 532575944828, pos = {head = 124, tail = 124}},
      sync_type = RTE_RING_SYNC_MT}, rts_prod = {tail = {raw =
532575944828, val = {cnt = 124, pos = 124}}, sync_type =
RTE_RING_SYNC_MT, htd_max = 0, head = {raw = 0,
        val = {cnt = 0, pos = 0}}}}, pad1 = 0 '\000', {cons = {head =
63, tail = 63, {sync_type = RTE_RING_SYNC_MT, single = 0}}, hts_cons =
{ht = {raw = 270582939711,
        pos = {head = 63, tail = 63}}, sync_type = RTE_RING_SYNC_MT},
rts_cons = {tail = {raw = 270582939711, val = {cnt = 63, pos = 63}},
sync_type = RTE_RING_SYNC_MT,
      htd_max = 0, head = {raw = 0, val = {cnt = 0, pos = 0}}}}, pad2 =
0 '\000'}
.

How this is possible? I would expect rte_ring_dequeue to return 0 only
if the provided pointer is valid.. Any suggestion on what I can
investigate to understand the problem and fix it?

Thanks

-- 
BR, Filip
+48 666 369 823

                 reply	other threads:[~2020-12-04 10:20 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=6ba0e4d5-675f-213a-751d-d9f010e04e9d@filipjaniszewski.com \
    --to=contact@filipjaniszewski.com \
    --cc=users@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 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).