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 1F74FA04BF; Thu, 3 Sep 2020 18:07:42 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 634201C116; Thu, 3 Sep 2020 18:07:07 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id 5BE681C0D4 for ; Thu, 3 Sep 2020 18:07:04 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 3D2A81A0C67; Thu, 3 Sep 2020 18:07:04 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 87C461A0BB6; Thu, 3 Sep 2020 18:07:01 +0200 (CEST) Received: from lsv03273.swis.in-blr01.nxp.com (lsv03273.swis.in-blr01.nxp.com [92.120.147.113]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id B4F7E402EB; Thu, 3 Sep 2020 18:06:56 +0200 (CEST) From: akhil.goyal@nxp.com To: dev@dpdk.org Cc: hemant.agrawal@nxp.com, anoobj@marvell.com, declan.doherty@intel.com, david.coyle@intel.com, Akhil Goyal Date: Thu, 3 Sep 2020 21:36:48 +0530 Message-Id: <20200903160652.31654-4-akhil.goyal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903160652.31654-1-akhil.goyal@nxp.com> References: <20200903160652.31654-1-akhil.goyal@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 3/7] crypto/dpaa2_sec: enable PDCP-SDAP sessions 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: Akhil Goyal Based on the new field in PDCP xform, a decision is made to create a PDCP session with or without SDAP enabled. Signed-off-by: Akhil Goyal --- drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 30 ++++++++++++++++++--- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c index 109e61ae1..6aa2a36f3 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -36,6 +36,7 @@ /* RTA header files */ #include #include +#include #include /* Minimum job descriptor consists of a oneword job descriptor HEADER and @@ -3186,8 +3187,9 @@ dpaa2_sec_set_pdcp_session(struct rte_cryptodev *dev, &cipherdata, &authdata, 0); } else { - if (session->dir == DIR_ENC) - bufsize = cnstr_shdsc_pdcp_u_plane_encap( + if (session->dir == DIR_ENC) { + if (pdcp_xform->sdap_enabled) + bufsize = cnstr_shdsc_pdcp_sdap_u_plane_encap( priv->flc_desc[0].desc, 1, swap, session->pdcp.sn_size, pdcp_xform->hfn, @@ -3195,8 +3197,18 @@ dpaa2_sec_set_pdcp_session(struct rte_cryptodev *dev, pdcp_xform->pkt_dir, pdcp_xform->hfn_threshold, &cipherdata, p_authdata, 0); - else if (session->dir == DIR_DEC) - bufsize = cnstr_shdsc_pdcp_u_plane_decap( + else + bufsize = cnstr_shdsc_pdcp_u_plane_encap( + priv->flc_desc[0].desc, 1, swap, + session->pdcp.sn_size, + pdcp_xform->hfn, + pdcp_xform->bearer, + pdcp_xform->pkt_dir, + pdcp_xform->hfn_threshold, + &cipherdata, p_authdata, 0); + } else if (session->dir == DIR_DEC) { + if (pdcp_xform->sdap_enabled) + bufsize = cnstr_shdsc_pdcp_sdap_u_plane_decap( priv->flc_desc[0].desc, 1, swap, session->pdcp.sn_size, pdcp_xform->hfn, @@ -3204,6 +3216,16 @@ dpaa2_sec_set_pdcp_session(struct rte_cryptodev *dev, pdcp_xform->pkt_dir, pdcp_xform->hfn_threshold, &cipherdata, p_authdata, 0); + else + bufsize = cnstr_shdsc_pdcp_u_plane_decap( + priv->flc_desc[0].desc, 1, swap, + session->pdcp.sn_size, + pdcp_xform->hfn, + pdcp_xform->bearer, + pdcp_xform->pkt_dir, + pdcp_xform->hfn_threshold, + &cipherdata, p_authdata, 0); + } } if (bufsize < 0) { -- 2.17.1