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 C753FA00C2; Fri, 9 Dec 2022 11:35:44 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B5C24410D7; Fri, 9 Dec 2022 11:35:44 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 84C4440695 for ; Fri, 9 Dec 2022 11:35:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1670582143; 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=/ANyqoTYYtlRjlGccgSep1BtUAaN5TRmE16aKU7xjvY=; b=Uzl55ZSG11hB4lW8p06v/p3IxiSzmJjhg/9gKO8yoW+zdUj9KM9Xb0vmrUEyDzJEVFkgSB 64SnbUnj+X0mDBmnoeIj9iV2KEFJW+5gaNzy7aSFYfZFzlhPJTxnEd0Bys+Y9RafpUx854 ueqGlfaetNBiXty3X+zz6cAGYRmdAlw= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-349-6tyD56odPdmpteBp4MURhQ-1; Fri, 09 Dec 2022 05:35:41 -0500 X-MC-Unique: 6tyD56odPdmpteBp4MURhQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 681F0185A78B; Fri, 9 Dec 2022 10:35:41 +0000 (UTC) Received: from [10.39.208.28] (unknown [10.39.208.28]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7831F1121331; Fri, 9 Dec 2022 10:35:40 +0000 (UTC) Message-ID: Date: Fri, 9 Dec 2022 11:35:36 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Subject: Re: [PATCH v2 3/3] test/bbdev: explicit check for allocation failure To: "Chautru, Nicolas" , "dev@dpdk.org" Cc: "Vargas, Hernan" , "Vipin.Varghese@amd.com" References: <20221206191441.12428-1-nicolas.chautru@intel.com> <20221206191441.12428-4-nicolas.chautru@intel.com> <2bdb6439-4fbd-9643-2f16-4eb750e7bf14@redhat.com> From: Maxime Coquelin In-Reply-To: X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 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: 8bit 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 Hi Nicolas, On 12/7/22 16:33, Chautru, Nicolas wrote: > Hi Maxime, > > I don’t believe this constitutes a fix, just adding more error check to be more comprehensive. Not required for stable branch really. Let me know if you disagree. I think we should backport it since it constitutes a fix. Without it, user could face a segfault, so it fixes a potential segfault. > Can this be applied? Yes, with fixes tags. I can add them while applying if you agree. Regards, Maxime > Thanks > Nic > >> -----Original Message----- >> From: Maxime Coquelin >> Sent: Wednesday, December 7, 2022 12:40 AM >> To: Chautru, Nicolas ; dev@dpdk.org >> Cc: Vargas, Hernan ; Vipin.Varghese@amd.com >> Subject: Re: [PATCH v2 3/3] test/bbdev: explicit check for allocation failure >> >> >> >> On 12/6/22 20:14, Nicolas Chautru wrote: >>> Adding check for error on return of the rte_bbdev_*_op_alloc_bulk >>> calls in bbdev-test. >>> >>> Signed-off-by: Nicolas Chautru >>> --- >>> app/test-bbdev/test_bbdev_perf.c | 9 ++++++--- >>> 1 file changed, 6 insertions(+), 3 deletions(-) >>> >>> diff --git a/app/test-bbdev/test_bbdev_perf.c >>> b/app/test-bbdev/test_bbdev_perf.c >>> index b2e536b5e3..a922d69ada 100644 >>> --- a/app/test-bbdev/test_bbdev_perf.c >>> +++ b/app/test-bbdev/test_bbdev_perf.c >>> @@ -4958,7 +4958,8 @@ offload_latency_test_fft(struct rte_mempool >> *mempool, struct test_buffers *bufs, >>> if (unlikely(num_to_process - dequeued < burst_sz)) >>> burst_sz = num_to_process - dequeued; >>> >>> - rte_bbdev_fft_op_alloc_bulk(mempool, ops_enq, burst_sz); >>> + ret = rte_bbdev_fft_op_alloc_bulk(mempool, ops_enq, >> burst_sz); >>> + TEST_ASSERT_SUCCESS(ret, "Allocation failed for %d ops", >> ops_enq); >>> if (test_vector.op_type != RTE_BBDEV_OP_NONE) >>> copy_reference_fft_op(ops_enq, burst_sz, >> dequeued, >>> bufs->inputs, >>> @@ -5040,7 +5041,8 @@ offload_latency_test_dec(struct rte_mempool >> *mempool, struct test_buffers *bufs, >>> if (unlikely(num_to_process - dequeued < burst_sz)) >>> burst_sz = num_to_process - dequeued; >>> >>> - rte_bbdev_dec_op_alloc_bulk(mempool, ops_enq, >> burst_sz); >>> + ret = rte_bbdev_dec_op_alloc_bulk(mempool, ops_enq, >> burst_sz); >>> + TEST_ASSERT_SUCCESS(ret, "Allocation failed for %d ops", >> ops_enq); >>> if (test_vector.op_type != RTE_BBDEV_OP_NONE) >>> copy_reference_dec_op(ops_enq, burst_sz, >> dequeued, >>> bufs->inputs, >>> @@ -5125,7 +5127,8 @@ offload_latency_test_ldpc_dec(struct >> rte_mempool *mempool, >>> if (unlikely(num_to_process - dequeued < burst_sz)) >>> burst_sz = num_to_process - dequeued; >>> >>> - rte_bbdev_dec_op_alloc_bulk(mempool, ops_enq, >> burst_sz); >>> + ret = rte_bbdev_dec_op_alloc_bulk(mempool, ops_enq, >> burst_sz); >>> + TEST_ASSERT_SUCCESS(ret, "Allocation failed for %d ops", >> ops_enq); >>> if (test_vector.op_type != RTE_BBDEV_OP_NONE) >>> copy_reference_ldpc_dec_op(ops_enq, burst_sz, >> dequeued, >>> bufs->inputs, >> >> You need to add Fixes tag and cc stable. >> >> Maxime >