From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 51A90A0546; Thu, 16 Jul 2020 09:46:23 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AE0351BF60; Thu, 16 Jul 2020 09:46:01 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 6E2781BF5B for ; Thu, 16 Jul 2020 09:46:00 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 06G7YjMW004466; Thu, 16 Jul 2020 00:45:59 -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=pfpt0818; bh=KzILYc0MQ10OsqHb1iNeZZpmKRyLus4tVvST8fIw5WM=; b=Dt2tNa5lpD5cA7QyDERnuIlhMFc4+C2wKDLEkKw78gBUR02xt5FcCs3zBKqVOyDNew+U Tevfhz6DeY+R3nfzTYWp1Hh4tBd3eciqS01rDs2TUXiCKndECK8Kt5HLdc6RpZK17rca PkCnnmBfSN179dw3TFHVXlb3WJrCpc8jiq5rfAY5YjyWD0oIRYfcb5VQpHZQMEh4kvjN qQGF57ceFQKhewwVHvqusSgigwQZcA4XVynRBfYBoSYBP0dVHXyqgAnrQyKXVmlAiZcY KpDvCVlGgWdOtyzevgH9g5WDWb1MyXgkz/lLJeZJ0/mFFD07W/sb3EQBEKoMbUAgJqYN MQ== Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0b-0016f401.pphosted.com with ESMTP id 328mmhxm9d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 16 Jul 2020 00:45:59 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 16 Jul 2020 00:45:58 -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; Thu, 16 Jul 2020 00:45:58 -0700 Received: from hyd1554T5810.caveonetworks.com.com (unknown [10.29.57.11]) by maili.marvell.com (Postfix) with ESMTP id 210933F703F; Thu, 16 Jul 2020 00:45:55 -0700 (PDT) From: Tejasree Kondoj To: Akhil Goyal , Radu Nicolau CC: Vamsi Attunuru , Narayana Prasad , Anoob Joseph , Tejasree Kondoj , Date: Thu, 16 Jul 2020 14:09:29 +0530 Message-ID: <20200716083931.29092-7-ktejasree@marvell.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200716083931.29092-1-ktejasree@marvell.com> References: <20200716083931.29092-1-ktejasree@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-07-16_04:2020-07-16, 2020-07-16 signatures=0 Subject: [dpdk-dev] [PATCH v3 6/8] crypto/octeontx2: add cryptodev sec misc callbacks X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Vamsi Attunuru This patch adds lookaside IPsec callback functions. Signed-off-by: Vamsi Attunuru Signed-off-by: Tejasree Kondoj --- drivers/crypto/octeontx2/otx2_cryptodev_sec.c | 34 +++++++++++++++++-- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/drivers/crypto/octeontx2/otx2_cryptodev_sec.c b/drivers/crypto/octeontx2/otx2_cryptodev_sec.c index 906a87b9e5..6e14b37a68 100644 --- a/drivers/crypto/octeontx2/otx2_cryptodev_sec.c +++ b/drivers/crypto/octeontx2/otx2_cryptodev_sec.c @@ -10,13 +10,41 @@ #include "otx2_cryptodev.h" #include "otx2_cryptodev_capabilities.h" #include "otx2_cryptodev_sec.h" +#include "otx2_security.h" + +static unsigned int +otx2_crypto_sec_session_get_size(void *device __rte_unused) +{ + return sizeof(struct otx2_sec_session); +} + +static int +otx2_crypto_sec_set_pkt_mdata(void *device __rte_unused, + struct rte_security_session *session, + struct rte_mbuf *m, void *params __rte_unused) +{ + /* Set security session as the pkt metadata */ + m->udata64 = (uint64_t)session; + + return 0; +} + +static int +otx2_crypto_sec_get_userdata(void *device __rte_unused, uint64_t md, + void **userdata) +{ + /* Retrieve userdata */ + *userdata = (void *)md; + + return 0; +} static struct rte_security_ops otx2_crypto_sec_ops = { .session_create = NULL, .session_destroy = NULL, - .session_get_size = NULL, - .set_pkt_metadata = NULL, - .get_userdata = NULL, + .session_get_size = otx2_crypto_sec_session_get_size, + .set_pkt_metadata = otx2_crypto_sec_set_pkt_mdata, + .get_userdata = otx2_crypto_sec_get_userdata, .capabilities_get = otx2_crypto_sec_capabilities_get }; -- 2.27.0