DPDK usage discussions
 help / color / mirror / Atom feed
* [dpdk-users] A question about l2fwd
@ 2020-06-24 11:28 David Aldrich
  2020-06-24 11:54 ` Van Haaren, Harry
  0 siblings, 1 reply; 2+ messages in thread
From: David Aldrich @ 2020-06-24 11:28 UTC (permalink / raw)
  To: users

Hi,

I have a question about the l2fwd example, which concerns a basic question
about how dpdk works.

The main processing loop in l2fwd is *l2fwd_main_loop()* which calls
*rte_eth_rx_burst()* to retrieve packets from the rx_queue.

My question is: what processing loop is responsible for transferring
packets from the ethernet device to the rx_queue?

I ask this because we have written our own application based on l2fwd and
no packets are being returned by our app's call to
*rte_eth_rx_burst(). *However,
packets are returned in the case of l2fwd. I'm trying to identify the
difference between the non-working and working code.

Best regards
David

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-users] A question about l2fwd
  2020-06-24 11:28 [dpdk-users] A question about l2fwd David Aldrich
@ 2020-06-24 11:54 ` Van Haaren, Harry
  0 siblings, 0 replies; 2+ messages in thread
From: Van Haaren, Harry @ 2020-06-24 11:54 UTC (permalink / raw)
  To: David Aldrich, users

> -----Original Message-----
> From: users <users-bounces@dpdk.org> On Behalf Of David Aldrich
> Sent: Wednesday, June 24, 2020 12:29 PM
> To: users@dpdk.org
> Subject: [dpdk-users] A question about l2fwd
> 
> Hi,

Hi David!

> I have a question about the l2fwd example, which concerns a basic question
> about how dpdk works.
> 
> The main processing loop in l2fwd is *l2fwd_main_loop()* which calls
> *rte_eth_rx_burst()* to retrieve packets from the rx_queue.
> 
> My question is: what processing loop is responsible for transferring
> packets from the ethernet device to the rx_queue?

The NIC hardware has a DMA engine, and writes to the descriptor ring
when a packet arrives. It also DMAs the packet data to a memory location
that was provided by SW in advance.

The SW rte_eth_rx_burst() function polls this descriptor ring, and checks if
new packets are available. There is often a single bit "Descriptor Done", or DD
for short, that indicates a new packet has been written by the NIC.


> I ask this because we have written our own application based on l2fwd and
> no packets are being returned by our app's call to
> *rte_eth_rx_burst(). *However,
> packets are returned in the case of l2fwd. I'm trying to identify the
> difference between the non-working and working code.

Check that you're calling with a big enough burst size (4 or greater),
as some of the SIMD/vector PMD routines do not like small burst sizes.

If there's still an error, ensure that the mempool hasn't been depleted.
Often caused by leaking packet mbufs, due to not calling rte_pktmbuf_free().

Try adding some stats to your application to count eg: rx_pkts, rte_pktmbuf_free() calls.
Sometimes comparing the two shows some packets being leaked.

> Best regards
> David

Hope that helps! -Harry

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-06-24 11:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-24 11:28 [dpdk-users] A question about l2fwd David Aldrich
2020-06-24 11:54 ` Van Haaren, Harry

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