From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id ACF4745AF2 for ; Wed, 9 Oct 2024 14:15:18 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9CF5E40E25; Wed, 9 Oct 2024 14:15:18 +0200 (CEST) Received: from mail-pg1-f178.google.com (mail-pg1-f178.google.com [209.85.215.178]) by mails.dpdk.org (Postfix) with ESMTP id B88224065D for ; Wed, 9 Oct 2024 14:15:17 +0200 (CEST) Received: by mail-pg1-f178.google.com with SMTP id 41be03b00d2f7-7ea1b850d5cso1184630a12.1 for ; Wed, 09 Oct 2024 05:15:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728476117; x=1729080917; darn=dpdk.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=EoFmKSACxTxW2Ut6hAH7M2+7sY+RlBnzVmMQBXO4j0U=; b=FtogvA/73NDplF82RUw0REJdanl3zO0K26yYYYw5ewoyX0t/t3Is+pke/G95O2ESCn 9erCRUGhaY+cI+Gsz93jtRguVwmbv8W01gvshGtWbn3fpDtiUM1tvPqfw+ssbff92wKa 7Dz2s9Vj5a8puP1f8JXJbMrAgsBiHSUBSq336D8Btqv3/5vMGDERCZgA0eweDjR0VJ7d LkVUvAuTRgpaaPROlMo2zA7wF7W4bxWNfb2j7ANVi9lBCVhLcZg2NiknElrkNkJ77JK6 F9mBwkeHIn2Eeqykqqbbb8S61y6MN7mZbi3Ew/Lr4S8HcjtV8aOyXQNtzmrrufiMS1cY 7UuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728476117; x=1729080917; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=EoFmKSACxTxW2Ut6hAH7M2+7sY+RlBnzVmMQBXO4j0U=; b=EoqdtmUsZFZEQW/Ech0uQHJVVxU80fyzwi+jbenry31iTVRCzxltQawVP+PdQ23KPG Xvsg2f6CBVXCc3kfuhagibj086PWZ9AGfz/6VIWSF6mRJD2D9GcTCz8oiL/+s0QfRtGO mL9aB+Kai0K8r4/AZ6x8gDogleFr8a3zFNCaTX7zsHBXCifn6LcInbtAFcSiqysj1eqr ui8OyWaNgiYURE/oWNcjTC/lEUsooGzqdzrgLggjb7ls6mnlRJ/avF14goTNfVCwCPr2 xGylB8h9R6k7ZOTMaexgrU3YdcKgN+kobSPnPpPIlPDN3NMN7jcQCG58iZOtuPqC3Aiz g8NQ== X-Forwarded-Encrypted: i=1; AJvYcCXEAVoJCEYp9Z4WqbMQL4kudRwRQUhq1eweLHpk4wIClQjdDMRadynmwYemnlaeJ6p2f0XBvA==@dpdk.org X-Gm-Message-State: AOJu0YxV87XkWaoRP4nptulhtDjIdaHPtlFBO2sxocKS9/UoeuiumR/k cEH9f7/SCOvbePT4wGQ8fBThcPm7xSIXbpCBhQUmJDA++cu8B6hzjsVw27tn/WUSW+m14W/nma7 TcToWB+SlIGxTgrMCaZj6yXcOEMY= X-Google-Smtp-Source: AGHT+IFmIsVJD9tcFD1nU4WYUWQYNxYznLn+GWWzCys0kBfvAv6ab1Oiy4PjrzsKoAwrM+glLHykAmXKttBwVQgiCdo= X-Received: by 2002:a17:90a:ea0e:b0:2e2:9a00:1dfa with SMTP id 98e67ed59e1d1-2e2a2335e4dmr2744712a91.9.1728476112005; Wed, 09 Oct 2024 05:15:12 -0700 (PDT) MIME-Version: 1.0 References: <20241007172338.060ee839@hermes.local> In-Reply-To: <20241007172338.060ee839@hermes.local> From: Lokesh Chakka Date: Wed, 9 Oct 2024 17:45:00 +0530 Message-ID: Subject: Re: unable to capture packets To: Stephen Hemminger Cc: "Pathak, Pravin" , Bing Zhao , users Content-Type: multipart/mixed; boundary="000000000000a8c5e506240a34c7" X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: users-bounces@dpdk.org --000000000000a8c5e506240a34c7 Content-Type: multipart/alternative; boundary="000000000000a8c5e406240a34c5" --000000000000a8c5e406240a34c5 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable hi, did certain modifications as per your suggestions. still the same problem. not able to capture any packets....!!! I replaced 4096 with 512. rte_pktmbuf_pool_create is giving an error. for the time being i've left it as 4K only. I feel it should not be a problem. PFA for the revised code. Output is as follows : =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D EAL: Detected CPU lcores: 40 EAL: Detected NUMA nodes: 1 EAL: Detected shared linkage of DPDK EAL: Multi-process socket /var/run/dpdk/rte/mp_socket EAL: Selected IOVA mode 'VA' EAL: VFIO support initialized EAL: Using IOMMU type 1 (Type 1) ice_dev_init(): Failed to read device serial number ice_load_pkg_type(): Active package is: 1.3.39.0, ICE OS Default Package (double VLAN mode) main 53 port id: 0 num_of_pkts_per_queue: 4096 ice_set_rx_function(): Using AVX2 Vector Rx (port 0). Received Interrupt Signal SIGINT (2). Exiting... main 98 time : 4 total pkts rcvd: 0 bandwidth: 0 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Thanks & Regards -- Lokesh Chakka. On Tue, Oct 8, 2024 at 5:53=E2=80=AFAM Stephen Hemminger wrote: > On Tue, 8 Oct 2024 03:40:52 +0530 > Lokesh Chakka wrote: > > > please find the full fledged code as attachment. > > > > > > Thanks & Regards > > -- > > Lokesh Chakka. > > > > > > On Mon, Oct 7, 2024 at 9:32=E2=80=AFPM Pathak, Pravin > > wrote: > > > > > I hope accidentally num_of_pkts_per_queue is not zero. > > > > > > Pravin > > > > > > > > > > > > *From:* Lokesh Chakka > > > *Sent:* Monday, October 7, 2024 11:36 AM > > > *To:* Bing Zhao > > > *Cc:* users > > > *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, 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 > > > *Sent:* Monday, October 7, 2024 9:52 PM > > > *To:* users > > > *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 : > > > > > > > > > > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > > > > > struct rte_eth_rxconf rxq_conf =3D dev_info.default_rxconf; > > > rxq_conf.offloads =3D 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 =3D rte_eth_rx_burst( 0, 0, mbuf, num_of_pkts_per_qu= eue > ); > > > fprintf( stderr, "num_of_pkts_rcvd: %u\n", num_of_pkts_rcvd ); > > > } > > > > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > > > > > 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 =3D { }; > > 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 droppin= g > the rx descriptors to something much smaller like 128 > > After you receive a burst of packet you need to return them to the pool b= y > freeing them. > --000000000000a8c5e406240a34c5 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
hi,

did certain modification= s as per your suggestions. still the same problem. not able to capture any = packets....!!!
I replaced 4096 with 512. rte_pktmbuf_pool_create = is giving an error. for the time being i've left it as 4K only.
I feel it should not be a problem.

PFA for = the revised code.

<= /div>
Output is as follows :

=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
EAL: Detected CPU l= cores: 40
EAL: Detected NUMA nodes: 1
EAL: Detected shared linkage of= DPDK
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
EAL: Sele= cted IOVA mode 'VA'
EAL: VFIO support initialized
EAL: Using = IOMMU type 1 (Type 1)
ice_dev_init(): Failed to read device serial numbe= r

ice_load_pkg_type(): Active package is: 1.3.39.0, ICE OS Default P= ackage (double VLAN mode)
main 53 port id: 0 num_of_pkts_per_queue: 4096=
ice_set_rx_function(): Using AVX2 Vector Rx (port 0).
Received Inter= rupt Signal SIGINT (2). Exiting...
main 98 time : 4 total pkts rcvd: 0 b= andwidth: 0
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D

Thanks & Regards
--
Lokes= h Chakka.
=

On Tue, Oct 8, 2024 at 5:53=E2=80=AFAM Stephen Hemminger <stephen@networkplumber.org>= ; wrote:
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=E2=80=AFPM Pathak, Pravin <pravin.pathak@intel.com>
> wrote:
>
> > I hope accidentally num_of_pkts_per_queue=C2=A0 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 th= e 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 co= de :
> >
> >
> >
> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> >
> > struct rte_eth_rxconf rxq_conf =3D dev_info.default_rxconf;
> > rxq_conf.offloads =3D port_conf.rxmode.offloads;
> > rte_eth_rx_queue_setup( 0, 0, num_of_pkts_per_queue, (unsigned in= t)sock,
> > &rxq_conf, mem_pool );
> > rte_eth_dev_start( 0 );
> > while( 1 )
> > {
> > num_of_pkts_rcvd =3D rte_eth_rx_burst( 0, 0, mbuf, num_of_pkts_pe= r_queue );
> > fprintf( stderr, "num_of_pkts_rcvd: %u\n", num_of_pkts_= rcvd );
> > }
> >
> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> >
> > It's always printing num_of_pkts_rcvd as 0.
> >
> >
> >
> > Can someone help me understand what the issue is ....
> >
> >
> > Thanks & Regards
> > --
> > Lokesh Chakka.
> >
> >=C2=A0


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

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<= br> 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.
--000000000000a8c5e406240a34c5-- --000000000000a8c5e506240a34c7 Content-Type: text/x-csrc; charset="US-ASCII"; name="pmd.c" Content-Disposition: attachment; filename="pmd.c" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_m21u1fna0 Ly9wbWQgMCBzIGEKI2luY2x1ZGU8cnRlX2V0aGRldi5oPgojaW5jbHVkZTxydGVfbWFsbG9jLmg+ CiNpbmNsdWRlPHB0aHJlYWQuaD4KI2luY2x1ZGU8c2lnbmFsLmg+CgpfQm9vbCByZWNlaXZlZF9z aWdpbnQgPSBmYWxzZTsKCnN0cnVjdCBydGVfZXRoX2NvbmYgcG9ydF9jb25mID0KewoJLnJ4bW9k ZSA9IHsgLm1xX21vZGUgPSBSVEVfRVRIX01RX1JYX05PTkUsIH0sCgkudHhtb2RlID0geyAubXFf bW9kZSA9IFJURV9FVEhfTVFfVFhfTk9ORSwgfSwKfTsKCnN0YXRpYyB2b2lkIFNJR0lOVF9zaWdu YWxfaGFuZGxlciggY29uc3QgaW50IHNpZ25hbCApCnsKCWZwcmludGYoIHN0ZGVyciwgIlxiXGJS ZWNla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