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 511E7A0547; Mon, 24 May 2021 14:09:31 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 11DDB4003E; Mon, 24 May 2021 14:09:31 +0200 (CEST) Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by mails.dpdk.org (Postfix) with ESMTP id 631794003C; Mon, 24 May 2021 14:09:29 +0200 (CEST) Received: from dggems706-chm.china.huawei.com (unknown [172.30.72.59]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4FpbXp4cZkzwSTk; Mon, 24 May 2021 20:06:34 +0800 (CST) Received: from dggeme756-chm.china.huawei.com (10.3.19.102) by dggems706-chm.china.huawei.com (10.3.19.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2176.2; Mon, 24 May 2021 20:09:24 +0800 Received: from [10.67.103.128] (10.67.103.128) by dggeme756-chm.china.huawei.com (10.3.19.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Mon, 24 May 2021 20:09:24 +0800 To: Thierry Herbelot , CC: Thomas Monjalon , , Ori Kam References: <20210524085700.15534-1-thierry.herbelot@6wind.com> From: "Min Hu (Connor)" Message-ID: <08f29f81-5368-8c19-b688-029f3ab100d5@huawei.com> Date: Mon, 24 May 2021 20:09:24 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 MIME-Version: 1.0 In-Reply-To: <20210524085700.15534-1-thierry.herbelot@6wind.com> Content-Type: text/plain; charset="gbk"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.103.128] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggeme756-chm.china.huawei.com (10.3.19.102) X-CFilter-Loop: Reflected Subject: Re: [dpdk-dev] [dpdk-stable] [PATCH] app/regex: avoid division by zero 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 Sender: "dev" 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-email-humin29@huawei.com/ Thanks. ÔÚ 2021/5/24 16:57, Thierry Herbelot дµÀ: > Check that nb_jobs is not zero before using it for a division. > > Fixes: f5cffb7eb7fb6 ("app/regex: read data file once at startup") > Cc: stable@dpdk.org > Cc: Ori Kam > > Signed-off-by: Thierry Herbelot > --- > app/test-regex/main.c | 2 ++ > 1 file changed, 2 insertions(+) > > 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 == 0) > rte_exit(EXIT_FAILURE, "Number of lcores must be greater than 0\n"); > + if (nb_jobs == 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 = init_port(&nb_max_payload, rules_file, >