From patchwork Fri Sep 24 17:11:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tejasree Kondoj X-Patchwork-Id: 99641 X-Patchwork-Delegate: jerinj@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 180AEA0548; Fri, 24 Sep 2021 18:18:05 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 88D6041305; Fri, 24 Sep 2021 18:18:04 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 0E584412F8 for ; Fri, 24 Sep 2021 18:18:02 +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 SMTP id 18OFabF2011108 for ; Fri, 24 Sep 2021 09:18:02 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=DUMmjM/KKBdUXil95mw+bmL4sILDz3asgBhgN+lqTmc=; b=A+xjIJQg6NoG8ekp7lDZukSgVcjT7qy/Is5vPhxYz8aH+Vv7EZsIAtsyVfWT3uWFIFeb UK6jwtAy2iyJESiIKk+wpccDC3eix9chICI0s62+DNT83BGlzLlGxdbkvdWOj1nCMd4+ s+F9mr2O3bL7byzHwtmTOy7wXtmSH2LoQyt8XRqvj/GTx7M7FKA4Tv0AibqtiMuESZ2L Sk3CHY6VsthuBoDqvD2iYR58VFTo7tt5qDs0Nt5R9/ptsjKlb/iKy2SePV8+YOUvewzz pXiwQYCaBhdSixB1OPbu6gGAynYK50ejF02lxSaY46wrIBhEd4pVHXX6TxS8B/aLYBz1 ug== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com with ESMTP id 3b9hf504cf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Fri, 24 Sep 2021 09:18:01 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Fri, 24 Sep 2021 09:18:00 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Fri, 24 Sep 2021 09:18:00 -0700 Received: from hyd1554T5810.caveonetworks.com.com (unknown [10.29.57.11]) by maili.marvell.com (Postfix) with ESMTP id 5F8223F704E; Fri, 24 Sep 2021 09:17:58 -0700 (PDT) From: Tejasree Kondoj To: Jerin Jacob CC: Tejasree Kondoj , Nithin Dabilpuram , Anoob Joseph , Date: Fri, 24 Sep 2021 22:41:45 +0530 Message-ID: <20210924171145.15287-1-ktejasree@marvell.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-Proofpoint-GUID: Ix0lGfZW0JFD9m799tAQHMMS--c9IQHJ X-Proofpoint-ORIG-GUID: Ix0lGfZW0JFD9m799tAQHMMS--c9IQHJ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1,Aquarius:18.0.790,Hydra:6.0.391,FMLib:17.0.607.475 definitions=2021-09-24_05,2021-09-24_02,2020-04-07_01 Subject: [dpdk-dev] [PATCH] net/octeontx2: use fast udata and mdata flags 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 Sender: "dev" Using fast metadata and userdata flags instead of driver callbacks for set_pkt_metadata and get_userdata in inline IPsec. Signed-off-by: Tejasree Kondoj Acked-by: Anoob Joseph --- drivers/net/octeontx2/otx2_ethdev_sec.c | 25 ++-------------------- drivers/net/octeontx2/otx2_ethdev_sec_tx.h | 2 +- 2 files changed, 3 insertions(+), 24 deletions(-) diff --git a/drivers/net/octeontx2/otx2_ethdev_sec.c b/drivers/net/octeontx2/otx2_ethdev_sec.c index c2a36883cb..7bd1ed6da0 100644 --- a/drivers/net/octeontx2/otx2_ethdev_sec.c +++ b/drivers/net/octeontx2/otx2_ethdev_sec.c @@ -741,27 +741,6 @@ otx2_eth_sec_session_get_size(void *device __rte_unused) return sizeof(struct otx2_sec_session); } -static int -otx2_eth_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 */ - *rte_security_dynfield(m) = (rte_security_dynfield_t)session; - - return 0; -} - -static int -otx2_eth_sec_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_eth_sec_capabilities_get(void *device __rte_unused) { @@ -772,8 +751,6 @@ static struct rte_security_ops otx2_eth_sec_ops = { .session_create = otx2_eth_sec_session_create, .session_destroy = otx2_eth_sec_session_destroy, .session_get_size = otx2_eth_sec_session_get_size, - .set_pkt_metadata = otx2_eth_sec_set_pkt_mdata, - .get_userdata = otx2_eth_sec_get_userdata, .capabilities_get = otx2_eth_sec_capabilities_get }; @@ -799,6 +776,8 @@ otx2_eth_sec_ctx_create(struct rte_eth_dev *eth_dev) ctx->device = eth_dev; ctx->ops = &otx2_eth_sec_ops; ctx->sess_cnt = 0; + ctx->flags = + (RTE_SEC_CTX_F_FAST_SET_MDATA | RTE_SEC_CTX_F_FAST_GET_UDATA); eth_dev->security_ctx = ctx; diff --git a/drivers/net/octeontx2/otx2_ethdev_sec_tx.h b/drivers/net/octeontx2/otx2_ethdev_sec_tx.h index 623a2a841e..e59a869403 100644 --- a/drivers/net/octeontx2/otx2_ethdev_sec_tx.h +++ b/drivers/net/octeontx2/otx2_ethdev_sec_tx.h @@ -54,7 +54,7 @@ otx2_sec_event_tx(uint64_t base, struct rte_event *ev, struct rte_mbuf *m, struct nix_iova_s nix_iova; } *sd; - priv = get_sec_session_private_data((void *)(*rte_security_dynfield(m))); + priv = (struct otx2_sec_session *)(*rte_security_dynfield(m)); sess = &priv->ipsec.ip; sa = &sess->out_sa;