DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [dpdk-dev v1] test/cryptodev: add sgl oop in raw dp unit test
@ 2021-11-05 16:17 Kai Ji
  2022-01-07 15:06 ` [dpdk-dev v2] test/cryptodev: Fix " Kai Ji
  0 siblings, 1 reply; 3+ messages in thread
From: Kai Ji @ 2021-11-05 16:17 UTC (permalink / raw)
  To: dev; +Cc: Kai Ji

Add-in support of SGL OOP in sym raw dp unit test

Signed-off-by: Kai Ji <kai.ji@intel.com>
---
 app/test/test_cryptodev.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index b926412742..68ecd152c3 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -209,6 +209,7 @@ process_sym_raw_dp_op(uint8_t dev_id, uint16_t qp_id,
 	int enqueue_status, dequeue_status;
 	struct crypto_unittest_params *ut_params = &unittest_params;
 	int is_sgl = sop->m_src->nb_segs > 1;
+	int is_oop = 0;
 
 	ctx_service_size = rte_cryptodev_get_raw_dp_ctx_size(dev_id);
 	if (ctx_service_size < 0) {
@@ -247,6 +248,9 @@ process_sym_raw_dp_op(uint8_t dev_id, uint16_t qp_id,
 
 	ofs.raw = 0;
 
+	if ((sop->m_dst != NULL) && (sop->m_dst != sop->m_src))
+		is_oop = 1;
+
 	if (is_cipher && is_auth) {
 		cipher_offset = sop->cipher.data.offset;
 		cipher_len = sop->cipher.data.length;
@@ -277,6 +281,8 @@ process_sym_raw_dp_op(uint8_t dev_id, uint16_t qp_id,
 		if (is_sgl) {
 			uint32_t remaining_off = auth_offset + auth_len;
 			struct rte_mbuf *sgl_buf = sop->m_src;
+			if (is_oop)
+				sgl_buf = sop->m_dst;
 
 			while (remaining_off >= rte_pktmbuf_data_len(sgl_buf)
 					&& sgl_buf->next != NULL) {
@@ -293,7 +299,8 @@ process_sym_raw_dp_op(uint8_t dev_id, uint16_t qp_id,
 		/* Then check if digest-encrypted conditions are met */
 		if ((auth_offset + auth_len < cipher_offset + cipher_len) &&
 				(digest.iova == auth_end_iova) && is_sgl)
-			max_len = RTE_MAX(max_len, auth_offset + auth_len +
+			max_len = RTE_MAX(max_len,
+				auth_offset + auth_len +
 				ut_params->auth_xform.auth.digest_length);
 
 	} else if (is_cipher) {
@@ -356,7 +363,7 @@ process_sym_raw_dp_op(uint8_t dev_id, uint16_t qp_id,
 
 	sgl.num = n;
 	/* Out of place */
-	if (sop->m_dst != NULL) {
+	if (is_oop) {
 		dest_sgl.vec = dest_data_vec;
 		vec.dest_sgl = &dest_sgl;
 		n = rte_crypto_mbuf_to_vec(sop->m_dst, 0, max_len,
-- 
2.17.1


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

* [dpdk-dev v2] test/cryptodev: Fix sgl oop in raw dp unit test
  2021-11-05 16:17 [dpdk-dev] [dpdk-dev v1] test/cryptodev: add sgl oop in raw dp unit test Kai Ji
@ 2022-01-07 15:06 ` Kai Ji
  2022-02-08 21:15   ` [EXT] " Akhil Goyal
  0 siblings, 1 reply; 3+ messages in thread
From: Kai Ji @ 2022-01-07 15:06 UTC (permalink / raw)
  To: dev; +Cc: Kai Ji, hemant.agrawal

Fix SGL OOP support in sym raw dp unit test

Fixes: cd8166c28cd1 ("test/crypto: add raw API test for dpaax")
Cc: hemant.agrawal@nxp.com

Signed-off-by: Kai Ji <kai.ji@intel.com>
---
 app/test/test_cryptodev.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index 10b48cdadb..e43f8013cc 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -209,6 +209,7 @@ process_sym_raw_dp_op(uint8_t dev_id, uint16_t qp_id,
 	int enqueue_status, dequeue_status;
 	struct crypto_unittest_params *ut_params = &unittest_params;
 	int is_sgl = sop->m_src->nb_segs > 1;
+	int is_oop = 0;
 
 	ctx_service_size = rte_cryptodev_get_raw_dp_ctx_size(dev_id);
 	if (ctx_service_size < 0) {
@@ -247,6 +248,9 @@ process_sym_raw_dp_op(uint8_t dev_id, uint16_t qp_id,
 
 	ofs.raw = 0;
 
+	if ((sop->m_dst != NULL) && (sop->m_dst != sop->m_src))
+		is_oop = 1;
+
 	if (is_cipher && is_auth) {
 		cipher_offset = sop->cipher.data.offset;
 		cipher_len = sop->cipher.data.length;
@@ -277,6 +281,8 @@ process_sym_raw_dp_op(uint8_t dev_id, uint16_t qp_id,
 		if (is_sgl) {
 			uint32_t remaining_off = auth_offset + auth_len;
 			struct rte_mbuf *sgl_buf = sop->m_src;
+			if (is_oop)
+				sgl_buf = sop->m_dst;
 
 			while (remaining_off >= rte_pktmbuf_data_len(sgl_buf)
 					&& sgl_buf->next != NULL) {
@@ -293,7 +299,8 @@ process_sym_raw_dp_op(uint8_t dev_id, uint16_t qp_id,
 		/* Then check if digest-encrypted conditions are met */
 		if ((auth_offset + auth_len < cipher_offset + cipher_len) &&
 				(digest.iova == auth_end_iova) && is_sgl)
-			max_len = RTE_MAX(max_len, auth_offset + auth_len +
+			max_len = RTE_MAX(max_len,
+				auth_offset + auth_len +
 				ut_params->auth_xform.auth.digest_length);
 
 	} else if (is_cipher) {
@@ -356,7 +363,7 @@ process_sym_raw_dp_op(uint8_t dev_id, uint16_t qp_id,
 
 	sgl.num = n;
 	/* Out of place */
-	if (sop->m_dst != NULL) {
+	if (is_oop) {
 		dest_sgl.vec = dest_data_vec;
 		vec.dest_sgl = &dest_sgl;
 		n = rte_crypto_mbuf_to_vec(sop->m_dst, 0, max_len,
-- 
2.17.1


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

* RE: [EXT] [dpdk-dev v2] test/cryptodev: Fix sgl oop in raw dp unit test
  2022-01-07 15:06 ` [dpdk-dev v2] test/cryptodev: Fix " Kai Ji
@ 2022-02-08 21:15   ` Akhil Goyal
  0 siblings, 0 replies; 3+ messages in thread
From: Akhil Goyal @ 2022-02-08 21:15 UTC (permalink / raw)
  To: Kai Ji, dev; +Cc: hemant.agrawal

> Fix SGL OOP support in sym raw dp unit test
> 
> Fixes: cd8166c28cd1 ("test/crypto: add raw API test for dpaax")
> Cc: hemant.agrawal@nxp.com
> 
> Signed-off-by: Kai Ji <kai.ji@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>

Applied to dpdk-next-crypto

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

end of thread, other threads:[~2022-02-08 21:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-05 16:17 [dpdk-dev] [dpdk-dev v1] test/cryptodev: add sgl oop in raw dp unit test Kai Ji
2022-01-07 15:06 ` [dpdk-dev v2] test/cryptodev: Fix " Kai Ji
2022-02-08 21:15   ` [EXT] " 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).