DPDK usage discussions
 help / color / mirror / Atom feed
From: Isaac Boukris <iboukris@gmail.com>
To: users@dpdk.org, Stephen Hemminger <stephen@networkplumber.org>
Subject: Concurrent invocations of the dpdk-dumpcap tool
Date: Sun, 17 Sep 2023 00:11:31 +0300	[thread overview]
Message-ID: <CAC-fF8QQD5LSZ-c=4Egs2qjobd=4CLWHu+9BrqQiS==_R558iA@mail.gmail.com> (raw)

Hello Stephen, all,

Currently the dumpcap tool fails if another instance of it captures on
the same interface, and the primary process will log:
"pdump_register_rx_callbacks(): rx callback for port=0 queue=0,
already exists"

However if each instance runs on a different port (-i), then they seem
to both work fine and capture packets until you stop the second one,
at which point the first one breaks with:

Packets captured: 196094 Primary process is no longer active, exiting...
EAL: failed to send to (/tmp/dpdk/rte/mp_socket) due to Connection refused
EAL: Fail to send request /tmp/dpdk/rte/mp_socket:mp_pdump
pdump_prepare_client_request(): client request for pdump enable/disable failed
RING: Cannot free ring, not created with rte_ring_create()

At the same time, the primary process crashes with (which is likely
the cause of the above):

#3  <signal handler called>
#4  0x000000000168437d in bucket_dequeue ()
#5  0x0000000002269c26 in rte_pktmbuf_copy ()
#6  0x00000000021a4939 in rte_pcapng_copy ()
#7  0x000000000209d890 in pdump_copy ()
#8  0x000000000209e350 in pdump_rx ()
#9  0x0000000002240bb5 in rte_eth_call_rx_callbacks ()
#10 0x00000000014b04bf in rte_eth_rx_burst (port_id=0, queue_id=0,
rx_pkts=0x7f00c3fb9c80, nb_pkts=128) at
/usr/local/include/rte_ethdev.h:5906

I'm testing with the 22.11.3 version code (latest LTS) but there don't
seem to be significant changes in master.

Given the above I had the hunch the ring names collide in shared
memory, so I changed both the ring and the pool names in the dumpcap
tool to include the pid, and with that the above scenario works fine
as expected, is that a proper fix?

btw, looking at related code i wondered why do we require the ring to
be MC, while we probably need MP since the app might have several
producers, is the dumpcap tool the only consumer?

In general the fact that if the tool dies abnormally or crashes,
requires restarting the primary process isn't great. While we can try
to catch more signals in the tool to avoid it, perhaps we can also
consider a -F option which disconnects stalled clients (by sending a
"disable" message). Another improvement could be to detect on the
primary process that the secondary one died and remove the
rxtx_callback so another client could connect.

Thanks!

             reply	other threads:[~2023-09-16 21:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-16 21:11 Isaac Boukris [this message]
2023-09-17  2:01 ` Stephen Hemminger
2023-09-17  6:37   ` Isaac Boukris

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='CAC-fF8QQD5LSZ-c=4Egs2qjobd=4CLWHu+9BrqQiS==_R558iA@mail.gmail.com' \
    --to=iboukris@gmail.com \
    --cc=stephen@networkplumber.org \
    --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).