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 EF113A00C4; Mon, 25 Jul 2022 17:57:50 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 616C8410FA; Mon, 25 Jul 2022 17:57:49 +0200 (CEST) Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) by mails.dpdk.org (Postfix) with ESMTP id F405440684 for ; Mon, 25 Jul 2022 17:57:47 +0200 (CEST) Received: by mail-pj1-f46.google.com with SMTP id y1so2740285pja.4 for ; Mon, 25 Jul 2022 08:57:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Q2bnGsBs9yw+ofms62TthvUYuv0FPwJDexhaFbmfltw=; b=YYDCu4wUnT1Q+azHrUMAKyPC/CQUTg/bhW9A/lFsoyjhv/4b1hfAv7OBkEBvvedS0G g0Q+DiUwXdamDUL38BVqAT7fj8R3vDyToHFt18ssFvi58LJmj1HkYSAU00NXD1atVp/e uHqwwB+DwFDvFaEz9xLCysPbx8aX63vg6AaYquSBhiJq8hYlSSGM4y3IB3rkqHLlyRe0 mNoyeEwYJLDfRsOZ/VmGJggSJr8TimtKpC8Bbg4eoKThokPG49x0g0mNNkKrzMBOSYMv Cq1Rr6Gl6w38MfWhIp8LMJzeGFPVUA9eva795AP0j7uLZBs8oo6aULjEDgNshvmU/xi+ 7wkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Q2bnGsBs9yw+ofms62TthvUYuv0FPwJDexhaFbmfltw=; b=m5LIaKqltM0szODIpBn8mn2a+Wt2G8pNDkb0LJeQQIiNYGoYd/RgTc1lhMFSgs5Ghh d/sTIzTwWhMHJ34MLaJu1Srw6HCsis1PxYoij6okbD51CFRQSFPI9OFCshnXmBrCkG8P I91cYWKtevZ9ToF/ZO08navGIwLpMz+xXj9Ego2XdfG8IGIKFr3iJueKSc7Q8Lt82cGq 0YEFenj5QGzWW06RJH/0IODo7aeM0W5OnScjyN3lJbxGNuigkbthuMeym0d/9PZBxw6D IEf8+T3Dqo8h9XRI4C74goXldlKZ4cdjXIOdFMrv9A5j9iOZUkFvh5GT5eutv9tSX7dt jehA== X-Gm-Message-State: AJIora9KF1vXkG+hogdga4EmcXx8+41twwgyHoq9LDTlgD2grr896yod Ee+qFvb/dB3c9GLG0diYUXX3hw== X-Google-Smtp-Source: AGRyM1umXBXMR6Ukex6b8ZDviSIXLYaiWZLR1yTj3PfPTpGOmEZIsbQVXQU8chouTxQt9aFBG2p9Ow== X-Received: by 2002:a17:902:d4c9:b0:16d:798a:51a3 with SMTP id o9-20020a170902d4c900b0016d798a51a3mr5109144plg.15.1658764667010; Mon, 25 Jul 2022 08:57:47 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id b2-20020a170902650200b0016d1d1c376fsm7967299plk.287.2022.07.25.08.57.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Jul 2022 08:57:46 -0700 (PDT) Date: Mon, 25 Jul 2022 08:57:44 -0700 From: Stephen Hemminger To: =?UTF-8?B?TcOhcmlv?= Kuka Cc: Reshma Pattan , Ray Kinsella , dev@dpdk.org Subject: Re: [PATCH] pcapng: fix write more packets than IOV_MAX limit Message-ID: <20220725085744.6724e7c3@hermes.local> In-Reply-To: <20220725152811.409447-1-kuka@cesnet.cz> References: <20220725152811.409447-1-kuka@cesnet.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Mon, 25 Jul 2022 17:28:11 +0200 M=C3=A1rio Kuka wrote: > The rte_pcapng_write_packets() function fails when we try to write more > packets than the IOV_MAX limit. The error is caused by the writev() > system call, which is limited by the IOV_MAX limit. The iovcnt argument > is valid if it is greater than 0 and less than or equal to IOV_MAX as > defined in . >=20 > To avoid this problem, we can split the iovec buffer into smaller > chunks with a maximum size of IOV_MAX and write them sequentially by > calling the writev() repeatedly. That risks writing partial packets. Better to move the break down inside the logic of rte_pcapng_write_packets() and at the same time, remove the VLA of iov[iovcnt] >=20 > Fixes: 8d23ce8f5ee9 ("pcapng: add new library for writing pcapng files") > Cc: stephen@networkplumber.org >=20 > Signed-off-by: M=C3=A1rio Kuka What is the burst size here? IOV_MAX is 1024, and typical max mbuf per packet would be 5 that means as is the code works for up to 204 burst size. Sure you can use DPDK in odd ways with small mbuf sizes and huge burst sizes, but this needs to only in some slow path.