crypto: fix crypto callbacks macro

Message ID 20240415123548.705412-1-ciara.power@intel.com (mailing list archive)
State Rejected
Delegated to: akhil goyal
Headers
Series crypto: fix crypto callbacks macro |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/github-robot: build success github build: passed
ci/intel-Functional success Functional PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-compile-arm64-testing success Testing PASS

Commit Message

Power, Ciara April 15, 2024, 12:35 p.m. UTC
  The crypto callbacks macro is being used with ifdef instead of if,
so when the config file value is changed to 0 to disable, the code is
still being compiled in.

Fixes: 1c3ffb95595e ("cryptodev: add enqueue and dequeue callbacks")
Cc: abhinandan.gujjar@intel.com
Cc: stable@dpdk.org

Signed-off-by: Ciara Power <ciara.power@intel.com>
---
 lib/cryptodev/rte_cryptodev.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Power, Ciara April 16, 2024, 8:25 a.m. UTC | #1
> -----Original Message-----
> From: Power, Ciara <ciara.power@intel.com>
> Sent: Monday, April 15, 2024 1:36 PM
> To: dev@dpdk.org
> Cc: Power, Ciara <ciara.power@intel.com>; Gujjar, Abhinandan S
> <abhinandan.gujjar@intel.com>; stable@dpdk.org; Akhil Goyal
> <gakhil@marvell.com>; Fan Zhang <fanzhang.oss@gmail.com>
> Subject: [PATCH] crypto: fix crypto callbacks macro
> 
> The crypto callbacks macro is being used with ifdef instead of if, so when the
> config file value is changed to 0 to disable, the code is still being compiled in.
> 
> Fixes: 1c3ffb95595e ("cryptodev: add enqueue and dequeue callbacks")
> Cc: abhinandan.gujjar@intel.com
> Cc: stable@dpdk.org
> 
> Signed-off-by: Ciara Power <ciara.power@intel.com>
> ---
>  lib/cryptodev/rte_cryptodev.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/cryptodev/rte_cryptodev.h b/lib/cryptodev/rte_cryptodev.h index
> 00ba6a234a..357d4bcf9c 100644
> --- a/lib/cryptodev/rte_cryptodev.h
> +++ b/lib/cryptodev/rte_cryptodev.h
> @@ -1909,7 +1909,7 @@ rte_cryptodev_dequeue_burst(uint8_t dev_id,
> uint16_t qp_id,
> 
>  	nb_ops = fp_ops->dequeue_burst(qp, ops, nb_ops);
> 
> -#ifdef RTE_CRYPTO_CALLBACKS
> +#if RTE_CRYPTO_CALLBACKS
>  	if (unlikely(fp_ops->qp.deq_cb != NULL)) {
>  		struct rte_cryptodev_cb_rcu *list;
>  		struct rte_cryptodev_cb *cb;
> @@ -1976,7 +1976,7 @@ rte_cryptodev_enqueue_burst(uint8_t dev_id,
> uint16_t qp_id,
> 
>  	fp_ops = &rte_crypto_fp_ops[dev_id];
>  	qp = fp_ops->qp.data[qp_id];
> -#ifdef RTE_CRYPTO_CALLBACKS
> +#if RTE_CRYPTO_CALLBACKS
>  	if (unlikely(fp_ops->qp.enq_cb != NULL)) {
>  		struct rte_cryptodev_cb_rcu *list;
>  		struct rte_cryptodev_cb *cb;
> --
> 2.25.1

Rejecting this patch, as an alternative fix was sent along with some other fixes: https://patchwork.dpdk.org/project/dpdk/patch/20240416081222.3002268-1-ganapati.kundapura@intel.com/
  

Patch

diff --git a/lib/cryptodev/rte_cryptodev.h b/lib/cryptodev/rte_cryptodev.h
index 00ba6a234a..357d4bcf9c 100644
--- a/lib/cryptodev/rte_cryptodev.h
+++ b/lib/cryptodev/rte_cryptodev.h
@@ -1909,7 +1909,7 @@  rte_cryptodev_dequeue_burst(uint8_t dev_id, uint16_t qp_id,
 
 	nb_ops = fp_ops->dequeue_burst(qp, ops, nb_ops);
 
-#ifdef RTE_CRYPTO_CALLBACKS
+#if RTE_CRYPTO_CALLBACKS
 	if (unlikely(fp_ops->qp.deq_cb != NULL)) {
 		struct rte_cryptodev_cb_rcu *list;
 		struct rte_cryptodev_cb *cb;
@@ -1976,7 +1976,7 @@  rte_cryptodev_enqueue_burst(uint8_t dev_id, uint16_t qp_id,
 
 	fp_ops = &rte_crypto_fp_ops[dev_id];
 	qp = fp_ops->qp.data[qp_id];
-#ifdef RTE_CRYPTO_CALLBACKS
+#if RTE_CRYPTO_CALLBACKS
 	if (unlikely(fp_ops->qp.enq_cb != NULL)) {
 		struct rte_cryptodev_cb_rcu *list;
 		struct rte_cryptodev_cb *cb;