diff mbox series

[v2,11/37] baseband/acc100: separate validation functions from debug

Message ID 20220820023157.189047-12-hernan.vargas@intel.com (mailing list archive)
State Superseded
Delegated to: akhil goyal
Headers show
Series baseband/acc100: changes for 22.11 | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Hernan Vargas Aug. 20, 2022, 2:31 a.m. UTC
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 <hernan.vargas@intel.com>
---
 drivers/baseband/acc100/rte_acc100_pmd.c | 37 ++++++++++++------------
 1 file changed, 19 insertions(+), 18 deletions(-)

Comments

Maxime Coquelin Sept. 14, 2022, 8:35 p.m. UTC | #1
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 <hernan.vargas@intel.com>
> ---
>   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 <maxime.coquelin@redhat.com>

Thanks,
Maxime
diff mbox series

Patch

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