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 D95C745ADB for ; Tue, 8 Oct 2024 02:23:43 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 467B54027C; Tue, 8 Oct 2024 02:23:43 +0200 (CEST) Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) by mails.dpdk.org (Postfix) with ESMTP id 897A9400D7 for ; Tue, 8 Oct 2024 02:23:42 +0200 (CEST) Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-20b9b35c7c3so52842035ad.3 for ; Mon, 07 Oct 2024 17:23:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1728347021; x=1728951821; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=3OR97vk7te4ED++Ma40ra4B0vjsvaS3ORKA0FmtJXo4=; b=UI7ivKg/WFthKbyjKA7VNWRrCclg2PRmzSkcE++8mkMATGqTqTUpFM0XbiUXu4F1pK ktZDd+OjoREmsWoksWuZ+ODVxq5ckyJEoSH9IggkK8A9I5fBqt1q0pFMMl56FA/G2Q98 CvFAPjPWy9ybQ90yrQdPTfp6nR6SBGSLe0sYBW/2LXU6p1ivJyZ2mH/E10BAFsTOKYpv j/q1VoiFjI3gWXTweJ0iRBayKcsph6KRUQVViYe28vNXBSyenuV970Y54WBaMnCq8inl qW8BKf843EhgUgoOiyMd/naBZ0YbjDRhv0ilJW98JUTvJApVqW0xLWvNHBRBkEMEZiMe MRHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728347021; x=1728951821; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3OR97vk7te4ED++Ma40ra4B0vjsvaS3ORKA0FmtJXo4=; b=BjF/czX7sJCzqC3yb6IjRHw5DOVmbaTlDcnvZN6QH5THiuYSiT2hI8oi9HzkFakDUN Y5PSymR8yveTTUcSXLVchfToh7mBL0dfKakHOWpIXTmxCvQagBR8aCvsM6xqhNy5rszR s4eBrqQQAm4QUG/dfFyysYL5diRzRWGlaKL1nE3uv3ny8KKIa/gb3cRXYzts+Gn2dUDO 1yzjFeB7UjE9NTsIITe0B3X96p+HrPuFDW2p/GlkkPz2/gBPs02wKSWu8P85vJoSNWEb D0tfM08djG7MiWyyZLzoHd8Cf8i7AJRDnvmIqrpsW/oqpm+/TujmDpmZhsIrALroNJYT 5DTg== X-Forwarded-Encrypted: i=1; AJvYcCXqwGkBgjU2q3m2NKkLBWI6t0HnAlqGShQAwqQs/NShweqHy2Lo4GyWWwir01FUzOCIrpSZJg==@dpdk.org X-Gm-Message-State: AOJu0YzY98t3S8vdfQgiY7VJUWteN0IGAR8uLvUUtTJezstqtngtZJA+ QJwlEaufLHtHL+x6MfIuEj07k5lgOso1RJPlguxZ40C9TfJrt1xTiYKX9qZLF0c= X-Google-Smtp-Source: AGHT+IGWy+MvtXJ8NEEU3Qpu89MqZIZoYYEaBd9/yhcGnb4u+JrzBYFdNfmQBdSl0B73AA4FA8A0pw== X-Received: by 2002:a17:902:f68d:b0:20b:bad4:5b95 with SMTP id d9443c01a7336-20bfdfb10b7mr186538655ad.13.1728347021375; Mon, 07 Oct 2024 17:23:41 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20c138af813sm45519535ad.9.2024.10.07.17.23.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Oct 2024 17:23:41 -0700 (PDT) Date: Mon, 7 Oct 2024 17:23:38 -0700 From: Stephen Hemminger To: Lokesh Chakka Cc: "Pathak, Pravin" , Bing Zhao , users Subject: Re: unable to capture packets Message-ID: <20241007172338.060ee839@hermes.local> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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 On Tue, 8 Oct 2024 03:40:52 +0530 Lokesh Chakka wrote: > please find the full fledged code as attachment. >=20 >=20 > Thanks & Regards > -- > Lokesh Chakka. >=20 >=20 > On Mon, Oct 7, 2024 at 9:32=E2=80=AFPM Pathak, Pravin > wrote: >=20 > > 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 pack= et > > 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_queu= e ); > > 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. > > > > =20 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 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.