DPDK usage discussions
 help / color / mirror / Atom feed
* [dpdk-users] rte_ring_dequeue returns 0 but pointer is null
@ 2020-12-04 10:20 Filip Janiszewski
  0 siblings, 0 replies; only message in thread
From: Filip Janiszewski @ 2020-12-04 10:20 UTC (permalink / raw)
  To: users

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-12-04 10:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-04 10:20 [dpdk-users] rte_ring_dequeue returns 0 but pointer is null Filip Janiszewski

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