From: Akhil Goyal Date: Mon, 12 Oct 2020 14:10:02 +0000 (+0530) Subject: crypto/dpaa2_sec: enable PDCP-SDAP sessions X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=bd49e11d69dc8633dccb52ccc24b491dd55d1046;p=dpdk.git crypto/dpaa2_sec: enable PDCP-SDAP sessions 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 --- diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c index c11d024208..f8e8750e4f 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 @@ -3264,8 +3265,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, @@ -3273,8 +3275,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, @@ -3282,6 +3294,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) {