DPDK patches and discussions
 help / color / mirror / Atom feed
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 <akhil.goyal@nxp.com>
Subject: [dpdk-dev] [PATCH 4/7] crypto/dpaa_sec: enable PDCP-SDAP sessions
Date: Thu,  3 Sep 2020 21:36:49 +0530
Message-ID: <20200903160652.31654-5-akhil.goyal@nxp.com> (raw)
In-Reply-To: <20200903160652.31654-1-akhil.goyal@nxp.com>

From: Akhil Goyal <akhil.goyal@nxp.com>

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 <akhil.goyal@nxp.com>
---
 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 c4339336d..192dba064 100644
--- a/drivers/crypto/dpaa_sec/dpaa_sec.c
+++ b/drivers/crypto/dpaa_sec/dpaa_sec.c
@@ -36,6 +36,7 @@
 #include <desc/algo.h>
 #include <desc/ipsec.h>
 #include <desc/pdcp.h>
+#include <desc/sdap.h>
 
 #include <rte_dpaa_bus.h>
 #include <dpaa_sec.h>
@@ -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;
 }
@@ -2950,6 +2976,7 @@ dpaa_sec_set_pdcp_session(struct rte_cryptodev *dev,
 	session->pdcp.hfn_threshold = pdcp_xform->hfn_threshold;
 	session->pdcp.hfn_ovd = pdcp_xform->hfn_ovrd;
 	session->pdcp.hfn_ovd_offset = cipher_xform->iv.offset;
+	session->pdcp.sdap_enabled = pdcp_xform->sdap_enabled;
 
 	rte_spinlock_lock(&dev_priv->lock);
 	for (i = 0; i < MAX_DPAA_CORES; i++) {
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


  parent reply	other threads:[~2020-09-03 16:07 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-03 16:06 [dpdk-dev] [PATCH 0/7] support PDCP-SDAP for dpaa2_sec akhil.goyal
2020-09-03 16:06 ` [dpdk-dev] [PATCH 1/7] common/dpaax/caamflib: Support PDCP-SDAP akhil.goyal
2020-09-03 16:06 ` [dpdk-dev] [PATCH 2/7] security: modify PDCP xform to support SDAP akhil.goyal
2020-10-05 18:04   ` Coyle, David
2020-10-08  9:01     ` Akhil Goyal
2020-09-03 16:06 ` [dpdk-dev] [PATCH 3/7] crypto/dpaa2_sec: enable PDCP-SDAP sessions akhil.goyal
2020-09-03 16:06 ` akhil.goyal [this message]
2020-09-03 16:06 ` [dpdk-dev] [PATCH 5/7] test/crypto: Add test vectors for PDCP-SDAP akhil.goyal
2020-09-03 16:06 ` [dpdk-dev] [PATCH 6/7] test/crypto: Modify test_pdcp_proto to take parameters akhil.goyal
2020-09-03 16:06 ` [dpdk-dev] [PATCH 7/7] test/crypto: Add PDCP-SDAP cases akhil.goyal
2020-10-11 21:33 ` [dpdk-dev] [PATCH v2 0/8] support PDCP-SDAP for dpaa2_sec Akhil Goyal
2020-10-11 21:33   ` [dpdk-dev] [PATCH v2 1/8] common/dpaax/caamflib: Support PDCP-SDAP Akhil Goyal
2020-10-11 21:33   ` [dpdk-dev] [PATCH v2 2/8] security: modify PDCP xform to support SDAP Akhil Goyal
2020-10-11 21:33   ` [dpdk-dev] [PATCH v2 3/8] doc: remove unnecessary API code from security guide Akhil Goyal
2020-10-11 21:33   ` [dpdk-dev] [PATCH v2 4/8] crypto/dpaa2_sec: enable PDCP-SDAP sessions Akhil Goyal
2020-10-11 21:34   ` [dpdk-dev] [PATCH v2 5/8] crypto/dpaa_sec: " Akhil Goyal
2020-10-11 21:34   ` [dpdk-dev] [PATCH v2 6/8] test/crypto: Add test vectors for PDCP-SDAP Akhil Goyal
2020-10-11 21:49     ` Thomas Monjalon
2020-10-12 14:01       ` Akhil Goyal
2020-10-11 21:34   ` [dpdk-dev] [PATCH v2 7/8] test/crypto: Modify test_pdcp_proto to take parameters Akhil Goyal
2020-10-11 21:34   ` [dpdk-dev] [PATCH v2 8/8] test/crypto: Add PDCP-SDAP cases Akhil Goyal
2020-10-12 14:09   ` [dpdk-dev] [PATCH v3 0/8] support PDCP-SDAP for dpaa2_sec Akhil Goyal
2020-10-12 14:09     ` [dpdk-dev] [PATCH v3 1/8] common/dpaax/caamflib: Support PDCP-SDAP Akhil Goyal
2020-10-12 14:10     ` [dpdk-dev] [PATCH v3 2/8] security: modify PDCP xform to support SDAP Akhil Goyal
2020-10-14  7:46       ` Thomas Monjalon
2020-10-14 20:26         ` Akhil Goyal
2020-10-12 14:10     ` [dpdk-dev] [PATCH v3 3/8] doc: remove unnecessary API code from security guide Akhil Goyal
2020-10-12 14:10     ` [dpdk-dev] [PATCH v3 4/8] crypto/dpaa2_sec: enable PDCP-SDAP sessions Akhil Goyal
2020-10-12 14:10     ` [dpdk-dev] [PATCH v3 5/8] crypto/dpaa_sec: " Akhil Goyal
2020-10-12 14:10     ` [dpdk-dev] [PATCH v3 6/8] test/crypto: Add test vectors for PDCP-SDAP Akhil Goyal
2020-10-12 14:10     ` [dpdk-dev] [PATCH v3 7/8] test/crypto: Modify test_pdcp_proto to take parameters Akhil Goyal
2020-10-12 14:10     ` [dpdk-dev] [PATCH v3 8/8] test/crypto: Add PDCP-SDAP cases Akhil Goyal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200903160652.31654-5-akhil.goyal@nxp.com \
    --to=akhil.goyal@nxp.com \
    --cc=anoobj@marvell.com \
    --cc=david.coyle@intel.com \
    --cc=declan.doherty@intel.com \
    --cc=dev@dpdk.org \
    --cc=hemant.agrawal@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git