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 F1560A04B6; Mon, 12 Oct 2020 16:12:26 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A28061D90E; Mon, 12 Oct 2020 16:10:30 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id 289681D736; Mon, 12 Oct 2020 16:10:22 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 0929F1A101E; Mon, 12 Oct 2020 16:10:22 +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 6E1D91A13B6; Mon, 12 Oct 2020 16:10:18 +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 DC19640326; Mon, 12 Oct 2020 16:10:11 +0200 (CEST) From: Akhil Goyal To: dev@dpdk.org, techboard@dpdk.org Cc: thomas@monjalon.net, anoobj@marvell.com, hemant.agrawal@nxp.com, declan.doherty@intel.com, david.coyle@intel.com, Akhil Goyal Date: Mon, 12 Oct 2020 19:40:03 +0530 Message-Id: <20201012141006.31463-6-akhil.goyal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201012141006.31463-1-akhil.goyal@nxp.com> References: <20201011213403.21169-1-akhil.goyal@nxp.com> <20201012141006.31463-1-akhil.goyal@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v3 5/8] crypto/dpaa_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" 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/dpaa_sec/dpaa_sec.c | 63 +++++++++++++++++++++--------- drivers/crypto/dpaa_sec/dpaa_sec.h | 3 +- 2 files changed, 47 insertions(+), 19 deletions(-) diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c index 0495422a4..f69cb5719 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include @@ -293,24 +294,49 @@ dpaa_sec_prep_pdcp_cdb(dpaa_sec_session *ses) &cipherdata, &authdata, 0); } else { - if (ses->dir == DIR_ENC) - shared_desc_len = cnstr_shdsc_pdcp_u_plane_encap( - cdb->sh_desc, 1, swap, - ses->pdcp.sn_size, - ses->pdcp.hfn, - ses->pdcp.bearer, - ses->pdcp.pkt_dir, - ses->pdcp.hfn_threshold, - &cipherdata, p_authdata, 0); - else if (ses->dir == DIR_DEC) - shared_desc_len = cnstr_shdsc_pdcp_u_plane_decap( - cdb->sh_desc, 1, swap, - ses->pdcp.sn_size, - ses->pdcp.hfn, - ses->pdcp.bearer, - ses->pdcp.pkt_dir, - ses->pdcp.hfn_threshold, - &cipherdata, p_authdata, 0); + if (ses->dir == DIR_ENC) { + if (ses->pdcp.sdap_enabled) + shared_desc_len = + cnstr_shdsc_pdcp_sdap_u_plane_encap( + cdb->sh_desc, 1, swap, + ses->pdcp.sn_size, + ses->pdcp.hfn, + ses->pdcp.bearer, + ses->pdcp.pkt_dir, + ses->pdcp.hfn_threshold, + &cipherdata, p_authdata, 0); + else + shared_desc_len = + cnstr_shdsc_pdcp_u_plane_encap( + cdb->sh_desc, 1, swap, + ses->pdcp.sn_size, + ses->pdcp.hfn, + ses->pdcp.bearer, + ses->pdcp.pkt_dir, + ses->pdcp.hfn_threshold, + &cipherdata, p_authdata, 0); + } else if (ses->dir == DIR_DEC) { + if (ses->pdcp.sdap_enabled) + shared_desc_len = + cnstr_shdsc_pdcp_sdap_u_plane_decap( + cdb->sh_desc, 1, swap, + ses->pdcp.sn_size, + ses->pdcp.hfn, + ses->pdcp.bearer, + ses->pdcp.pkt_dir, + ses->pdcp.hfn_threshold, + &cipherdata, p_authdata, 0); + else + shared_desc_len = + cnstr_shdsc_pdcp_u_plane_decap( + cdb->sh_desc, 1, swap, + ses->pdcp.sn_size, + ses->pdcp.hfn, + ses->pdcp.bearer, + ses->pdcp.pkt_dir, + ses->pdcp.hfn_threshold, + &cipherdata, p_authdata, 0); + } } return shared_desc_len; } @@ -2949,6 +2975,7 @@ dpaa_sec_set_pdcp_session(struct rte_cryptodev *dev, session->pdcp.hfn = pdcp_xform->hfn; session->pdcp.hfn_threshold = pdcp_xform->hfn_threshold; session->pdcp.hfn_ovd = pdcp_xform->hfn_ovrd; + session->pdcp.sdap_enabled = pdcp_xform->sdap_enabled; if (cipher_xform) session->pdcp.hfn_ovd_offset = cipher_xform->iv.offset; diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.h b/drivers/crypto/dpaa_sec/dpaa_sec.h index 2cd50cc8d..ddba52982 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.h +++ b/drivers/crypto/dpaa_sec/dpaa_sec.h @@ -109,7 +109,8 @@ struct sec_pdcp_ctxt { int8_t pkt_dir;/*!< PDCP Frame Direction 0:UL 1:DL*/ int8_t hfn_ovd;/*!< Overwrite HFN per packet*/ uint8_t sn_size; /*!< Sequence number size, 5/7/12/15/18 */ - uint32_t hfn_ovd_offset;/*!< offset from rte_crypto_op at which + uint8_t sdap_enabled; /*!< SDAP header is enabled */ + uint16_t hfn_ovd_offset;/*!< offset from rte_crypto_op at which * per packet hfn is stored */ uint32_t hfn; /*!< Hyper Frame Number */ -- 2.17.1