From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 983A5A0544;
	Mon, 10 Oct 2022 02:40:56 +0200 (CEST)
Received: from [217.70.189.124] (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 40287400D5;
	Mon, 10 Oct 2022 02:40:56 +0200 (CEST)
Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com
 [66.111.4.27]) by mails.dpdk.org (Postfix) with ESMTP id 437B840042;
 Mon, 10 Oct 2022 02:40:55 +0200 (CEST)
Received: from compute5.internal (compute5.nyi.internal [10.202.2.45])
 by mailout.nyi.internal (Postfix) with ESMTP id DE8D65C004A;
 Sun,  9 Oct 2022 20:40:54 -0400 (EDT)
Received: from mailfrontend1 ([10.202.2.162])
 by compute5.internal (MEProxy); Sun, 09 Oct 2022 20:40:54 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h=
 cc:cc:content-transfer-encoding:content-type:date:date:from:from
 :in-reply-to:in-reply-to:message-id:mime-version:references
 :reply-to:sender:subject:subject:to:to; s=fm3; t=1665362454; x=
 1665448854; bh=47oeN1Q6PNsnN7HATPRo7E8pixeoNuX8l5MyFV2lsis=; b=T
 DZEm/ryVEhDDZ8kYuze8o0Sjug7IqDFg8pjca4GXZp4SZZwRQwCwU9zeRIAimGzU
 b9+D9opXcLp81yqbjyCoDA1DO8TuyjL0P5ZZU3xHULY4n83YvGD1nWy+BV+AHe6s
 XsDxX9GS4aDHAw1fSwFSG5CdN+KkJB/lN14EdSLqZyudHDMtZB47IksQFhypYlYK
 tZgfvMqfypYN+bGIdshuHoAORQ0dsyTLn5R7uOhnhVnU9F3rjU58YUm6nskxnls0
 CV71DyRUxYiyKMGB/6my8uB4ztyy0tcE4LagNaLKkPtgsYfuGTZW/2v8Hs0KLoD2
 7QeFs5Vwz372GgEpfcSoA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:cc:content-transfer-encoding
 :content-type:date:date:feedback-id:feedback-id:from:from
 :in-reply-to:in-reply-to:message-id:mime-version:references
 :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy
 :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1665362454; x=
 1665448854; bh=47oeN1Q6PNsnN7HATPRo7E8pixeoNuX8l5MyFV2lsis=; b=t
 cO28c/fOpqD3tv06cr+7NAwaScUQMfzfs/Qs1RuJTxGYXJHNH439d9JKS0ufZKn2
 IFEBzaYJE6unO6NWjjpf8DNA6ypLCeyCIfLCzatdwAu/C3RC9N4X0cheu9KCjDd+
 WSo9iktfwIl/j/QkDueVVtmqJx/vd05GS4XnniYmUkG+RqvSh//4caTm05UYt63U
 7wIqu/EFoqRSDISSgS4TzaRUL8XGXecekOz4/TwIRQ+RE4duNdzSHATUbuA3+FLr
 2hJ6nnSXp4zPIo50EQNxON4KtXx1kiAqg0ILmzUcAg/M0ApWhNt1oC26HcJVljfW
 PQ3N+EdFvorj6HEm2pAyA==
X-ME-Sender: <xms:FmpDY1csnNCM-ffM9m3kw2FlKjvazn4WKhUIDMrTYtL3r6nEi8g3pw>
 <xme:FmpDYzMnf7yGTg2t2hGyUQ_7AxnUu578urUkpoeMabkwJuOTf2JVYcfcQQdQIBoMx
 LohA7d2CvvvT-EWgg>
X-ME-Received: <xmr:FmpDY-jav9PIBT7KoUfLF8wlnDGrYIQMbrW75_hr45Dm9F7vqTRvZ4fqRys_gG6VG2Pnlh_bob6V4ZvQNWC6ZDmm8Q>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfeejvddgfeekucetufdoteggodetrfdotf
 fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
 uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne
 cujfgurhephffvvefufffkjghfggfgtgesthhqredttddtudenucfhrhhomhepvfhhohhm
 rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc
 ggtffrrghtthgvrhhnpeefhfejleeuvdevtddutdeutdevhfeijeethfffueejhfetuddu
 vedtkedtieekffenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh
 hrohhmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvght
X-ME-Proxy: <xmx:FmpDY-8QIMrpTkzjgDdWTnQ0ZIqT2zA7p3p2iphqPt_QgrD-VdHGDg>
 <xmx:FmpDYxu0dfk1JhVK6Bghc1Vm9AQFW-fVDrDNgMwt5JeGNiHQ5oI5rA>
 <xmx:FmpDY9GNuOrTlYxrrP_X9IQgK1KhtOcHfhnDa3InD2Z2bVWA4Thd0A>
 <xmx:FmpDY7LVV-S7XVh5G-i0ER3Ynax1YHi3kVElQdiPdaCZfg9tpWrcCg>
Feedback-ID: i47234305:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun,
 9 Oct 2022 20:40:53 -0400 (EDT)
From: Thomas Monjalon <thomas@monjalon.net>
To: =?ISO-8859-1?Q?M=E1rio?= Kuka <kuka@cesnet.cz>
Cc: dev@dpdk.org, mdr@ashroe.eu, reshma.pattan@intel.com,
 Stephen Hemminger <stephen@networkplumber.org>, stable@dpdk.org
Subject: Re: [PATCH v3] pcapng: fix write more packets than IOV_MAX limit
Date: Mon, 10 Oct 2022 02:40:52 +0200
Message-ID: <2098902.3Lj2Plt8kZ@thomas>
In-Reply-To: <20220801083350.12d55889@hermes.local>
References: <20220729071841.18198-1-kuka@cesnet.cz>
 <20220801084056.17418-1-kuka@cesnet.cz>
 <20220801083350.12d55889@hermes.local>
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="iso-8859-1"
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org

01/08/2022 17:33, Stephen Hemminger:
> On Mon,  1 Aug 2022 10:40:56 +0200
> M=E1rio Kuka <kuka@cesnet.cz> wrote:
>=20
> > 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 <limits.h>.
> >=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

+ Cc: stable@dpdk.org
> >=20
> > Signed-off-by: M=E1rio Kuka <kuka@cesnet.cz>
>=20
> Thanks for fixing this.
>=20
> Acked-by: Stephen Hemminger <stephen@networkplumber.org>

Applied, thanks.