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
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

DPDK usage discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/users/0 users/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 users users/ https://inbox.dpdk.org/users \
		users@dpdk.org
	public-inbox-index users

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.users


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git