DPDK usage discussions
 help / color / mirror / Atom feed
* rte_ring_enqueue_burst enqueue single packet for each call
@ 2022-07-15 11:34 Omer Yamac
  0 siblings, 0 replies; only message in thread
From: Omer Yamac @ 2022-07-15 11:34 UTC (permalink / raw)
  To: users

Hi All,

I was working on passive traffic application. That means I receive 
packets but I transmit nothing. So I have two core one for the capture 
packet and one for the processing packet. In my case, Worker thread 
(processing packet) is much slower than the capturing packet. I just 
want to test this case and to see what happens if the number of enqueue 
operation is much higher than the dequeue operation.

I realize that I got a segmentation fault if I enqueue packets one by 
one. Do I miss some point? Why "rte_ring_enqueue_burst" function behaves 
differently? Any Idea

Here are the loops of cores:

Capture core loop:
while (!quit_signal_rx) {
	const uint16_t nb_rx = rte_eth_rx_burst(0, 0, bufs,BURST_SIZE);
	uint16_t sent = 0;

	// following line seg fault
	for (size_t i = 0; i < nb_rx; i++)
	   sent += rte_ring_enqueue_burst(out_ring, (void *)&bufs[i], 1, NULL);

	// Works perfectly
	//sent = rte_ring_enqueue_burst(out_ring, (void *)bufs, nb_rx, NULL);

	if(nb_rx - sent != 0)
		rte_pktmbuf_free_bulk(&bufs[sent],nb_rx - sent);
}


Worker core loop:
while (!quit_signal_work) {
	const uint16_t num = rte_ring_dequeue_burst(in_r,
				(void *)bufs, BURST_SIZE*1, NULL);
	/* Do a little bit of work for each packet */
	for (i = 0; i < num; i++) {
		uint64_t t = rte_rdtsc()+100000;
		while (rte_rdtsc() < t)
			rte_pause();
	}

	rte_pktmbuf_free_bulk(bufs,num);
}

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

only message in thread, other threads:[~2022-07-15 11:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-15 11:34 rte_ring_enqueue_burst enqueue single packet for each call Omer Yamac

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