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 276F3A04F1; Sun, 8 Dec 2019 12:57:07 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 395941BF6D; Sun, 8 Dec 2019 12:56:31 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id EE4C8374E for ; Sun, 8 Dec 2019 12:56:29 +0100 (CET) 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 xB8Bq8Th005638; Sun, 8 Dec 2019 03:56:29 -0800 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=nyhCD/pkdMGHzYiM1obT2VQM87rAsBfzPTPHTB0JYJ0=; b=CTy/0B+pTtqZZ1qKiD0tdP3X3XLfsQmgry8Xo7K/NMIOHjMKOWC6oLS4zB4S2ZRr6ZN/ J2orhF69JSz6zEtye8h1WnJ1t85aAN+M2WgRAkc6/pXptlEJWmFqYQezsmCtHsyn3o4z Is8IMYEpV9broGoL4qqlkXAVxTsNsB8FRfu1hDvvTk76N1FZgHnFMkOoFhCm+n7UvDk7 xBCxqjJNcJ/FHeVdJc7Mk2swE0WkZm9kqKGKLLpSWu4/p6bHwHMc3pef9uO3YJUMHrcu z2JTDNBSZwdh+Ihmor6cerh2mewqFqcxvSPI2iC25awkY+5BXVJSq76S65aSABF/+Jwe cw== Received: from sc-exch01.marvell.com ([199.233.58.181]) by mx0b-0016f401.pphosted.com with ESMTP id 2wrcfptc26-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Sun, 08 Dec 2019 03:56:29 -0800 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Sun, 8 Dec 2019 03:56:27 -0800 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Sun, 8 Dec 2019 03:56:27 -0800 Received: from ajoseph83.caveonetworks.com.com (unknown [10.29.45.60]) by maili.marvell.com (Postfix) with ESMTP id 7E64A3F703F; Sun, 8 Dec 2019 03:56:22 -0800 (PST) From: Anoob Joseph To: Akhil Goyal , Declan Doherty , Thomas Monjalon CC: Ankur Dwivedi , Jerin Jacob , Narayana Prasad , Kiran Kumar K , Nithin Dabilpuram , Pavan Nikhilesh , Anoob Joseph , Archana Muniganti , "Tejasree Kondoj" , Vamsi Attunuru , Lukasz Bartosik , Date: Sun, 8 Dec 2019 17:24:48 +0530 Message-ID: <1575806094-28391-10-git-send-email-anoobj@marvell.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1575806094-28391-1-git-send-email-anoobj@marvell.com> References: <1575806094-28391-1-git-send-email-anoobj@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.95,18.0.572 definitions=2019-12-08_03:2019-12-05,2019-12-08 signatures=0 Subject: [dpdk-dev] [PATCH 09/15] crypto/octeontx2: add datapath ops in eth security ctx 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: Ankur Dwivedi Adding data path ops in eth security ctx. Signed-off-by: Ankur Dwivedi Signed-off-by: Anoob Joseph Signed-off-by: Archana Muniganti Signed-off-by: Tejasree Kondoj Signed-off-by: Vamsi Attunuru --- drivers/crypto/octeontx2/otx2_security.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/drivers/crypto/octeontx2/otx2_security.c b/drivers/crypto/octeontx2/otx2_security.c index 393bc12..545c806 100644 --- a/drivers/crypto/octeontx2/otx2_security.c +++ b/drivers/crypto/octeontx2/otx2_security.c @@ -486,6 +486,27 @@ otx2_sec_eth_session_get_size(void *device __rte_unused) return sizeof(struct otx2_sec_session); } +static int +otx2_sec_eth_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_sec_eth_get_userdata(void *device __rte_unused, uint64_t md, + void **userdata) +{ + /* Retrieve userdata */ + *userdata = (void *)md; + + return 0; +} + static const struct rte_security_capability * otx2_sec_eth_capabilities_get(void *device __rte_unused) { @@ -496,6 +517,8 @@ static struct rte_security_ops otx2_sec_eth_ops = { .session_create = otx2_sec_eth_session_create, .session_destroy = otx2_sec_eth_session_destroy, .session_get_size = otx2_sec_eth_session_get_size, + .set_pkt_metadata = otx2_sec_eth_set_pkt_mdata, + .get_userdata = otx2_sec_eth_get_userdata, .capabilities_get = otx2_sec_eth_capabilities_get }; -- 2.7.4