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 6DA23A0542; Mon, 1 Aug 2022 17:33:54 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 15D9A4067B; Mon, 1 Aug 2022 17:33:54 +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 2DB9C4014F for ; Mon, 1 Aug 2022 17:33:53 +0200 (CEST) Received: by mail-pg1-f178.google.com with SMTP id q16so9998950pgq.6 for ; Mon, 01 Aug 2022 08:33:52 -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=bMxNyQLwTGOwsVaBUsJHbiGOhf+nQIqo1eQ1I10KtsA=; b=apxwArrNtsd68hXmgHqXqvJ4W8JLtE83g8zElUe67N8FCk8w8+GDBOOn507QpyqZjp wHZawhn8P+r0jprbyMfe07fqwV8p99iLITdualeK0aFbMoL8uQ5wx25abQvZCTqsvW3G SvpDBL4UEP3CZi4aHVf1SB2/ZKb8EGLcxJGejmOHrZKBEAp3wwOkJSswdyIdbOf4UkiG hTwmk0KGRoOIprDrubjvqy6QTJnhAzDvHPGlWlCRLANcYPH4TFNt1zpuNUV3nD1do7xs NIfOTUBPHfuJrL3kwEAdXmIPcOV2TOIPgfqgykAx2J/fd/DQi93vmizLOrm6X0ILm86H oUdQ== 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=bMxNyQLwTGOwsVaBUsJHbiGOhf+nQIqo1eQ1I10KtsA=; b=BsAnHWrFsP51zvi0SKj2WSTjjrixztjwkjpsjdXe5qrOeJ2rPylL8tyOPo+P9WhaXK WjPYyDPHUPrEjLcb3ZkZdJVaUOYXnDG6tgYn2MlM7COsVx9nvreXzw0Hp5xu80V1Hb6B xCh2NEw33B4vuk+5bRvDQ0A7Uo6WMIDbYLJMxWs3q9kQnz8j8LU7tEFcc+jyilaTae+I eEbGvB2GXjS9bbeSMLQ5E2ycnLVdorwW8k5ZTtvG1CaetxkcORqZSFYtmEBzhXEs/0SX d+xM8xeLhE2z/XJWOCj33mVC7nCFVMmSILa3ZTIhrGYPEoAAGITSI3ziTnLDYM68OKVF KBFQ== X-Gm-Message-State: ACgBeo3/ssHTUZJ+wZ/WuQ9+ytQWUcywEWINF3FbI4NRG0loQMXKZsil slvGMnaIcXBCB+CjKe/8JsY+fQ== X-Google-Smtp-Source: AA6agR6xS57OwgEAJROuHmTf0Xp5aYIYp8LuelZo2c6Fckrz6HO2Yk7z0Ro7CxnyqJrqGWkVvcO0HQ== X-Received: by 2002:a63:8b4a:0:b0:41b:dae0:d070 with SMTP id j71-20020a638b4a000000b0041bdae0d070mr7872097pge.366.1659368032125; Mon, 01 Aug 2022 08:33:52 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id a2-20020a170902ecc200b0016eecdf8978sm2672800plh.106.2022.08.01.08.33.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Aug 2022 08:33:52 -0700 (PDT) Date: Mon, 1 Aug 2022 08:33:50 -0700 From: Stephen Hemminger To: =?UTF-8?B?TcOhcmlv?= Kuka Cc: dev@dpdk.org, mdr@ashroe.eu, reshma.pattan@intel.com Subject: Re: [PATCH v3] pcapng: fix write more packets than IOV_MAX limit Message-ID: <20220801083350.12d55889@hermes.local> In-Reply-To: <20220801084056.17418-1-kuka@cesnet.cz> References: <20220729071841.18198-1-kuka@cesnet.cz> <20220801084056.17418-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, 1 Aug 2022 10:40:56 +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. writev() system call 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 check that all segments of the next > packet will fit into the iovec buffer, whose capacity will be limited > by the IOV_MAX limit. If not, we flush the current iovec buffer to the > file by calling writev() and, if successful, fit the current packet at > the beginning of the flushed iovec buffer. >=20 > Fixes: 8d23ce8f5ee9 ("pcapng: add new library for writing pcapng files") > Cc: stephen@networkplumber.org >=20 > Signed-off-by: M=C3=A1rio Kuka Thanks for fixing this. Acked-by: Stephen Hemminger