DPDK usage discussions
 help / color / mirror / Atom feed
From: Sungho Hong <maverickjin88@gmail.com>
To: users@dpdk.org
Subject: [dpdk-users] Proper way of notifying the application that DPDK received messages
Date: Wed, 29 Aug 2018 16:56:51 -0700	[thread overview]
Message-ID: <CAK8vx=iM3LzEhM6bzKRomYHE3VydAT0WvT63tk-NDpFJJHn5HA@mail.gmail.com> (raw)

Hello

currently, I'am using dpdk by sending and receiving the packets in to the
rte-rings. I'am having difficulty of finding the proper way of to notify
the application that the DPDK received incoming messages.

In order to check the whether the rte_ring has received the data or not, I
run a busy loop on the rte_ring.
here is the example below

while (1) {
  if (rte_ring_dequeue(rx_ring, &_msg) < 0) {
    usleep(5);
  } else {
    recv_msg = (char *) _msg;
    if (chara_debug) printf("[%d] Server merge
data::[%.24s...]__length::[%ld]\n", batched_packets, recv_msg,
strlen(recv_msg));
    collect_packets++;
    if (collect_packets > MERGE_PACKETS) break;
  }
}

However, my fellow developers say that this is not a efficient way nor the
proper way of checking received messages. Busy polling should be only done
in the DPDK API and not in the application.

Is there a way for DPDK to send a signal to the application so that the
application can only check the rte_ring only when there is a received
message?.

             reply	other threads:[~2018-08-29 23:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-29 23:56 Sungho Hong [this message]
2018-08-30  0:44 ` Stephen Hemminger
2018-08-30  2:02   ` Sungho Hong

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='CAK8vx=iM3LzEhM6bzKRomYHE3VydAT0WvT63tk-NDpFJJHn5HA@mail.gmail.com' \
    --to=maverickjin88@gmail.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).