DPDK usage discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Lokesh Chakka <lvenkatakumarchakka@gmail.com>
Cc: "Pathak, Pravin" <pravin.pathak@intel.com>,
	Bing Zhao <bingz@nvidia.com>, users <users@dpdk.org>
Subject: Re: unable to capture packets
Date: Mon, 7 Oct 2024 17:23:38 -0700	[thread overview]
Message-ID: <20241007172338.060ee839@hermes.local> (raw)
In-Reply-To: <CACh--sg8OdZubVN+6vxq+AKKqkDvXd8+D+Tg+Z5sD5OE7y0Apw@mail.gmail.com>

On Tue, 8 Oct 2024 03:40:52 +0530
Lokesh Chakka <lvenkatakumarchakka@gmail.com> wrote:

> please find the full fledged code as attachment.
> 
> 
> Thanks & Regards
> --
> Lokesh Chakka.
> 
> 
> On Mon, Oct 7, 2024 at 9:32 PM Pathak, Pravin <pravin.pathak@intel.com>
> wrote:
> 
> > I hope accidentally num_of_pkts_per_queue  is not zero.
> >
> > Pravin
> >
> >
> >
> > *From:* Lokesh Chakka <lvenkatakumarchakka@gmail.com>
> > *Sent:* Monday, October 7, 2024 11:36 AM
> > *To:* Bing Zhao <bingz@nvidia.com>
> > *Cc:* users <users@dpdk.org>
> > *Subject:* Re: unable to capture packets
> >
> >
> >
> > I've tried TX. It's working fine.
> >
> > I'm sure problem is only with my code.
> >
> >
> >
> > On Mon, 7 Oct, 2024, 20:52 Bing Zhao, <bingz@nvidia.com> wrote:
> >
> > Which NIC are you using?
> >
> > Have you tried dpdk-testpmd or l2fwd on your setup to check if the packet
> > can be sent and received correctly?
> >
> >
> >
> > BR. Bing
> >
> >
> >
> > *From:* Lokesh Chakka <lvenkatakumarchakka@gmail.com>
> > *Sent:* Monday, October 7, 2024 9:52 PM
> > *To:* users <users@dpdk.org>
> > *Subject:* unable to capture packets
> >
> >
> >
> > *External email: Use caution opening links or attachments*
> >
> >
> >
> > hello,
> >
> >
> >
> > I'm trying to capture packets using the following piece of code :
> >
> >
> >
> > ==========================================================
> >
> > struct rte_eth_rxconf rxq_conf = dev_info.default_rxconf;
> > rxq_conf.offloads = port_conf.rxmode.offloads;
> > rte_eth_rx_queue_setup( 0, 0, num_of_pkts_per_queue, (unsigned int)sock,
> > &rxq_conf, mem_pool );
> > rte_eth_dev_start( 0 );
> > while( 1 )
> > {
> > num_of_pkts_rcvd = rte_eth_rx_burst( 0, 0, mbuf, num_of_pkts_per_queue );
> > fprintf( stderr, "num_of_pkts_rcvd: %u\n", num_of_pkts_rcvd );
> > }
> >
> > ==========================================================
> >
> > It's always printing num_of_pkts_rcvd as 0.
> >
> >
> >
> > Can someone help me understand what the issue is ....
> >
> >
> > Thanks & Regards
> > --
> > Lokesh Chakka.
> >
> >  


Save yourself some pain, and make sure to initialize all structures like:
	struct rte_eth_rxconf rxq_conf = { };

A rx queue depth of 4K is excessive; all the packets in mempool will be
tied up in the device. If you want to keep a pool size of 4K, try dropping
the rx descriptors to something much smaller like 128

After you receive a burst of packet you need to return them to the pool by freeing them.

  reply	other threads:[~2024-10-08  0:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-07 13:52 Lokesh Chakka
2024-10-07 15:21 ` Bing Zhao
2024-10-07 15:34   ` Stephen Hemminger
2024-10-07 15:36   ` Lokesh Chakka
2024-10-07 16:02     ` Pathak, Pravin
2024-10-07 22:10       ` Lokesh Chakka
2024-10-08  0:23         ` Stephen Hemminger [this message]
2024-10-09 12:15           ` Lokesh Chakka
2024-10-09 13:27             ` Van Haaren, Harry

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=20241007172338.060ee839@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=bingz@nvidia.com \
    --cc=lvenkatakumarchakka@gmail.com \
    --cc=pravin.pathak@intel.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).