DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH v1] crypto/ipsec_mb: remove unused defines
@ 2023-07-06 13:15 Brian Dooley
  2023-07-06 16:04 ` [PATCH v2 0/2] " Brian Dooley
  0 siblings, 1 reply; 11+ messages in thread
From: Brian Dooley @ 2023-07-06 13:15 UTC (permalink / raw)
  To: Kai Ji, Pablo de Lara; +Cc: dev, gakhil, Brian Dooley, david.coyle

removed AESNI_MB_DOCSIS_SEC_ENABLED defines as they are no longer used.

Fixes: fda5216fba55 ("crypto/aesni_mb: support DOCSIS protocol")
Cc: david.coyle@intel.com

Signed-off-by: Brian Dooley <brian.dooley@intel.com>
---
 drivers/crypto/ipsec_mb/ipsec_mb_private.c  |  4 ----
 drivers/crypto/ipsec_mb/pmd_aesni_mb.c      | 22 ++-------------------
 drivers/crypto/ipsec_mb/pmd_aesni_mb_priv.h |  1 -
 3 files changed, 2 insertions(+), 25 deletions(-)

diff --git a/drivers/crypto/ipsec_mb/ipsec_mb_private.c b/drivers/crypto/ipsec_mb/ipsec_mb_private.c
index 64f2b4b604..f485d130b6 100644
--- a/drivers/crypto/ipsec_mb/ipsec_mb_private.c
+++ b/drivers/crypto/ipsec_mb/ipsec_mb_private.c
@@ -205,10 +205,6 @@ ipsec_mb_remove(struct rte_vdev_device *vdev)
 		rte_free(cryptodev->security_ctx);
 		cryptodev->security_ctx = NULL;
 	}
-#ifdef AESNI_MB_DOCSIS_SEC_ENABLED
-	rte_free(cryptodev->security_ctx);
-	cryptodev->security_ctx = NULL;
-#endif
 
 	for (qp_id = 0; qp_id < cryptodev->data->nb_queue_pairs; qp_id++)
 		ipsec_mb_qp_release(cryptodev, qp_id);
diff --git a/drivers/crypto/ipsec_mb/pmd_aesni_mb.c b/drivers/crypto/ipsec_mb/pmd_aesni_mb.c
index 7fcb8f99e0..9e298023d7 100644
--- a/drivers/crypto/ipsec_mb/pmd_aesni_mb.c
+++ b/drivers/crypto/ipsec_mb/pmd_aesni_mb.c
@@ -851,7 +851,6 @@ aesni_mb_session_configure(IMB_MGR *mb_mgr,
 	return 0;
 }
 
-#ifdef AESNI_MB_DOCSIS_SEC_ENABLED
 /** Check DOCSIS security session configuration is valid */
 static int
 check_docsis_sec_session(struct rte_security_session_conf *conf)
@@ -988,7 +987,6 @@ aesni_mb_set_docsis_sec_session_parameters(
 	free_mb_mgr(mb_mgr);
 	return ret;
 }
-#endif
 
 static inline uint64_t
 auth_start_offset(struct rte_crypto_op *op, struct aesni_mb_session *session,
@@ -1762,7 +1760,6 @@ set_mb_job_params(IMB_JOB *job, struct ipsec_mb_qp *qp,
 	return 0;
 }
 
-#ifdef AESNI_MB_DOCSIS_SEC_ENABLED
 /**
  * Process a crypto operation containing a security op and complete a
  * IMB_JOB job structure for submission to the multi buffer library for
@@ -1853,7 +1850,6 @@ verify_docsis_sec_crc(IMB_JOB *job, uint8_t *status)
 	if (memcmp(job->auth_tag_output, crc, RTE_ETHER_CRC_LEN) != 0)
 		*status = RTE_CRYPTO_OP_STATUS_AUTH_FAILED;
 }
-#endif
 
 static inline void
 verify_digest(IMB_JOB *job, void *digest, uint16_t len, uint8_t *status)
@@ -1921,8 +1917,6 @@ post_process_mb_job(struct ipsec_mb_qp *qp, IMB_JOB *job)
 	struct aesni_mb_session *sess = NULL;
 	uint8_t *linear_buf = NULL;
 	int sgl = 0;
-
-#ifdef AESNI_MB_DOCSIS_SEC_ENABLED
 	uint8_t is_docsis_sec = 0;
 
 	if (op->sess_type == RTE_CRYPTO_OP_SECURITY_SESSION) {
@@ -1933,7 +1927,6 @@ post_process_mb_job(struct ipsec_mb_qp *qp, IMB_JOB *job)
 		is_docsis_sec = 1;
 		sess = SECURITY_GET_SESS_PRIV(op->sym->session);
 	} else
-#endif
 		sess = CRYPTODEV_GET_SYM_SESS_PRIV(op->sym->session);
 
 	if (likely(op->status == RTE_CRYPTO_OP_STATUS_NOT_PROCESSED)) {
@@ -1961,11 +1954,9 @@ post_process_mb_job(struct ipsec_mb_qp *qp, IMB_JOB *job)
 						op->sym->aead.digest.data,
 						sess->auth.req_digest_len,
 						&op->status);
-#ifdef AESNI_MB_DOCSIS_SEC_ENABLED
 				else if (is_docsis_sec)
 					verify_docsis_sec_crc(job,
 						&op->status);
-#endif
 				else
 					verify_digest(job,
 						op->sym->auth.digest.data,
@@ -2098,12 +2089,10 @@ aesni_mb_dequeue_burst(void *queue_pair, struct rte_crypto_op **ops,
 			job = jobs[i];
 			op = deqd_ops[i];
 
-#ifdef AESNI_MB_DOCSIS_SEC_ENABLED
 			if (op->sess_type == RTE_CRYPTO_OP_SECURITY_SESSION)
 				retval = set_sec_mb_job_params(job, qp, op,
 							       &digest_idx);
 			else
-#endif
 				retval = set_mb_job_params(job, qp, op,
 							   &digest_idx, mb_mgr);
 
@@ -2259,12 +2248,10 @@ aesni_mb_dequeue_burst(void *queue_pair, struct rte_crypto_op **ops,
 		if (retval < 0)
 			break;
 
-#ifdef AESNI_MB_DOCSIS_SEC_ENABLED
 		if (op->sess_type == RTE_CRYPTO_OP_SECURITY_SESSION)
 			retval = set_sec_mb_job_params(job, qp, op,
 						&digest_idx);
 		else
-#endif
 			retval = set_mb_job_params(job, qp, op,
 				&digest_idx, mb_mgr);
 
@@ -2440,7 +2427,6 @@ struct rte_cryptodev_ops aesni_mb_pmd_ops = {
 	.sym_session_clear = ipsec_mb_sym_session_clear
 };
 
-#ifdef AESNI_MB_DOCSIS_SEC_ENABLED
 /**
  * Configure a aesni multi-buffer session from a security session
  * configuration
@@ -2528,8 +2514,6 @@ aesni_mb_configure_dev(struct rte_cryptodev *dev)
 	return -ENOMEM;
 }
 
-#endif
-
 static int
 aesni_mb_probe(struct rte_vdev_device *vdev)
 {
@@ -2570,17 +2554,15 @@ RTE_INIT(ipsec_mb_register_aesni_mb)
 			RTE_CRYPTODEV_FF_IN_PLACE_SGL |
 			RTE_CRYPTODEV_FF_OOP_SGL_IN_SGL_OUT |
 			RTE_CRYPTODEV_FF_OOP_LB_IN_SGL_OUT |
-			RTE_CRYPTODEV_FF_OOP_SGL_IN_LB_OUT;
+			RTE_CRYPTODEV_FF_OOP_SGL_IN_LB_OUT |
+			RTE_CRYPTODEV_FF_SECURITY;
 
 	aesni_mb_data->internals_priv_size = 0;
 	aesni_mb_data->ops = &aesni_mb_pmd_ops;
 	aesni_mb_data->qp_priv_size = sizeof(struct aesni_mb_qp_data);
 	aesni_mb_data->queue_pair_configure = NULL;
-#ifdef AESNI_MB_DOCSIS_SEC_ENABLED
 	aesni_mb_data->security_ops = &aesni_mb_pmd_sec_ops;
 	aesni_mb_data->dev_config = aesni_mb_configure_dev;
-	aesni_mb_data->feature_flags |= RTE_CRYPTODEV_FF_SECURITY;
-#endif
 	aesni_mb_data->session_configure = aesni_mb_session_configure;
 	aesni_mb_data->session_priv_size = sizeof(struct aesni_mb_session);
 }
diff --git a/drivers/crypto/ipsec_mb/pmd_aesni_mb_priv.h b/drivers/crypto/ipsec_mb/pmd_aesni_mb_priv.h
index 3f6cf30c39..85994fe5a1 100644
--- a/drivers/crypto/ipsec_mb/pmd_aesni_mb_priv.h
+++ b/drivers/crypto/ipsec_mb/pmd_aesni_mb_priv.h
@@ -5,7 +5,6 @@
 #ifndef _PMD_AESNI_MB_PRIV_H_
 #define _PMD_AESNI_MB_PRIV_H_
 
-#define AESNI_MB_DOCSIS_SEC_ENABLED 1
 #include <rte_security.h>
 #include <rte_security_driver.h>
 #include <rte_ether.h>
-- 
2.25.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH v2 0/2] remove unused defines
  2023-07-06 13:15 [PATCH v1] crypto/ipsec_mb: remove unused defines Brian Dooley
@ 2023-07-06 16:04 ` Brian Dooley
  2023-07-06 16:04   ` [PATCH v2 1/2] crypto/ipsec_mb: " Brian Dooley
                     ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Brian Dooley @ 2023-07-06 16:04 UTC (permalink / raw)
  Cc: dev, gakhil, Brian Dooley

This series removes some unused defines throughout common qat drivers
and crypto ipsec mb drivers. It also removes some defines that should
have been removed previously.

v2:
more defines removed in additional patch and changed fixline

Brian Dooley (2):
  crypto/ipsec_mb: remove unused defines
  common/qat: change define header

 drivers/common/qat/qat_qp.c                 |  2 +-
 drivers/crypto/ipsec_mb/ipsec_mb_private.c  |  4 ----
 drivers/crypto/ipsec_mb/pmd_aesni_mb.c      | 22 ++-------------------
 drivers/crypto/ipsec_mb/pmd_aesni_mb_priv.h |  1 -
 4 files changed, 3 insertions(+), 26 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH v2 1/2] crypto/ipsec_mb: remove unused defines
  2023-07-06 16:04 ` [PATCH v2 0/2] " Brian Dooley
@ 2023-07-06 16:04   ` Brian Dooley
  2023-07-06 16:14     ` Power, Ciara
  2023-07-06 16:04   ` [PATCH v2 2/2] common/qat: change define header Brian Dooley
  2023-07-06 16:21   ` [PATCH v3 0/2] remove unused defines Brian Dooley
  2 siblings, 1 reply; 11+ messages in thread
From: Brian Dooley @ 2023-07-06 16:04 UTC (permalink / raw)
  To: Kai Ji, Pablo de Lara; +Cc: dev, gakhil, Brian Dooley, maxime.coquelin

removed AESNI_MB_DOCSIS_SEC_ENABLED defines as they are no longer used.

Fixes: 66a9d8d0bc6d ("crypto/qat: remove security library presence checks")
Cc: maxime.coquelin@redhat.com

Signed-off-by: Brian Dooley <brian.dooley@intel.com>
---
 drivers/crypto/ipsec_mb/ipsec_mb_private.c  |  4 ----
 drivers/crypto/ipsec_mb/pmd_aesni_mb.c      | 22 ++-------------------
 drivers/crypto/ipsec_mb/pmd_aesni_mb_priv.h |  1 -
 3 files changed, 2 insertions(+), 25 deletions(-)

diff --git a/drivers/crypto/ipsec_mb/ipsec_mb_private.c b/drivers/crypto/ipsec_mb/ipsec_mb_private.c
index 64f2b4b604..f485d130b6 100644
--- a/drivers/crypto/ipsec_mb/ipsec_mb_private.c
+++ b/drivers/crypto/ipsec_mb/ipsec_mb_private.c
@@ -205,10 +205,6 @@ ipsec_mb_remove(struct rte_vdev_device *vdev)
 		rte_free(cryptodev->security_ctx);
 		cryptodev->security_ctx = NULL;
 	}
-#ifdef AESNI_MB_DOCSIS_SEC_ENABLED
-	rte_free(cryptodev->security_ctx);
-	cryptodev->security_ctx = NULL;
-#endif
 
 	for (qp_id = 0; qp_id < cryptodev->data->nb_queue_pairs; qp_id++)
 		ipsec_mb_qp_release(cryptodev, qp_id);
diff --git a/drivers/crypto/ipsec_mb/pmd_aesni_mb.c b/drivers/crypto/ipsec_mb/pmd_aesni_mb.c
index 7fcb8f99e0..9e298023d7 100644
--- a/drivers/crypto/ipsec_mb/pmd_aesni_mb.c
+++ b/drivers/crypto/ipsec_mb/pmd_aesni_mb.c
@@ -851,7 +851,6 @@ aesni_mb_session_configure(IMB_MGR *mb_mgr,
 	return 0;
 }
 
-#ifdef AESNI_MB_DOCSIS_SEC_ENABLED
 /** Check DOCSIS security session configuration is valid */
 static int
 check_docsis_sec_session(struct rte_security_session_conf *conf)
@@ -988,7 +987,6 @@ aesni_mb_set_docsis_sec_session_parameters(
 	free_mb_mgr(mb_mgr);
 	return ret;
 }
-#endif
 
 static inline uint64_t
 auth_start_offset(struct rte_crypto_op *op, struct aesni_mb_session *session,
@@ -1762,7 +1760,6 @@ set_mb_job_params(IMB_JOB *job, struct ipsec_mb_qp *qp,
 	return 0;
 }
 
-#ifdef AESNI_MB_DOCSIS_SEC_ENABLED
 /**
  * Process a crypto operation containing a security op and complete a
  * IMB_JOB job structure for submission to the multi buffer library for
@@ -1853,7 +1850,6 @@ verify_docsis_sec_crc(IMB_JOB *job, uint8_t *status)
 	if (memcmp(job->auth_tag_output, crc, RTE_ETHER_CRC_LEN) != 0)
 		*status = RTE_CRYPTO_OP_STATUS_AUTH_FAILED;
 }
-#endif
 
 static inline void
 verify_digest(IMB_JOB *job, void *digest, uint16_t len, uint8_t *status)
@@ -1921,8 +1917,6 @@ post_process_mb_job(struct ipsec_mb_qp *qp, IMB_JOB *job)
 	struct aesni_mb_session *sess = NULL;
 	uint8_t *linear_buf = NULL;
 	int sgl = 0;
-
-#ifdef AESNI_MB_DOCSIS_SEC_ENABLED
 	uint8_t is_docsis_sec = 0;
 
 	if (op->sess_type == RTE_CRYPTO_OP_SECURITY_SESSION) {
@@ -1933,7 +1927,6 @@ post_process_mb_job(struct ipsec_mb_qp *qp, IMB_JOB *job)
 		is_docsis_sec = 1;
 		sess = SECURITY_GET_SESS_PRIV(op->sym->session);
 	} else
-#endif
 		sess = CRYPTODEV_GET_SYM_SESS_PRIV(op->sym->session);
 
 	if (likely(op->status == RTE_CRYPTO_OP_STATUS_NOT_PROCESSED)) {
@@ -1961,11 +1954,9 @@ post_process_mb_job(struct ipsec_mb_qp *qp, IMB_JOB *job)
 						op->sym->aead.digest.data,
 						sess->auth.req_digest_len,
 						&op->status);
-#ifdef AESNI_MB_DOCSIS_SEC_ENABLED
 				else if (is_docsis_sec)
 					verify_docsis_sec_crc(job,
 						&op->status);
-#endif
 				else
 					verify_digest(job,
 						op->sym->auth.digest.data,
@@ -2098,12 +2089,10 @@ aesni_mb_dequeue_burst(void *queue_pair, struct rte_crypto_op **ops,
 			job = jobs[i];
 			op = deqd_ops[i];
 
-#ifdef AESNI_MB_DOCSIS_SEC_ENABLED
 			if (op->sess_type == RTE_CRYPTO_OP_SECURITY_SESSION)
 				retval = set_sec_mb_job_params(job, qp, op,
 							       &digest_idx);
 			else
-#endif
 				retval = set_mb_job_params(job, qp, op,
 							   &digest_idx, mb_mgr);
 
@@ -2259,12 +2248,10 @@ aesni_mb_dequeue_burst(void *queue_pair, struct rte_crypto_op **ops,
 		if (retval < 0)
 			break;
 
-#ifdef AESNI_MB_DOCSIS_SEC_ENABLED
 		if (op->sess_type == RTE_CRYPTO_OP_SECURITY_SESSION)
 			retval = set_sec_mb_job_params(job, qp, op,
 						&digest_idx);
 		else
-#endif
 			retval = set_mb_job_params(job, qp, op,
 				&digest_idx, mb_mgr);
 
@@ -2440,7 +2427,6 @@ struct rte_cryptodev_ops aesni_mb_pmd_ops = {
 	.sym_session_clear = ipsec_mb_sym_session_clear
 };
 
-#ifdef AESNI_MB_DOCSIS_SEC_ENABLED
 /**
  * Configure a aesni multi-buffer session from a security session
  * configuration
@@ -2528,8 +2514,6 @@ aesni_mb_configure_dev(struct rte_cryptodev *dev)
 	return -ENOMEM;
 }
 
-#endif
-
 static int
 aesni_mb_probe(struct rte_vdev_device *vdev)
 {
@@ -2570,17 +2554,15 @@ RTE_INIT(ipsec_mb_register_aesni_mb)
 			RTE_CRYPTODEV_FF_IN_PLACE_SGL |
 			RTE_CRYPTODEV_FF_OOP_SGL_IN_SGL_OUT |
 			RTE_CRYPTODEV_FF_OOP_LB_IN_SGL_OUT |
-			RTE_CRYPTODEV_FF_OOP_SGL_IN_LB_OUT;
+			RTE_CRYPTODEV_FF_OOP_SGL_IN_LB_OUT |
+			RTE_CRYPTODEV_FF_SECURITY;
 
 	aesni_mb_data->internals_priv_size = 0;
 	aesni_mb_data->ops = &aesni_mb_pmd_ops;
 	aesni_mb_data->qp_priv_size = sizeof(struct aesni_mb_qp_data);
 	aesni_mb_data->queue_pair_configure = NULL;
-#ifdef AESNI_MB_DOCSIS_SEC_ENABLED
 	aesni_mb_data->security_ops = &aesni_mb_pmd_sec_ops;
 	aesni_mb_data->dev_config = aesni_mb_configure_dev;
-	aesni_mb_data->feature_flags |= RTE_CRYPTODEV_FF_SECURITY;
-#endif
 	aesni_mb_data->session_configure = aesni_mb_session_configure;
 	aesni_mb_data->session_priv_size = sizeof(struct aesni_mb_session);
 }
diff --git a/drivers/crypto/ipsec_mb/pmd_aesni_mb_priv.h b/drivers/crypto/ipsec_mb/pmd_aesni_mb_priv.h
index 3f6cf30c39..85994fe5a1 100644
--- a/drivers/crypto/ipsec_mb/pmd_aesni_mb_priv.h
+++ b/drivers/crypto/ipsec_mb/pmd_aesni_mb_priv.h
@@ -5,7 +5,6 @@
 #ifndef _PMD_AESNI_MB_PRIV_H_
 #define _PMD_AESNI_MB_PRIV_H_
 
-#define AESNI_MB_DOCSIS_SEC_ENABLED 1
 #include <rte_security.h>
 #include <rte_security_driver.h>
 #include <rte_ether.h>
-- 
2.25.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH v2 2/2] common/qat: change define header
  2023-07-06 16:04 ` [PATCH v2 0/2] " Brian Dooley
  2023-07-06 16:04   ` [PATCH v2 1/2] crypto/ipsec_mb: " Brian Dooley
@ 2023-07-06 16:04   ` Brian Dooley
  2023-07-06 16:12     ` Power, Ciara
  2023-07-06 16:21   ` [PATCH v3 0/2] remove unused defines Brian Dooley
  2 siblings, 1 reply; 11+ messages in thread
From: Brian Dooley @ 2023-07-06 16:04 UTC (permalink / raw)
  To: Kai Ji; +Cc: dev, gakhil, Brian Dooley, kevin.osullivan

change define from RTE_LIB_SECURITY to BUILD_QAT_SYM as
RTE_ETHER_CRC_LEN value is protected by BUILD_QAT_SYM.

Fixes: ce7a737c8f02 ("crypto/qat: support cipher-CRC offload")
Cc: kevin.osullivan@intel.com

Signed-off-by: Brian Dooley <brian.dooley@intel.com>
---
 drivers/common/qat/qat_qp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/common/qat/qat_qp.c b/drivers/common/qat/qat_qp.c
index 094d684abc..f284718441 100644
--- a/drivers/common/qat/qat_qp.c
+++ b/drivers/common/qat/qat_qp.c
@@ -11,7 +11,7 @@
 #include <bus_pci_driver.h>
 #include <rte_atomic.h>
 #include <rte_prefetch.h>
-#ifdef RTE_LIB_SECURITY
+#ifdef BUILD_QAT_SYM
 #include <rte_ether.h>
 #endif
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: [PATCH v2 2/2] common/qat: change define header
  2023-07-06 16:04   ` [PATCH v2 2/2] common/qat: change define header Brian Dooley
@ 2023-07-06 16:12     ` Power, Ciara
  0 siblings, 0 replies; 11+ messages in thread
From: Power, Ciara @ 2023-07-06 16:12 UTC (permalink / raw)
  To: Dooley, Brian, Ji, Kai; +Cc: dev, gakhil, Dooley, Brian, O'Sullivan, Kevin



> -----Original Message-----
> From: Brian Dooley <brian.dooley@intel.com>
> Sent: Thursday 6 July 2023 17:05
> To: Ji, Kai <kai.ji@intel.com>
> Cc: dev@dpdk.org; gakhil@marvell.com; Dooley, Brian
> <brian.dooley@intel.com>; O'Sullivan, Kevin <kevin.osullivan@intel.com>
> Subject: [PATCH v2 2/2] common/qat: change define header
> 
> change define from RTE_LIB_SECURITY to BUILD_QAT_SYM as
> RTE_ETHER_CRC_LEN value is protected by BUILD_QAT_SYM.
> 
> Fixes: ce7a737c8f02 ("crypto/qat: support cipher-CRC offload")
> Cc: kevin.osullivan@intel.com
> 
> Signed-off-by: Brian Dooley <brian.dooley@intel.com>
> ---
>  drivers/common/qat/qat_qp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/common/qat/qat_qp.c b/drivers/common/qat/qat_qp.c
> index 094d684abc..f284718441 100644
<snip>

Acked-by: Ciara Power <ciara.power@intel.com>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: [PATCH v2 1/2] crypto/ipsec_mb: remove unused defines
  2023-07-06 16:04   ` [PATCH v2 1/2] crypto/ipsec_mb: " Brian Dooley
@ 2023-07-06 16:14     ` Power, Ciara
  0 siblings, 0 replies; 11+ messages in thread
From: Power, Ciara @ 2023-07-06 16:14 UTC (permalink / raw)
  To: Dooley, Brian, Ji, Kai, De Lara Guarch, Pablo
  Cc: dev, gakhil, Dooley, Brian, maxime.coquelin

Hi Brian,

> -----Original Message-----
> From: Brian Dooley <brian.dooley@intel.com>
> Sent: Thursday 6 July 2023 17:05
> To: Ji, Kai <kai.ji@intel.com>; De Lara Guarch, Pablo
> <pablo.de.lara.guarch@intel.com>
> Cc: dev@dpdk.org; gakhil@marvell.com; Dooley, Brian
> <brian.dooley@intel.com>; maxime.coquelin@redhat.com
> Subject: [PATCH v2 1/2] crypto/ipsec_mb: remove unused defines
> 
> removed AESNI_MB_DOCSIS_SEC_ENABLED defines as they are no longer
> used.
> 
> Fixes: 66a9d8d0bc6d ("crypto/qat: remove security library presence checks")
> Cc: maxime.coquelin@redhat.com
> 

I think this fixes line should be:
Fixes: 798f9d134519 ("crypto/ipsec_mb: remove security lib presence checks")

Asides from that, code change looks good to me.

Acked-by: Ciara Power <ciara.power@intel.com>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH v3 0/2] remove unused defines
  2023-07-06 16:04 ` [PATCH v2 0/2] " Brian Dooley
  2023-07-06 16:04   ` [PATCH v2 1/2] crypto/ipsec_mb: " Brian Dooley
  2023-07-06 16:04   ` [PATCH v2 2/2] common/qat: change define header Brian Dooley
@ 2023-07-06 16:21   ` Brian Dooley
  2023-07-06 16:21     ` [PATCH v3 1/2] crypto/ipsec_mb: " Brian Dooley
                       ` (2 more replies)
  2 siblings, 3 replies; 11+ messages in thread
From: Brian Dooley @ 2023-07-06 16:21 UTC (permalink / raw)
  Cc: dev, gakhil, Brian Dooley

This series removes some unused defines throughout common qat drivers
and crypto ipsec mb drivers. It also removes some defines that should
have been removed previously.

v3:
Incorrect fixline

v2:
more defines removed in additional patch and changed fixline

Brian Dooley (2):
  crypto/ipsec_mb: remove unused defines
  common/qat: change define header

 drivers/common/qat/qat_qp.c                 |  2 +-
 drivers/crypto/ipsec_mb/ipsec_mb_private.c  |  4 ----
 drivers/crypto/ipsec_mb/pmd_aesni_mb.c      | 22 ++-------------------
 drivers/crypto/ipsec_mb/pmd_aesni_mb_priv.h |  1 -
 4 files changed, 3 insertions(+), 26 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH v3 1/2] crypto/ipsec_mb: remove unused defines
  2023-07-06 16:21   ` [PATCH v3 0/2] remove unused defines Brian Dooley
@ 2023-07-06 16:21     ` Brian Dooley
  2023-07-07 11:38       ` Maxime Coquelin
  2023-07-06 16:21     ` [PATCH v3 2/2] common/qat: change define header Brian Dooley
  2023-07-06 18:31     ` [EXT] [PATCH v3 0/2] remove unused defines Akhil Goyal
  2 siblings, 1 reply; 11+ messages in thread
From: Brian Dooley @ 2023-07-06 16:21 UTC (permalink / raw)
  To: Kai Ji, Pablo de Lara; +Cc: dev, gakhil, Brian Dooley, maxime.coquelin

removed AESNI_MB_DOCSIS_SEC_ENABLED defines as they are no longer used.

Fixes: 798f9d134519 ("crypto/ipsec_mb: remove security lib presence checks")
Cc: maxime.coquelin@redhat.com

Signed-off-by: Brian Dooley <brian.dooley@intel.com>
---
 drivers/crypto/ipsec_mb/ipsec_mb_private.c  |  4 ----
 drivers/crypto/ipsec_mb/pmd_aesni_mb.c      | 22 ++-------------------
 drivers/crypto/ipsec_mb/pmd_aesni_mb_priv.h |  1 -
 3 files changed, 2 insertions(+), 25 deletions(-)

diff --git a/drivers/crypto/ipsec_mb/ipsec_mb_private.c b/drivers/crypto/ipsec_mb/ipsec_mb_private.c
index 64f2b4b604..f485d130b6 100644
--- a/drivers/crypto/ipsec_mb/ipsec_mb_private.c
+++ b/drivers/crypto/ipsec_mb/ipsec_mb_private.c
@@ -205,10 +205,6 @@ ipsec_mb_remove(struct rte_vdev_device *vdev)
 		rte_free(cryptodev->security_ctx);
 		cryptodev->security_ctx = NULL;
 	}
-#ifdef AESNI_MB_DOCSIS_SEC_ENABLED
-	rte_free(cryptodev->security_ctx);
-	cryptodev->security_ctx = NULL;
-#endif
 
 	for (qp_id = 0; qp_id < cryptodev->data->nb_queue_pairs; qp_id++)
 		ipsec_mb_qp_release(cryptodev, qp_id);
diff --git a/drivers/crypto/ipsec_mb/pmd_aesni_mb.c b/drivers/crypto/ipsec_mb/pmd_aesni_mb.c
index 7fcb8f99e0..9e298023d7 100644
--- a/drivers/crypto/ipsec_mb/pmd_aesni_mb.c
+++ b/drivers/crypto/ipsec_mb/pmd_aesni_mb.c
@@ -851,7 +851,6 @@ aesni_mb_session_configure(IMB_MGR *mb_mgr,
 	return 0;
 }
 
-#ifdef AESNI_MB_DOCSIS_SEC_ENABLED
 /** Check DOCSIS security session configuration is valid */
 static int
 check_docsis_sec_session(struct rte_security_session_conf *conf)
@@ -988,7 +987,6 @@ aesni_mb_set_docsis_sec_session_parameters(
 	free_mb_mgr(mb_mgr);
 	return ret;
 }
-#endif
 
 static inline uint64_t
 auth_start_offset(struct rte_crypto_op *op, struct aesni_mb_session *session,
@@ -1762,7 +1760,6 @@ set_mb_job_params(IMB_JOB *job, struct ipsec_mb_qp *qp,
 	return 0;
 }
 
-#ifdef AESNI_MB_DOCSIS_SEC_ENABLED
 /**
  * Process a crypto operation containing a security op and complete a
  * IMB_JOB job structure for submission to the multi buffer library for
@@ -1853,7 +1850,6 @@ verify_docsis_sec_crc(IMB_JOB *job, uint8_t *status)
 	if (memcmp(job->auth_tag_output, crc, RTE_ETHER_CRC_LEN) != 0)
 		*status = RTE_CRYPTO_OP_STATUS_AUTH_FAILED;
 }
-#endif
 
 static inline void
 verify_digest(IMB_JOB *job, void *digest, uint16_t len, uint8_t *status)
@@ -1921,8 +1917,6 @@ post_process_mb_job(struct ipsec_mb_qp *qp, IMB_JOB *job)
 	struct aesni_mb_session *sess = NULL;
 	uint8_t *linear_buf = NULL;
 	int sgl = 0;
-
-#ifdef AESNI_MB_DOCSIS_SEC_ENABLED
 	uint8_t is_docsis_sec = 0;
 
 	if (op->sess_type == RTE_CRYPTO_OP_SECURITY_SESSION) {
@@ -1933,7 +1927,6 @@ post_process_mb_job(struct ipsec_mb_qp *qp, IMB_JOB *job)
 		is_docsis_sec = 1;
 		sess = SECURITY_GET_SESS_PRIV(op->sym->session);
 	} else
-#endif
 		sess = CRYPTODEV_GET_SYM_SESS_PRIV(op->sym->session);
 
 	if (likely(op->status == RTE_CRYPTO_OP_STATUS_NOT_PROCESSED)) {
@@ -1961,11 +1954,9 @@ post_process_mb_job(struct ipsec_mb_qp *qp, IMB_JOB *job)
 						op->sym->aead.digest.data,
 						sess->auth.req_digest_len,
 						&op->status);
-#ifdef AESNI_MB_DOCSIS_SEC_ENABLED
 				else if (is_docsis_sec)
 					verify_docsis_sec_crc(job,
 						&op->status);
-#endif
 				else
 					verify_digest(job,
 						op->sym->auth.digest.data,
@@ -2098,12 +2089,10 @@ aesni_mb_dequeue_burst(void *queue_pair, struct rte_crypto_op **ops,
 			job = jobs[i];
 			op = deqd_ops[i];
 
-#ifdef AESNI_MB_DOCSIS_SEC_ENABLED
 			if (op->sess_type == RTE_CRYPTO_OP_SECURITY_SESSION)
 				retval = set_sec_mb_job_params(job, qp, op,
 							       &digest_idx);
 			else
-#endif
 				retval = set_mb_job_params(job, qp, op,
 							   &digest_idx, mb_mgr);
 
@@ -2259,12 +2248,10 @@ aesni_mb_dequeue_burst(void *queue_pair, struct rte_crypto_op **ops,
 		if (retval < 0)
 			break;
 
-#ifdef AESNI_MB_DOCSIS_SEC_ENABLED
 		if (op->sess_type == RTE_CRYPTO_OP_SECURITY_SESSION)
 			retval = set_sec_mb_job_params(job, qp, op,
 						&digest_idx);
 		else
-#endif
 			retval = set_mb_job_params(job, qp, op,
 				&digest_idx, mb_mgr);
 
@@ -2440,7 +2427,6 @@ struct rte_cryptodev_ops aesni_mb_pmd_ops = {
 	.sym_session_clear = ipsec_mb_sym_session_clear
 };
 
-#ifdef AESNI_MB_DOCSIS_SEC_ENABLED
 /**
  * Configure a aesni multi-buffer session from a security session
  * configuration
@@ -2528,8 +2514,6 @@ aesni_mb_configure_dev(struct rte_cryptodev *dev)
 	return -ENOMEM;
 }
 
-#endif
-
 static int
 aesni_mb_probe(struct rte_vdev_device *vdev)
 {
@@ -2570,17 +2554,15 @@ RTE_INIT(ipsec_mb_register_aesni_mb)
 			RTE_CRYPTODEV_FF_IN_PLACE_SGL |
 			RTE_CRYPTODEV_FF_OOP_SGL_IN_SGL_OUT |
 			RTE_CRYPTODEV_FF_OOP_LB_IN_SGL_OUT |
-			RTE_CRYPTODEV_FF_OOP_SGL_IN_LB_OUT;
+			RTE_CRYPTODEV_FF_OOP_SGL_IN_LB_OUT |
+			RTE_CRYPTODEV_FF_SECURITY;
 
 	aesni_mb_data->internals_priv_size = 0;
 	aesni_mb_data->ops = &aesni_mb_pmd_ops;
 	aesni_mb_data->qp_priv_size = sizeof(struct aesni_mb_qp_data);
 	aesni_mb_data->queue_pair_configure = NULL;
-#ifdef AESNI_MB_DOCSIS_SEC_ENABLED
 	aesni_mb_data->security_ops = &aesni_mb_pmd_sec_ops;
 	aesni_mb_data->dev_config = aesni_mb_configure_dev;
-	aesni_mb_data->feature_flags |= RTE_CRYPTODEV_FF_SECURITY;
-#endif
 	aesni_mb_data->session_configure = aesni_mb_session_configure;
 	aesni_mb_data->session_priv_size = sizeof(struct aesni_mb_session);
 }
diff --git a/drivers/crypto/ipsec_mb/pmd_aesni_mb_priv.h b/drivers/crypto/ipsec_mb/pmd_aesni_mb_priv.h
index 3f6cf30c39..85994fe5a1 100644
--- a/drivers/crypto/ipsec_mb/pmd_aesni_mb_priv.h
+++ b/drivers/crypto/ipsec_mb/pmd_aesni_mb_priv.h
@@ -5,7 +5,6 @@
 #ifndef _PMD_AESNI_MB_PRIV_H_
 #define _PMD_AESNI_MB_PRIV_H_
 
-#define AESNI_MB_DOCSIS_SEC_ENABLED 1
 #include <rte_security.h>
 #include <rte_security_driver.h>
 #include <rte_ether.h>
-- 
2.25.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH v3 2/2] common/qat: change define header
  2023-07-06 16:21   ` [PATCH v3 0/2] remove unused defines Brian Dooley
  2023-07-06 16:21     ` [PATCH v3 1/2] crypto/ipsec_mb: " Brian Dooley
@ 2023-07-06 16:21     ` Brian Dooley
  2023-07-06 18:31     ` [EXT] [PATCH v3 0/2] remove unused defines Akhil Goyal
  2 siblings, 0 replies; 11+ messages in thread
From: Brian Dooley @ 2023-07-06 16:21 UTC (permalink / raw)
  To: Kai Ji; +Cc: dev, gakhil, Brian Dooley, kevin.osullivan

change define from RTE_LIB_SECURITY to BUILD_QAT_SYM as
RTE_ETHER_CRC_LEN value is protected by BUILD_QAT_SYM.

Fixes: ce7a737c8f02 ("crypto/qat: support cipher-CRC offload")
Cc: kevin.osullivan@intel.com

Signed-off-by: Brian Dooley <brian.dooley@intel.com>
---
 drivers/common/qat/qat_qp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/common/qat/qat_qp.c b/drivers/common/qat/qat_qp.c
index 094d684abc..f284718441 100644
--- a/drivers/common/qat/qat_qp.c
+++ b/drivers/common/qat/qat_qp.c
@@ -11,7 +11,7 @@
 #include <bus_pci_driver.h>
 #include <rte_atomic.h>
 #include <rte_prefetch.h>
-#ifdef RTE_LIB_SECURITY
+#ifdef BUILD_QAT_SYM
 #include <rte_ether.h>
 #endif
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: [EXT] [PATCH v3 0/2] remove unused defines
  2023-07-06 16:21   ` [PATCH v3 0/2] remove unused defines Brian Dooley
  2023-07-06 16:21     ` [PATCH v3 1/2] crypto/ipsec_mb: " Brian Dooley
  2023-07-06 16:21     ` [PATCH v3 2/2] common/qat: change define header Brian Dooley
@ 2023-07-06 18:31     ` Akhil Goyal
  2 siblings, 0 replies; 11+ messages in thread
From: Akhil Goyal @ 2023-07-06 18:31 UTC (permalink / raw)
  To: Brian Dooley; +Cc: dev

> This series removes some unused defines throughout common qat drivers
> and crypto ipsec mb drivers. It also removes some defines that should
> have been removed previously.
> 
> v3:
> Incorrect fixline
Series applied to dpdk-next-crypto
Thanks

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v3 1/2] crypto/ipsec_mb: remove unused defines
  2023-07-06 16:21     ` [PATCH v3 1/2] crypto/ipsec_mb: " Brian Dooley
@ 2023-07-07 11:38       ` Maxime Coquelin
  0 siblings, 0 replies; 11+ messages in thread
From: Maxime Coquelin @ 2023-07-07 11:38 UTC (permalink / raw)
  To: Brian Dooley, Kai Ji, Pablo de Lara; +Cc: dev, gakhil



On 7/6/23 18:21, Brian Dooley wrote:
> removed AESNI_MB_DOCSIS_SEC_ENABLED defines as they are no longer used.
> 
> Fixes: 798f9d134519 ("crypto/ipsec_mb: remove security lib presence checks")
> Cc: maxime.coquelin@redhat.com
> 
> Signed-off-by: Brian Dooley <brian.dooley@intel.com>
> ---
>   drivers/crypto/ipsec_mb/ipsec_mb_private.c  |  4 ----
>   drivers/crypto/ipsec_mb/pmd_aesni_mb.c      | 22 ++-------------------
>   drivers/crypto/ipsec_mb/pmd_aesni_mb_priv.h |  1 -
>   3 files changed, 2 insertions(+), 25 deletions(-)
> 

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2023-07-07 11:38 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-06 13:15 [PATCH v1] crypto/ipsec_mb: remove unused defines Brian Dooley
2023-07-06 16:04 ` [PATCH v2 0/2] " Brian Dooley
2023-07-06 16:04   ` [PATCH v2 1/2] crypto/ipsec_mb: " Brian Dooley
2023-07-06 16:14     ` Power, Ciara
2023-07-06 16:04   ` [PATCH v2 2/2] common/qat: change define header Brian Dooley
2023-07-06 16:12     ` Power, Ciara
2023-07-06 16:21   ` [PATCH v3 0/2] remove unused defines Brian Dooley
2023-07-06 16:21     ` [PATCH v3 1/2] crypto/ipsec_mb: " Brian Dooley
2023-07-07 11:38       ` Maxime Coquelin
2023-07-06 16:21     ` [PATCH v3 2/2] common/qat: change define header Brian Dooley
2023-07-06 18:31     ` [EXT] [PATCH v3 0/2] remove unused defines Akhil Goyal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).