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 A519DA0563 for ; Sun, 26 Jun 2022 19:42:05 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9A4B24280B; Sun, 26 Jun 2022 19:42:05 +0200 (CEST) Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) by mails.dpdk.org (Postfix) with ESMTP id 9D96840E50; Sun, 26 Jun 2022 19:42:03 +0200 (CEST) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id DB5923200065; Sun, 26 Jun 2022 13:41:59 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Sun, 26 Jun 2022 13:42:00 -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=fm2; t=1656265319; x= 1656351719; bh=A/V0uu4waNnoDeHe/t50K70CBuSBbWZLrIzdPID2pFQ=; b=W LG8WpfN0Pzor0H+kCuDrRAdPB9gOVoTysPOblEpKxRDi8fhLqOVAaV0GiYClJMuP jv9UhDkVmhtla7QFdqFJ91qC060PuEsLzt+CNk07LFhBg+41Ydj4+G+oPWPmNdJ8 EWpone32d416EIa6koX32BZ6zC8DCr4o2eGqolWCHO8Z3IsVJHppBYIzPceiTdn9 M/7EhLrG8jbkzYzpdIqhXTBpA/kb/s3ItGu9D5U0hZwR7dLd1J4zIXKt1Wqcc/e+ O4jnGxLjZqYYZeIvxlEqFJ0SDccA43V4doAjTT1MouYwBooDquQm39ngiRRe495A Mm2mLvyCWf8w3/U6f+hDA== 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=fm2; t=1656265319; x= 1656351719; bh=A/V0uu4waNnoDeHe/t50K70CBuSBbWZLrIzdPID2pFQ=; b=u wik9gcKEOssgky20UOvIEfqQa6Nk+BUSg4ateZmny2VH1dtkb2Z4Ay4FJKFbMGVE YHBQZ+5A3juUfXxs/OcJ2DoWCVSAOfCIDlVg1s7wXTsd2pborhtIsgqyWhCe1RF7 4Iih6Osr+wJVc8UrWE67XdR/QQ+vqMk74sncz6HWPTcgAbpU9keRgqOjZGsC1O5n GYj8XMtBDyza8FWAmsblQSl/KFK1JClrgjsSglsP90iYm2NzMglOnGRbC7BdDz1p Wbm48MkzGwBS/xNQE/mVi9x3d9/TEqRpcNvKy7zaqf1UsiQ1tE3wF61wARqhX/7y VvAYPMxxR8amvC0SG2AKg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrudegfedguddukecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvfevufffkfgjfhgggfgtsehtqhertddttdejnecuhfhrohhmpefvhhho mhgrshcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqne cuggftrfgrthhtvghrnhepffdtuefhhedvkeelleevffdvlefhleehvdegtddvvdduueei vedtgfejvddugeefnecuffhomhgrihhnpeguphgukhdrohhrghenucevlhhushhtvghruf hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghl ohhnrdhnvght X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 26 Jun 2022 13:41:58 -0400 (EDT) From: Thomas Monjalon To: Thierry Herbelot , dev@dpdk.org, stable@dpdk.org Cc: stable@dpdk.org, Ori Kam , "Min Hu (Connor)" Subject: Re: [dpdk-stable] [PATCH] app/regex: avoid division by zero Date: Sun, 26 Jun 2022 19:41:57 +0200 Message-ID: <4523188.AxlXzFCzgd@thomas> In-Reply-To: <08f29f81-5368-8c19-b688-029f3ab100d5@huawei.com> References: <20210524085700.15534-1-thierry.herbelot@6wind.com> <08f29f81-5368-8c19-b688-029f3ab100d5@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org 24/05/2021 14:09, Min Hu (Connor): > Hi, Thierry, > This bug has been fixed in my earlier patch, please refer to: > https://patches.dpdk.org/project/dpdk/patch/1618839289-33224-5-git-send-e= mail-humin29@huawei.com/ Your patch is doing + if (!nb_jobs) { + job_len =3D data_len / nb_jobs; It looks wrong. I am for taking Thierry's patch. > =E5=9C=A8 2021/5/24 16:57, Thierry Herbelot =E5=86=99=E9=81=93: > > Check that nb_jobs is not zero before using it for a division. > >=20 > > Fixes: f5cffb7eb7fb6 ("app/regex: read data file once at startup") > > Cc: stable@dpdk.org > > Cc: Ori Kam > >=20 > > Signed-off-by: Thierry Herbelot > > --- > > app/test-regex/main.c | 2 ++ > > 1 file changed, 2 insertions(+) > >=20 > > diff --git a/app/test-regex/main.c b/app/test-regex/main.c > > index 8e665df73ce0..8f48cab11924 100644 > > --- a/app/test-regex/main.c > > +++ b/app/test-regex/main.c > > @@ -714,6 +714,8 @@ main(int argc, char **argv) > > rte_exit(EXIT_FAILURE, "Number of QPs must be greater than 0\n"); > > if (nb_lcores =3D=3D 0) > > rte_exit(EXIT_FAILURE, "Number of lcores must be greater than 0\n"); > > + if (nb_jobs =3D=3D 0) > > + rte_exit(EXIT_FAILURE, "Number of jobs must be greater than 0\n"); > > if (distribute_qps_to_lcores(nb_lcores, nb_qps, &qps_per_lcore) < 0) > > rte_exit(EXIT_FAILURE, "Failed to distribute queues to lcores!\n"); > > ret =3D init_port(&nb_max_payload, rules_file,