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 E54E0A00C5; Wed, 14 Sep 2022 22:35:33 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7BBE54021D; Wed, 14 Sep 2022 22:35:33 +0200 (CEST) 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 A093740156 for ; Wed, 14 Sep 2022 22:35:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663187730; 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=6d5RJCGoiXcokA5vYLvipEc6y89zznB8f64dhey/5tc=; b=eHuubhnT7ZT0gxuC/abr7/ZThQJwBaq0XNCm05/uqAZfj1VVbroHX69CfCPuNc88AFj5TR eleV3dQM7mNNiZZd8Wx9QmmedVMRqzIue/Q4JvIwAUSjVcQJO/wREchhjBA/zUe7Llq2t9 2zVJG7IG4V3OVd20kh/Vbjczal6Lcl8= 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-48-D4gLr2uyMVOJ693V9-DRjA-1; Wed, 14 Sep 2022 16:35:27 -0400 X-MC-Unique: D4gLr2uyMVOJ693V9-DRjA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 54348801231; Wed, 14 Sep 2022 20:35:27 +0000 (UTC) Received: from [10.39.208.12] (unknown [10.39.208.12]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 011B11759E; Wed, 14 Sep 2022 20:35:25 +0000 (UTC) Message-ID: <653ecc13-5858-499d-a9db-da69873ad72f@redhat.com> Date: Wed, 14 Sep 2022 22:35:24 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Subject: Re: [PATCH v2 11/37] baseband/acc100: separate validation functions from debug To: Hernan Vargas , dev@dpdk.org, gakhil@marvell.com, trix@redhat.com Cc: nicolas.chautru@intel.com, qi.z.zhang@intel.com References: <20220820023157.189047-1-hernan.vargas@intel.com> <20220820023157.189047-12-hernan.vargas@intel.com> From: Maxime Coquelin In-Reply-To: <20220820023157.189047-12-hernan.vargas@intel.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 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 8/20/22 04:31, Hernan Vargas wrote: > Use new flag RTE_LIBRTE_BBDEV_SKIP_VALIDATE enable/disable validation > functions. The validation API will be enabled by default. > > Signed-off-by: Hernan Vargas > --- > drivers/baseband/acc100/rte_acc100_pmd.c | 37 ++++++++++++------------ > 1 file changed, 19 insertions(+), 18 deletions(-) > > diff --git a/drivers/baseband/acc100/rte_acc100_pmd.c b/drivers/baseband/acc100/rte_acc100_pmd.c > index 71409e11a1..e42748e8cc 100644 > --- a/drivers/baseband/acc100/rte_acc100_pmd.c > +++ b/drivers/baseband/acc100/rte_acc100_pmd.c > @@ -2222,7 +2222,8 @@ acc100_dma_enqueue(struct acc100_queue *q, uint16_t n, > > } > > -#ifdef RTE_LIBRTE_BBDEV_DEBUG > +#ifndef RTE_LIBRTE_BBDEV_SKIP_VALIDATE > + > /* Validates turbo encoder parameters */ > static inline int > validate_enc_op(struct rte_bbdev_enc_op *op, struct acc100_queue *q) > @@ -2479,10 +2480,10 @@ enqueue_enc_one_op_cb(struct acc100_queue *q, struct rte_bbdev_enc_op *op, > seg_total_left; > struct rte_mbuf *input, *output_head, *output; > > -#ifdef RTE_LIBRTE_BBDEV_DEBUG > +#ifndef RTE_LIBRTE_BBDEV_SKIP_VALIDATE > /* Validate op structure */ > if (validate_enc_op(op, q) == -1) { > - rte_bbdev_log(ERR, "Turbo encoder validation failed"); > + rte_bbdev_log(ERR, "Turbo encoder validation rejected"); > return -EINVAL; > } > #endif > @@ -2533,10 +2534,10 @@ enqueue_ldpc_enc_n_op_cb(struct acc100_queue *q, struct rte_bbdev_enc_op **ops, > uint16_t in_length_in_bytes; > struct rte_bbdev_op_ldpc_enc *enc = &ops[0]->ldpc_enc; > > -#ifdef RTE_LIBRTE_BBDEV_DEBUG > +#ifndef RTE_LIBRTE_BBDEV_SKIP_VALIDATE > /* Validate op structure */ > if (validate_ldpc_enc_op(ops[0], q) == -1) { > - rte_bbdev_log(ERR, "LDPC encoder validation failed"); > + rte_bbdev_log(ERR, "LDPC encoder validation rejected"); > return -EINVAL; > } > #endif > @@ -2595,10 +2596,10 @@ enqueue_ldpc_enc_one_op_cb(struct acc100_queue *q, struct rte_bbdev_enc_op *op, > seg_total_left; > struct rte_mbuf *input, *output_head, *output; > > -#ifdef RTE_LIBRTE_BBDEV_DEBUG > /* Validate op structure */ > +#ifndef RTE_LIBRTE_BBDEV_SKIP_VALIDATE > if (validate_ldpc_enc_op(op, q) == -1) { > - rte_bbdev_log(ERR, "LDPC encoder validation failed"); > + rte_bbdev_log(ERR, "LDPC encoder validation rejected"); > return -EINVAL; > } > #endif > @@ -2652,10 +2653,10 @@ enqueue_enc_one_op_tb(struct acc100_queue *q, struct rte_bbdev_enc_op *op, > struct rte_mbuf *input, *output_head, *output; > uint16_t current_enqueued_cbs = 0; > > -#ifdef RTE_LIBRTE_BBDEV_DEBUG > +#ifndef RTE_LIBRTE_BBDEV_SKIP_VALIDATE > /* Validate op structure */ > if (validate_enc_op(op, q) == -1) { > - rte_bbdev_log(ERR, "Turbo encoder validation failed"); > + rte_bbdev_log(ERR, "Turbo encoder validation rejected"); > return -EINVAL; > } > #endif > @@ -2724,7 +2725,7 @@ enqueue_enc_one_op_tb(struct acc100_queue *q, struct rte_bbdev_enc_op *op, > return current_enqueued_cbs; > } > > -#ifdef RTE_LIBRTE_BBDEV_DEBUG > +#ifndef RTE_LIBRTE_BBDEV_SKIP_VALIDATE > /* Validates turbo decoder parameters */ > static inline int > validate_dec_op(struct rte_bbdev_dec_op *op, struct acc100_queue *q) > @@ -2875,10 +2876,10 @@ enqueue_dec_one_op_cb(struct acc100_queue *q, struct rte_bbdev_dec_op *op, > struct rte_mbuf *input, *h_output_head, *h_output, > *s_output_head, *s_output; > > -#ifdef RTE_LIBRTE_BBDEV_DEBUG > +#ifndef RTE_LIBRTE_BBDEV_SKIP_VALIDATE > /* Validate op structure */ > if (validate_dec_op(op, q) == -1) { > - rte_bbdev_log(ERR, "Turbo decoder validation failed"); > + rte_bbdev_log(ERR, "Turbo decoder validation rejected"); > return -EINVAL; > } > #endif > @@ -3099,10 +3100,10 @@ enqueue_ldpc_dec_one_op_cb(struct acc100_queue *q, struct rte_bbdev_dec_op *op, > return ret; > } > > -#ifdef RTE_LIBRTE_BBDEV_DEBUG > +#ifndef RTE_LIBRTE_BBDEV_SKIP_VALIDATE > /* Validate op structure */ > if (validate_ldpc_dec_op(op, q) == -1) { > - rte_bbdev_log(ERR, "LDPC decoder validation failed"); > + rte_bbdev_log(ERR, "LDPC decoder validation rejected"); > return -EINVAL; > } > #endif > @@ -3204,10 +3205,10 @@ enqueue_ldpc_dec_one_op_tb(struct acc100_queue *q, struct rte_bbdev_dec_op *op, > struct rte_mbuf *input, *h_output_head, *h_output; > uint16_t current_enqueued_cbs = 0; > > -#ifdef RTE_LIBRTE_BBDEV_DEBUG > +#ifndef RTE_LIBRTE_BBDEV_SKIP_VALIDATE > /* Validate op structure */ > if (validate_ldpc_dec_op(op, q) == -1) { > - rte_bbdev_log(ERR, "LDPC decoder validation failed"); > + rte_bbdev_log(ERR, "LDPC decoder validation rejected"); > return -EINVAL; > } > #endif > @@ -3297,10 +3298,10 @@ enqueue_dec_one_op_tb(struct acc100_queue *q, struct rte_bbdev_dec_op *op, > *s_output_head, *s_output; > uint16_t current_enqueued_cbs = 0; > > -#ifdef RTE_LIBRTE_BBDEV_DEBUG > +#ifndef RTE_LIBRTE_BBDEV_SKIP_VALIDATE > /* Validate op structure */ > if (validate_dec_op(op, q) == -1) { > - rte_bbdev_log(ERR, "Turbo decoder validation failed"); > + rte_bbdev_log(ERR, "Turbo decoder validation rejected"); > return -EINVAL; > } > #endif Reviewed-by: Maxime Coquelin Thanks, Maxime