[dpdk-users] Proper way of notifying the application that DPDK received messages

Sungho Hong maverickjin88 at gmail.com
Thu Aug 30 01:56:51 CEST 2018


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


More information about the users mailing list