DPDK patches and discussions
 help / color / mirror / Atom feed
From: Akhil Goyal <gakhil@marvell.com>
To: <dev@dpdk.org>
Cc: <anoobj@marvell.com>, <jerinj@marvell.com>,
	<abhinandan.gujjar@intel.com>,  <jay.jayatheerthan@intel.com>,
	<narender.vangati@intel.com>, <vfialko@marvell.com>,
	Akhil Goyal <gakhil@marvell.com>,
	Fan Zhang <roy.fan.zhang@intel.com>,
	Abhinandan Gujjar <Abhinandan.gujjar@intel.com>
Subject: [PATCH v5 5/7] eventdev: use new API to get event crypto metadata
Date: Thu, 12 May 2022 18:15:25 +0530	[thread overview]
Message-ID: <20220512124527.2031321-6-gakhil@marvell.com> (raw)
In-Reply-To: <20220512124527.2031321-1-gakhil@marvell.com>

For getting event crypto metadata from crypto_op,
the new API rte_cryptodev_get_session_event_mdata is used
instead of getting userdata inside PMD.

Signed-off-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Abhinandan Gujjar <Abhinandan.gujjar@intel.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
---
 lib/eventdev/rte_event_crypto_adapter.c | 55 ++++++-------------------
 1 file changed, 12 insertions(+), 43 deletions(-)

diff --git a/lib/eventdev/rte_event_crypto_adapter.c b/lib/eventdev/rte_event_crypto_adapter.c
index f624f50187..7c695176f4 100644
--- a/lib/eventdev/rte_event_crypto_adapter.c
+++ b/lib/eventdev/rte_event_crypto_adapter.c
@@ -457,43 +457,22 @@ eca_enq_to_cryptodev(struct event_crypto_adapter *adapter, struct rte_event *ev,
 		crypto_op = ev[i].event_ptr;
 		if (crypto_op == NULL)
 			continue;
-		if (crypto_op->sess_type == RTE_CRYPTO_OP_WITH_SESSION) {
-			m_data = rte_cryptodev_sym_session_get_user_data(
-					crypto_op->sym->session);
-			if (m_data == NULL) {
-				rte_pktmbuf_free(crypto_op->sym->m_src);
-				rte_crypto_op_free(crypto_op);
-				continue;
-			}
+		m_data = rte_cryptodev_session_event_mdata_get(crypto_op);
+		if (m_data == NULL) {
+			rte_pktmbuf_free(crypto_op->sym->m_src);
+			rte_crypto_op_free(crypto_op);
+			continue;
+		}
 
-			cdev_id = m_data->request_info.cdev_id;
-			qp_id = m_data->request_info.queue_pair_id;
-			qp_info = &adapter->cdevs[cdev_id].qpairs[qp_id];
-			if (!qp_info->qp_enabled) {
-				rte_pktmbuf_free(crypto_op->sym->m_src);
-				rte_crypto_op_free(crypto_op);
-				continue;
-			}
-			eca_circular_buffer_add(&qp_info->cbuf, crypto_op);
-		} else if (crypto_op->sess_type == RTE_CRYPTO_OP_SESSIONLESS &&
-				crypto_op->private_data_offset) {
-			m_data = (union rte_event_crypto_metadata *)
-				 ((uint8_t *)crypto_op +
-					crypto_op->private_data_offset);
-			cdev_id = m_data->request_info.cdev_id;
-			qp_id = m_data->request_info.queue_pair_id;
-			qp_info = &adapter->cdevs[cdev_id].qpairs[qp_id];
-			if (!qp_info->qp_enabled) {
-				rte_pktmbuf_free(crypto_op->sym->m_src);
-				rte_crypto_op_free(crypto_op);
-				continue;
-			}
-			eca_circular_buffer_add(&qp_info->cbuf, crypto_op);
-		} else {
+		cdev_id = m_data->request_info.cdev_id;
+		qp_id = m_data->request_info.queue_pair_id;
+		qp_info = &adapter->cdevs[cdev_id].qpairs[qp_id];
+		if (!qp_info->qp_enabled) {
 			rte_pktmbuf_free(crypto_op->sym->m_src);
 			rte_crypto_op_free(crypto_op);
 			continue;
 		}
+		eca_circular_buffer_add(&qp_info->cbuf, crypto_op);
 
 		if (eca_circular_buffer_batch_ready(&qp_info->cbuf)) {
 			ret = eca_circular_buffer_flush_to_cdev(&qp_info->cbuf,
@@ -636,17 +615,7 @@ eca_ops_enqueue_burst(struct event_crypto_adapter *adapter,
 	for (i = 0; i < num; i++) {
 		struct rte_event *ev = &events[nb_ev++];
 
-		m_data = NULL;
-		if (ops[i]->sess_type == RTE_CRYPTO_OP_WITH_SESSION) {
-			m_data = rte_cryptodev_sym_session_get_user_data(
-					ops[i]->sym->session);
-		} else if (ops[i]->sess_type == RTE_CRYPTO_OP_SESSIONLESS &&
-				ops[i]->private_data_offset) {
-			m_data = (union rte_event_crypto_metadata *)
-				 ((uint8_t *)ops[i] +
-				  ops[i]->private_data_offset);
-		}
-
+		m_data = rte_cryptodev_session_event_mdata_get(ops[i]);
 		if (unlikely(m_data == NULL)) {
 			rte_pktmbuf_free(ops[i]->sym->m_src);
 			rte_crypto_op_free(ops[i]);
-- 
2.25.1


  parent reply	other threads:[~2022-05-12 12:46 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-25 11:16 [PATCH 0/2] Session crypto event metadata api Volodymyr Fialko
2022-03-25 11:16 ` [PATCH 1/2] security: introduce per session event metadata Volodymyr Fialko
2022-04-04  8:38   ` Gujjar, Abhinandan S
2022-04-04  9:48     ` Akhil Goyal
2022-04-04 10:42       ` Gujjar, Abhinandan S
2022-04-13  7:13         ` Akhil Goyal
2022-04-18 19:36           ` Akhil Goyal
2022-03-25 11:16 ` [PATCH 2/2] crypto/cnxk: support for security session enqueue Volodymyr Fialko
2022-04-18 19:33 ` [PATCH v2 0/7] Add new cryptodev op for event metadata Akhil Goyal
2022-04-18 19:33   ` [PATCH v2 1/7] cryptodev: add APIs to get/set " Akhil Goyal
2022-04-18 19:33   ` [PATCH v2 2/7] crypto/cnxk: add event metadata set operation Akhil Goyal
2022-04-18 19:33   ` [PATCH v2 3/7] crypto/octeontx: use new API for event metadata Akhil Goyal
2022-04-18 19:33   ` [PATCH v2 4/7] test/event: use new API to set event crypto metadata Akhil Goyal
2022-04-18 19:33   ` [PATCH v2 5/7] eventdev: use new API to get " Akhil Goyal
2022-04-18 19:33   ` [PATCH v2 6/7] test/event: add asymmetric cases for crypto adapter Akhil Goyal
2022-04-18 19:33   ` [PATCH v2 7/7] test-eventdev: support asym ops " Akhil Goyal
2022-04-21 14:37   ` [PATCH v3 0/7] Add new cryptodev op for event metadata Akhil Goyal
2022-04-21 14:37     ` [PATCH v3 1/7] cryptodev: add APIs to get/set " Akhil Goyal
2022-04-27 15:38       ` Zhang, Roy Fan
2022-04-28 14:42       ` Gujjar, Abhinandan S
2022-04-29 12:16         ` Akhil Goyal
2022-05-01 12:24           ` Gujjar, Abhinandan S
2022-05-01 18:37             ` Akhil Goyal
2022-04-21 14:37     ` [PATCH v3 2/7] crypto/cnxk: add event metadata set operation Akhil Goyal
2022-04-27 15:38       ` Zhang, Roy Fan
2022-05-01 13:17       ` Gujjar, Abhinandan S
2022-05-01 18:29         ` Akhil Goyal
2022-04-21 14:37     ` [PATCH v3 3/7] crypto/octeontx: use new API for event metadata Akhil Goyal
2022-04-27 15:38       ` Zhang, Roy Fan
2022-05-01 13:18       ` Gujjar, Abhinandan S
2022-04-21 14:37     ` [PATCH v3 4/7] test/event: use new API to set event crypto metadata Akhil Goyal
2022-04-27 15:39       ` Zhang, Roy Fan
2022-04-28 14:47       ` Gujjar, Abhinandan S
2022-04-21 14:37     ` [PATCH v3 5/7] eventdev: use new API to get " Akhil Goyal
2022-04-27 15:39       ` Zhang, Roy Fan
2022-04-28 15:08       ` Gujjar, Abhinandan S
2022-04-21 14:37     ` [PATCH v3 6/7] test/event: add asymmetric cases for crypto adapter Akhil Goyal
2022-04-27 15:39       ` Zhang, Roy Fan
2022-04-28 15:14       ` Gujjar, Abhinandan S
2022-04-29 12:23         ` Akhil Goyal
2022-05-01 12:45           ` Gujjar, Abhinandan S
2022-05-01 18:36             ` Akhil Goyal
2022-04-21 14:37     ` [PATCH v3 7/7] test-eventdev: support asym ops " Akhil Goyal
2022-04-27 15:40       ` Zhang, Roy Fan
2022-05-01 13:00       ` Gujjar, Abhinandan S
2022-04-27 15:37     ` [PATCH v3 0/7] Add new cryptodev op for event metadata Zhang, Roy Fan
2022-04-28 14:24     ` Gujjar, Abhinandan S
2022-05-01 19:24     ` [PATCH v4 " Akhil Goyal
2022-05-01 19:24       ` [PATCH v4 1/7] cryptodev: add APIs to get/set " Akhil Goyal
2022-05-02  9:01         ` Anoob Joseph
2022-05-02 11:06         ` Gujjar, Abhinandan S
2022-05-01 19:24       ` [PATCH v4 2/7] crypto/cnxk: add event metadata set operation Akhil Goyal
2022-05-02 11:07         ` Gujjar, Abhinandan S
2022-05-01 19:24       ` [PATCH v4 3/7] crypto/octeontx: use new API for event metadata Akhil Goyal
2022-05-01 19:24       ` [PATCH v4 4/7] test/event: use new API to set event crypto metadata Akhil Goyal
2022-05-01 19:24       ` [PATCH v4 5/7] eventdev: use new API to get " Akhil Goyal
2022-05-01 19:24       ` [PATCH v4 6/7] test/event: add asymmetric cases for crypto adapter Akhil Goyal
2022-05-02 11:08         ` Gujjar, Abhinandan S
2022-05-01 19:24       ` [PATCH v4 7/7] test-eventdev: support asym ops " Akhil Goyal
2022-05-02 11:08       ` [PATCH v4 0/7] Add new cryptodev op for event metadata Gujjar, Abhinandan S
2022-05-12 12:45       ` [PATCH v5 " Akhil Goyal
2022-05-12 12:45         ` [PATCH v5 1/7] cryptodev: add APIs to get/set " Akhil Goyal
2022-05-12 12:45         ` [PATCH v5 2/7] crypto/cnxk: add event metadata set operation Akhil Goyal
2022-05-12 12:45         ` [PATCH v5 3/7] crypto/octeontx: use new API for event metadata Akhil Goyal
2022-05-12 12:45         ` [PATCH v5 4/7] test/event: use new API to set event crypto metadata Akhil Goyal
2022-05-12 12:45         ` Akhil Goyal [this message]
2022-05-12 12:45         ` [PATCH v5 6/7] test/event: add asymmetric cases for crypto adapter Akhil Goyal
2022-05-12 12:45         ` [PATCH v5 7/7] test-eventdev: support asym ops " Akhil Goyal
2022-05-16 18:30         ` [PATCH v5 0/7] Add new cryptodev op for event metadata Akhil Goyal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220512124527.2031321-6-gakhil@marvell.com \
    --to=gakhil@marvell.com \
    --cc=abhinandan.gujjar@intel.com \
    --cc=anoobj@marvell.com \
    --cc=dev@dpdk.org \
    --cc=jay.jayatheerthan@intel.com \
    --cc=jerinj@marvell.com \
    --cc=narender.vangati@intel.com \
    --cc=roy.fan.zhang@intel.com \
    --cc=vfialko@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).