From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 09705A00C4; Mon, 18 Apr 2022 21:34:11 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C70CB41156; Mon, 18 Apr 2022 21:33:53 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id E54E141156 for ; Mon, 18 Apr 2022 21:33:51 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 23ICOeW7010013; Mon, 18 Apr 2022 12:33:51 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=C6vAene4k5JTXyy1cM2Ecx2mhnXHITXvs8rX6oCsAfk=; b=d9tcnQcXZsg6yw9RwXvxdZAOuOMZyA8gOaGELQml+AP2V59p/X66wsYIydN7CX38uG9j CcLceFLBAlNlTgvyPlGCC/iLJf2KuFg75Nhw8eFGFlbDcUqWF7jH7KE+YQUgZMkR0pwG hgvTROB/kVrLASqwCTAAkRGpvIaDLGL3CdrpioCkzYYF8vHypsUUze1LJgSigPeT0IYo f5trT29lw/QhVk3l9NQ6a3563wnkxPF4GQkv/tDPEM+g7rUFBP/d+45MUzkzKMAukP4m 8eRNjN27jpzeM2k6YXZqgvW4hdNAF5MWYrISj7BYw23Kv/2XymGjNAIdcqppvKZGOsI5 iQ== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3ffwap0bk9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 18 Apr 2022 12:33:51 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 18 Apr 2022 12:33:49 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 18 Apr 2022 12:33:49 -0700 Received: from localhost.localdomain (unknown [10.28.48.55]) by maili.marvell.com (Postfix) with ESMTP id C61B55B6942; Mon, 18 Apr 2022 12:33:46 -0700 (PDT) From: Akhil Goyal To: CC: , , , , , , Akhil Goyal Subject: [PATCH v2 5/7] eventdev: use new API to get event crypto metadata Date: Tue, 19 Apr 2022 01:03:23 +0530 Message-ID: <20220418193325.368313-6-gakhil@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220418193325.368313-1-gakhil@marvell.com> References: <20220325111615.1118946-1-vfialko@marvell.com> <20220418193325.368313-1-gakhil@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: 3wOIwlyYd0Mgf32utouUmGY2ZN0Lu6jM X-Proofpoint-ORIG-GUID: 3wOIwlyYd0Mgf32utouUmGY2ZN0Lu6jM X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.858,Hydra:6.0.486,FMLib:17.11.64.514 definitions=2022-04-18_02,2022-04-15_01,2022-02-23_01 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 --- 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