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 37A6D41EB1; Thu, 16 Mar 2023 15:10:04 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 28D6740DF6; Thu, 16 Mar 2023 15:10:04 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 0219F40ED4 for ; Thu, 16 Mar 2023 15:10:02 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678975802; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4Nq0Cn7yW8DOdKoiy/3CqFR1HCTxHLhhX4tvd9dj4l8=; b=EnVY3rZbquTpYs+s6BatIkKgiPFkIXJc2uXhZ6Ia3Jw0WYWMzggSJuR+LNd2aBuRG6UuEg iJVThYixc4OWa3PAcgwCGV/CUc+RTjZKSufUQuSfUVAfAfB2+AP0ni0my8XzD1na0LNFkN UIJ6GxZWs8lS35DYheMW13rC2TEQdmk= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-32-t5VKtGCkO4i07m_b01FQfA-1; Thu, 16 Mar 2023 10:09:59 -0400 X-MC-Unique: t5VKtGCkO4i07m_b01FQfA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 794C52805594; Thu, 16 Mar 2023 14:09:57 +0000 (UTC) Received: from [10.39.208.23] (unknown [10.39.208.23]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CBB7540C6E67; Thu, 16 Mar 2023 14:09:55 +0000 (UTC) Message-ID: <06bffcaa-51f0-53f0-81fe-f87783a4ebba@redhat.com> Date: Thu, 16 Mar 2023 15:09:53 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH v1 1/2] test/bbdev: fix possible div by zero issue To: Hernan Vargas , dev@dpdk.org, gakhil@marvell.com, trix@redhat.com Cc: nicolas.chautru@intel.com, qi.z.zhang@intel.com, john.mcnamara@intel.com, stable@dpdk.org References: <20230309033624.61660-1-hernan.vargas@intel.com> <20230309033624.61660-2-hernan.vargas@intel.com> From: Maxime Coquelin In-Reply-To: <20230309033624.61660-2-hernan.vargas@intel.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 3/9/23 04:36, Hernan Vargas wrote: > Add extra check at function level to ensure num_ops cannot be 0. > > Coverity issue: 383647 > Fixes: f0d288bca467 ("test/bbdev: add support for BLER for 4G") > Cc: stable@dpdk.org > > Signed-off-by: Hernan Vargas > --- > app/test-bbdev/test_bbdev_perf.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c > index e56d314e93b5..15ebcdfc1556 100644 > --- a/app/test-bbdev/test_bbdev_perf.c > +++ b/app/test-bbdev/test_bbdev_perf.c > @@ -3722,6 +3722,7 @@ bler_pmd_lcore_ldpc_dec(void *arg) > > TEST_ASSERT_SUCCESS((burst_sz > MAX_BURST), > "BURST_SIZE should be <= %u", MAX_BURST); > + TEST_ASSERT_SUCCESS((num_ops == 0), "NUM_OPS must be greater than 0"); > > rte_bbdev_info_get(tp->dev_id, &info); > > @@ -3856,6 +3857,7 @@ bler_pmd_lcore_turbo_dec(void *arg) > > TEST_ASSERT_SUCCESS((burst_sz > MAX_BURST), > "BURST_SIZE should be <= %u", MAX_BURST); > + TEST_ASSERT_SUCCESS((num_ops == 0), "NUM_OPS must be greater than 0"); > > rte_bbdev_info_get(tp->dev_id, &info); > Reviewed-by: Maxime Coquelin Thanks, Maxime