From patchwork Wed Sep 8 12:51:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gagandeep Singh X-Patchwork-Id: 507927 Delivered-To: patch@linaro.org Received: by 2002:a02:8629:0:0:0:0:0 with SMTP id e38csp568845jai; Wed, 8 Sep 2021 05:51:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyUTPkuxd/BbqeKn0LBm+jgmYR0vUVakoD1k+NRMiVlOEdt1/YD6+0TTCCcjDxsI7aM7RiB X-Received: by 2002:a05:6402:5242:: with SMTP id t2mr3688812edd.240.1631105513578; Wed, 08 Sep 2021 05:51:53 -0700 (PDT) Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id k2si2020682ejo.293.2021.09.08.05.51.53; Wed, 08 Sep 2021 05:51:53 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) client-ip=217.70.189.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector2 header.b=fQzuFaXH; arc=fail (signature failed); spf=pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6D8A641207; Wed, 8 Sep 2021 14:51:52 +0200 (CEST) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80089.outbound.protection.outlook.com [40.107.8.89]) by mails.dpdk.org (Postfix) with ESMTP id 810D140E25 for ; Wed, 8 Sep 2021 14:51:51 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=B96dN98R4ORkisCq5tCsvYqa67jVxr2Iw92xCpCutMC5V1aY1N5cTdHF5pcaGWNo1U6JZ1YEc1ANuWxyt1YYC/0w4wKvPsmeNHlSCw/9AlnpJAVEvsmtmtjYdF/vxprtYcD8BpejhhQHNwXUMvsRTesU623U5a4fFgNFFYOUMiJ9qMUQvA9Wl2j+V2XkEnvrDnpmGVfrhDXL3FAuwhc8tOcQ+00yylBddJb/7FNa2hmkIy0SioN6/+gnL1co50uFSqPIea9R2k1aS6IYqGCIpFlWglfFGoR8B8TZp5tosKMcbUtAWL27tbOwoH4V1N5x7pgfnCJnDuQ4aB5LYVQWrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=MV6QQ+4jXTm007O1jjz0q8AyrdSCqQgTFT3wRYIaICY=; b=g54tiC/8oq/LebDDfy9sfu7fe+yvgWNGpstt0rC7a5rxQLZSa0yT+GSPNVNlSSxuTx2vsrEWcKIhk2ybrqPo3KeoMpb/fCf/6WkBh6KxETmfoLbcQ/QDvyQLYcaJV3QTxzGAqRn2HDOmmCF16ytZ0/oh/YFW8asFN0+qONn7GU0O+hXWSAHOWTABaoecr9KKQ2+MxQSRaijA2W8ltwfkb4ifHMMj2w5FO8Aj8OytCfOFassWp3iI/OZzTwz+4SO7/T6HoX+xBA+N6eEHCUYfic+HkhpC/nHjiPJpAYvUy/IhgEBK2RCi3umBiCv1QFHZLWCFbYjLHa4aqX662Qz2Ug== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MV6QQ+4jXTm007O1jjz0q8AyrdSCqQgTFT3wRYIaICY=; b=fQzuFaXHvin2GmvRgiVwr95i3rkffKOgn2Vs6Mg4EF8jyFdswrAUr50Mld6PWyqLevjD+c5AJYkXEWMXLHCGmwTr7l1mOIHk0jQbSCd8tBIy83elEXa+rD7e1ZZH66oOypOrfB8mExWOemymzMZ8XEqEJXnKInQrsuqyzis8NnE= Authentication-Results: marvell.com; dkim=none (message not signed) header.d=none; marvell.com; dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB6960.eurprd04.prod.outlook.com (2603:10a6:803:12d::10) by VI1PR04MB3024.eurprd04.prod.outlook.com (2603:10a6:802:d::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.24; Wed, 8 Sep 2021 12:51:49 +0000 Received: from VI1PR04MB6960.eurprd04.prod.outlook.com ([fe80::d496:fcce:f667:7aa7]) by VI1PR04MB6960.eurprd04.prod.outlook.com ([fe80::d496:fcce:f667:7aa7%8]) with mapi id 15.20.4500.015; Wed, 8 Sep 2021 12:51:49 +0000 From: Gagandeep Singh To: gakhil@marvell.com, dev@dpdk.org Cc: thomas@monjalon.net, Hemant Agrawal , Gagandeep Singh Date: Wed, 8 Sep 2021 18:21:23 +0530 Message-Id: <20210908125127.3566886-2-g.singh@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210908125127.3566886-1-g.singh@nxp.com> References: <20210908120115.3548009-2-g.singh@nxp.com> <20210908125127.3566886-1-g.singh@nxp.com> X-ClientProxiedBy: SG2PR03CA0144.apcprd03.prod.outlook.com (2603:1096:4:c8::17) To VI1PR04MB6960.eurprd04.prod.outlook.com (2603:10a6:803:12d::10) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from lsv03457.swis.in-blr01.nxp.com (14.142.151.118) by SG2PR03CA0144.apcprd03.prod.outlook.com (2603:1096:4:c8::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14 via Frontend Transport; Wed, 8 Sep 2021 12:51:46 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 62e0ba87-2c04-4e1c-8763-08d972c76bff X-MS-TrafficTypeDiagnostic: VI1PR04MB3024: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2512; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qgZYsx7xf7uDER/Gd9W2F8hgwc/ouxR/nBNOb9mGOy0hks8tD+bW2w5muebx5iYK5Y40DxlhH6s//1EtCXa/i8RmFtPvSvAjYDJNWQZaff6E10QhLg7/M+b8Oeme3/JvD3n4PZuuXwP1nztt0SNfVOOqfUJfayQkfDEoB4nXM7Qr9bu3YNA56Y60FWBPac5DsD84Cdo11JaqbseDWY3w6EmWwCYNRVtkN+HhyNBl8iBv5S5WGCQWL8KRJqK0GkSEL9c+Zf5j/qKES6mYXtlHFUhVnf58+YXq7PaNaa3Djn6YzwWlLENL38Ihhk/CYyidgp5kyac26rCDogiDQINcvVwsHpeLQ/bW27AJMRUlfkO9KfdvqgnLdEFTa7ygEvRa1UE5ujOTp6lXBahmBdJNER+Sx7QO27Qs/C1QvGDF9fTNqKzzVLsmER4uvDVEn1JgV7C43t+nwkmB64sjEyW7WA23WLZNz8mKmy2SSWopD3/hWcg/ZyrltClqyXTe6oWrrH3nnh+SYzeY+Zx4/igk1A9Nuiyj/kyJT9xvy1qcfTZQE768RCtov2zFQP83mDdXxiExV9nBR9ZswV0Q24bfUTRYVby1MkFA3gRkrV6dixNKeSTiKooos4ZBEDc30lDOiRy42L8okWyqmMyOLhC+zXgiWuGk2Q4RrLPsPT7/FrqKV4fpRtE/d/t2adAMuJkfWg8V4I8J77BCP2bULJ3MgcLqXFucDwXNBzRcGbfWoCQ= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB6960.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39860400002)(376002)(396003)(346002)(366004)(136003)(38350700002)(5660300002)(8676002)(38100700002)(55236004)(66556008)(66946007)(186003)(478600001)(52116002)(7696005)(1076003)(26005)(316002)(66476007)(8936002)(1006002)(6666004)(36756003)(86362001)(2906002)(4326008)(6486002)(956004)(54906003)(83380400001)(2616005)(110426009); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 6S8+UZuqeYZ2K9zi2sA7gbGD4JnBh0kuuA4nep1w7QLxRe9Qcfeo6u2J538TwmTdObbRzFyqhcEej/IhZUfMgBx8nV2YR+ZebPQo4kyqK2aLQ1ROQz6KeiaSYbPOdtZpeme3aTaXPecnJ3QOg/KpFXFP3KJzEOeayaJCM8V6SuCrAcaY7qtZt5U8OpI1uQKQw60rdSB5pZFfpNFH8MzGEtAAiSKUIrv2mIan78L3VGS2MM6YhBSw1iCtSyKC44qOquZXKJnWzjLI7FrOJNRLPTnHnhmWidr5z8HtHZB1HvUZcsnaDyPp5wca+9tmDrmHZr9DHN5G3eS7W2vhm+SmxpwcUgMvBxApOBCtwitW/oc1IAUOvZXeuP9dNcKSh5BV0tpedikL1mb48kFyU+Fv1Egg8lbxAITfBCju4Ew/OID8gehj9sD9aGG+sD8hiJaI4Tg4qmVamwN3FzfVgF5CjeR152jeccJSG58z5xRWOZp5lu1QjRRGqZj+xgsPOeUGWkwB6b54hktVtvS7/hCHAtAVmAr3Za1j5gauT4uS7klY9dQvFzUdPaXIliAOlgM3Hy2d284ls8PhJGDyRJhlWtT3nAxWijPxznnqEYzPqCuQyaXFelaJdUCk837wanrRTPyfbwwy2Fq8mR3wQfHn5ZRcu0aSyaAYAwC3AXFoE8b/JajTOffYAo7O7XZhlsoHA1dqt8ttumoADC89htz0F1d9NaR7caJK3BdM1AEuNJjtT+QRr7xAqGNOeYr1HSMT9MNDlyX9Li0H4tC04VimdSokjgH4e3zqSJneFem9Y4DhTqszMSqAzryZ3MGdBhnFEGj7nZHPVdhmcNDy7qn8/wUgzIaW03umpRX4hbmX/eVlroo7jQZ9rieOyFtRbWY01QL5L40kAnEr6k7/fY1e6ASnzGetk3rij4S3eG51vt8uqYVRNxAZldQe05VhD/PcbqbdC348I5/bUqn1rE2L+wCY/ZqXw7IH4pDzURQmgXqVnrPfZCyoRczYzeOabhYo2++BrRqtUamg6Jy6r7CAUXY/JHpy5IhhZ34ROD+VT834sCJYtDu/p90MLKQAWK4X94obO4h/PTZ9EsbM2f/oQ0dS1n9yV2S+nLPFq5f30fEtkTX0dkc+H3J5Baw+BHnSY0kYxUfxfmSA3JV1A/WnLFgvR9lVlcAd65ccTX+2ns1wa+ZTZX7D95byU74LEunhQ/2ISOLxiJz96wwkmCOB3UZ3d/NvRwgK5XpWFDS1VeaBDfo08R7XZwIlgXCBBKyi643+n1GYYN5L9Q4jtqj/htHY+bs05QczmM94jvxOyft5OblfXGbbXA0BSEyxs9p2 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 62e0ba87-2c04-4e1c-8763-08d972c76bff X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB6960.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2021 12:51:49.0720 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 25LqQjvmLj3F6qt3d6xkfYQNH9RD93jRDlMDnVQC+dspYGvvB0OLIb33e+LC4agQ X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB3024 Subject: [dpdk-dev] [PATCH v4 1/5] crypto/dpaa2_sec: support integrity only case for PDCP 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" From: Hemant Agrawal To support short MAC-I, integrity only case is required to be supported for PDCP. Signed-off-by: Hemant Agrawal Signed-off-by: Gagandeep Singh --- drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 25 +++++++++++---------- 1 file changed, 13 insertions(+), 12 deletions(-) -- 2.25.1 diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c index d6a101499a..b8d57c2b22 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -3104,7 +3104,7 @@ dpaa2_sec_set_pdcp_session(struct rte_cryptodev *dev, struct rte_security_pdcp_xform *pdcp_xform = &conf->pdcp; struct rte_crypto_sym_xform *xform = conf->crypto_xform; struct rte_crypto_auth_xform *auth_xform = NULL; - struct rte_crypto_cipher_xform *cipher_xform; + struct rte_crypto_cipher_xform *cipher_xform = NULL; dpaa2_sec_session *session = (dpaa2_sec_session *)sess; struct ctxt_priv *priv; struct dpaa2_sec_dev_private *dev_priv = dev->data->dev_private; @@ -3136,18 +3136,18 @@ dpaa2_sec_set_pdcp_session(struct rte_cryptodev *dev, flc = &priv->flc_desc[0].flc; /* find xfrm types */ - if (xform->type == RTE_CRYPTO_SYM_XFORM_CIPHER && xform->next == NULL) { - cipher_xform = &xform->cipher; - } else if (xform->type == RTE_CRYPTO_SYM_XFORM_CIPHER && - xform->next->type == RTE_CRYPTO_SYM_XFORM_AUTH) { - session->ext_params.aead_ctxt.auth_cipher_text = true; + if (xform->type == RTE_CRYPTO_SYM_XFORM_CIPHER) { cipher_xform = &xform->cipher; - auth_xform = &xform->next->auth; - } else if (xform->type == RTE_CRYPTO_SYM_XFORM_AUTH && - xform->next->type == RTE_CRYPTO_SYM_XFORM_CIPHER) { - session->ext_params.aead_ctxt.auth_cipher_text = false; - cipher_xform = &xform->next->cipher; + if (xform->next != NULL) { + session->ext_params.aead_ctxt.auth_cipher_text = true; + auth_xform = &xform->next->auth; + } + } else if (xform->type == RTE_CRYPTO_SYM_XFORM_AUTH) { auth_xform = &xform->auth; + if (xform->next != NULL) { + session->ext_params.aead_ctxt.auth_cipher_text = false; + cipher_xform = &xform->next->cipher; + } } else { DPAA2_SEC_ERR("Invalid crypto type"); return -EINVAL; @@ -3186,7 +3186,8 @@ dpaa2_sec_set_pdcp_session(struct rte_cryptodev *dev, session->pdcp.hfn_threshold = pdcp_xform->hfn_threshold; session->pdcp.hfn_ovd = pdcp_xform->hfn_ovrd; /* hfv ovd offset location is stored in iv.offset value*/ - session->pdcp.hfn_ovd_offset = cipher_xform->iv.offset; + if (cipher_xform) + session->pdcp.hfn_ovd_offset = cipher_xform->iv.offset; cipherdata.key = (size_t)session->cipher_key.data; cipherdata.keylen = session->cipher_key.length; From patchwork Wed Sep 8 12:51:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gagandeep Singh X-Patchwork-Id: 507928 Delivered-To: patch@linaro.org Received: by 2002:a02:8629:0:0:0:0:0 with SMTP id e38csp568925jai; Wed, 8 Sep 2021 05:52:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyW3yTDyFkU/EdHosJijivcLPCfiYTWCUPgPB2b7vOCw2FVgRVanyP3XqW4DxP9ZHaNTx0E X-Received: by 2002:a17:906:3f95:: with SMTP id b21mr3763570ejj.368.1631105520892; Wed, 08 Sep 2021 05:52:00 -0700 (PDT) Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id e3si1954846ejm.466.2021.09.08.05.52.00; Wed, 08 Sep 2021 05:52:00 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) client-ip=217.70.189.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector2 header.b=FET7yqan; arc=fail (signature failed); spf=pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DB38B41213; Wed, 8 Sep 2021 14:51:54 +0200 (CEST) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80057.outbound.protection.outlook.com [40.107.8.57]) by mails.dpdk.org (Postfix) with ESMTP id BBB364120F for ; Wed, 8 Sep 2021 14:51:52 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c4U+wc4ONiBQV3VhDtHAiLZsqzHFqcHt93DPxzRHGV5b5ChHqhz2n9BK6gq5gCo8tBowgSc589ux92HwF8WgariYNAjYSakhrc9GQukR463zKnv4WL0qItFM0YG4+3AYqct4VaXqhFAHO5fZ6FFqkvJweE6dEOl07FBLfTvNruoMjE7PAkRBkfbW7ZF8UVw8GKc7fiIyzXaKH2i68Fi91cyiN9Sr07CdwYlWy6nJ8rx50wXy7tl7z9ETG4x6SQKRn7Va3fWJalbfsD/Jq6J/EaDNfOmT2hrTQQerxFDZzga8eKP0akUGBC1wEU+wGnDCh3y1eJZWLRKkX26vPRqXdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=l54jMJ+R6Zx9mKAjXnvf5/oWFNs176HATRN56MxaXQs=; b=Nb9l+0ZWyTPZfShRyzQtrEnhEkXqZU9Zz8o7cJCAymqDxMPVOtAszDOGAuCDo0qiAMgB/e0k4ImT9rEg/YXLa/iZnsrMi1M/OBA16zPIEm/dqgS1HCi+ZzVGi8wK729YX7L49/CRD6WN/5u21ZW6kM7N/Et2dnu+Tq6snFmMffZ+ntGkEvLPSHDHs3+o2TMXOfEWgW5Vv4unX3l8hXk5ddkjm5y0LvkGMe2FXeob2H9UEfxs/qYd1l7cZUJ8TqWtEx/vLnYveinPgatkknIcpnU/fUMTE/8seL3KxBAUgQubLuUXKk4b8kXG34fUA3NBGpRD/Df3zKFCfmHlfHG77w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=l54jMJ+R6Zx9mKAjXnvf5/oWFNs176HATRN56MxaXQs=; b=FET7yqanO7VYuWHaFr4O6xDNyBnzLXlFo4eMD624Rw8LwTnbhZLnSyP8pGpiHLmrJBTS+T2kRUiPk8kIOXChIX2rhbXc3MhbQVTX8art2JoJxuu45Y5yJWI5Pc/DCVCmPPF8y8wuBT1iIIujxI81rMv9EeyY1OOzB3EzVX1Jrdg= Authentication-Results: marvell.com; dkim=none (message not signed) header.d=none; marvell.com; dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB6960.eurprd04.prod.outlook.com (2603:10a6:803:12d::10) by VI1PR04MB3024.eurprd04.prod.outlook.com (2603:10a6:802:d::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.24; Wed, 8 Sep 2021 12:51:51 +0000 Received: from VI1PR04MB6960.eurprd04.prod.outlook.com ([fe80::d496:fcce:f667:7aa7]) by VI1PR04MB6960.eurprd04.prod.outlook.com ([fe80::d496:fcce:f667:7aa7%8]) with mapi id 15.20.4500.015; Wed, 8 Sep 2021 12:51:51 +0000 From: Gagandeep Singh To: gakhil@marvell.com, dev@dpdk.org Cc: thomas@monjalon.net, Hemant Agrawal , Gagandeep Singh Date: Wed, 8 Sep 2021 18:21:24 +0530 Message-Id: <20210908125127.3566886-3-g.singh@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210908125127.3566886-1-g.singh@nxp.com> References: <20210908120115.3548009-2-g.singh@nxp.com> <20210908125127.3566886-1-g.singh@nxp.com> X-ClientProxiedBy: SG2PR03CA0144.apcprd03.prod.outlook.com (2603:1096:4:c8::17) To VI1PR04MB6960.eurprd04.prod.outlook.com (2603:10a6:803:12d::10) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from lsv03457.swis.in-blr01.nxp.com (14.142.151.118) by SG2PR03CA0144.apcprd03.prod.outlook.com (2603:1096:4:c8::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14 via Frontend Transport; Wed, 8 Sep 2021 12:51:49 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 555d1703-3d29-4a58-1c3c-08d972c76d6e X-MS-TrafficTypeDiagnostic: VI1PR04MB3024: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3276; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nDT0l2BQZaOXD0OVd0ue6bhTkj7Gs4Z43j5SA3BsjE9QZ+hv8sFWhsNcwP27s5fv42jmF/v4pBiIU3f8F7RTkEPjRt07sP2ZdOC6zhObaLbIQ79fDh16JpQNINI0/HQPDeiwwZcCiQAkNWbt4jhuk+XxvlQSYv1F298MjL/KolzJvgJj9T4f7E5HqJeIoE/d9mYd6bftkvFStvqBoCNrCGaPYv/gwWTpQEUkOeehyRX687iWyuspkZbTKaBkER+4fFx3x+SOLav65haALhGNoJXFvPfg4ubSyYv6lUN9bNtww9xnP8gKN5m/TTcZnU/mFESdmCf6EdTayKDH4m3h66YutQCTVFEwjiqUnu4akskmsXcBethO7bQxDqKRAtz4pG/TqE0hfeF4dTQLKDcKxH9cGkrD15np/sqGWhtbJo1jQUBNbLgp8uy/1gtDrTuPo+Mjc4csJ57avREpZBM5AHFQlm2T1gh+MB+I9yusUHpqq6t55cW2MAo0xYurE4gX/csEr7y3N/1wj4EnIuPZobD+17EZ08ryFKDlKcIJZ0VPRhFbnyPC6YMIT3fiyGCpwz38Z3k8lfgzjWxZXx9AUH69zPPcZj2yxNSlADwcwBL+hwZNDSRfwWCuURALs4hU3PJiuEKxvyeFZuxVyiWB6K8/QuYONZoeitFhQ7E9shmZFNMIAv5Y7hGJhkn0r/H164/0/FjXOkQiM7nxTSYfoOW+8K978PJhBcRPum7xX34= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB6960.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39860400002)(376002)(396003)(346002)(366004)(136003)(38350700002)(5660300002)(8676002)(38100700002)(55236004)(66556008)(66946007)(186003)(478600001)(52116002)(7696005)(1076003)(26005)(316002)(66476007)(8936002)(1006002)(6666004)(36756003)(86362001)(2906002)(4326008)(6486002)(956004)(15650500001)(54906003)(83380400001)(2616005)(110426009); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 8l/zLGGGhGqx/I/SgEToLVfa62JyDPb5rbdTU5nNUDK5k4Dzc/euo2NEaRldLRbGKRxNCh1m9ccKrd4WdKcLUOv9TFqa1RDJTVtVQc495K8L/OH5v30xYfoTw3F7IX9Ka+YL86ep+w3SjdsIYjBwYTft9ncrYNSPo1xfDXkC0ZcPOwBMSmuysybKa+A48NliYMJcoQW0uemRRoCXwCv9m5fzML3a9mR17k/0XIJ0ew0jqqI3poGm1JfbGi5nXxYFVXYgiMWz1TnSbYLl4i8qHTHIWXD1tcek3/auCU2hoHHDzP7qNCuZbnfs1pn3HU2GZFptSSWebUPkXMVhsshOt5SynLfkv53Yh1RrKd7+lq83zAlrQyYPVGcM0kvMnYNzbVHiD1Tt7vLkzRHTpEymsNF3xeeRMoVR59PiXl3+tFnTyT6v6qsCgb3Cx94P5zzxq1+wbOubnlEPDKeyXXdXEcit46Si6Ym+urcII25vRh9VwisIyevlNt8W2R9+m+JAhLZvwz20DfLWOoDQDNsJfj11AJaZA8MqVFq3+VvSp1lOE8SJ84ZTE9+P1fFq+PyNzDfxDGEm88mI4OcvjK77Euoeqs2u2zxFplMFQqN+ra6uBHfE1Fqx1LLe4C6OdL/pW+KOmY59as0dykRQXdu4tBt5+Qa6Xe7zwDCeljnCBeQnHuuFgExd35LsZr3IUZOCqudVMaglw1p2L903LxpRaE6mHtPeO5Dz8H3Xldyk9cDK9f9X7OOl/zxDjY9GepYW4o9M8tvzGK3x/D9lwWF5X/QT3Yr2LP0EILWtaUFG0doguY9eJmPHQIWpnxnw/NQ1eqzBgJGXwFj2H5HnyvftoiS0Hjw2QTxhPKjDi/uzcmiBgbBjPaL9VaUnFat3N1xrEv19w58/K6b7foeGvmK5zpAFXvnYOeQoePetooFh//FnE6ggyjxPtVMPF9us55ee4V0V09o+UVR6aI/+Afmja8Wek2PRiaxbH2YCMV5syg6DYB9xn+LewNDTSjNlowvLemyJeDzzLMGy9VUww+s2/ADdnNVBxelXp/EU1eJFRODgLHIbETXAPAT8Xammns6oRbSumyJtxWPLAgnGhuZQb6U+i1ZetG5dBFSt+dYXZAz9jPGxWd+Ztpb/tUASOeCepY7lXxT5kc+aKFMkpTfbKhjPVwsm6n4pZO5pzKx8lSJr+yP59p66hVaE5uGzGqYrwqpgD/VymD2tGLLzLhPqnv5p+Huwch0kdbPZOMRyyPuscC6I6a+lOQYmMO21qW40MW8fd9X/IxO8N1yG8V3WfpanzY0ePLlJmAoArsc1cb5QrdugTy142SfSvlXbhBqo X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 555d1703-3d29-4a58-1c3c-08d972c76d6e X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB6960.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2021 12:51:51.3629 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: /6KNtFDc9O6soxVlPVbYbTrLuWoR0TIkvfxFpXqb3fyUUUgaQmnpVNApnvYYNZ5U X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB3024 Subject: [dpdk-dev] [PATCH v4 2/5] security: add pdcp short MAC-I support 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" From: Hemant Agrawal This patch add support to handle PDCP short MAC-I domain along with standard control and data domains as it has to be treaty as special case with PDCP protocol offload support. ShortMAC-I is the 16 least significant bits of calculated MAC-I. Usually when a RRC message is exchanged between UE and eNodeB it is integrity & ciphered protected. MAC-I = f(key, varShortMAC-I, count, bearer, direction). Here varShortMAC-I is prepared by using (current cellId, pci of source cell and C-RNTI of old cell). Other parameters like count, bearer and direction set to all 1. Signed-off-by: Gagandeep Singh Signed-off-by: Hemant Agrawal --- app/test-crypto-perf/cperf_options_parsing.c | 8 +++++++- doc/guides/prog_guide/rte_security.rst | 11 ++++++++++- doc/guides/tools/cryptoperf.rst | 2 +- lib/security/rte_security.h | 1 + 4 files changed, 19 insertions(+), 3 deletions(-) -- 2.25.1 diff --git a/app/test-crypto-perf/cperf_options_parsing.c b/app/test-crypto-perf/cperf_options_parsing.c index e84f56cfaa..0348972c85 100644 --- a/app/test-crypto-perf/cperf_options_parsing.c +++ b/app/test-crypto-perf/cperf_options_parsing.c @@ -662,7 +662,8 @@ parse_pdcp_sn_sz(struct cperf_options *opts, const char *arg) const char *cperf_pdcp_domain_strs[] = { [RTE_SECURITY_PDCP_MODE_CONTROL] = "control", - [RTE_SECURITY_PDCP_MODE_DATA] = "data" + [RTE_SECURITY_PDCP_MODE_DATA] = "data", + [RTE_SECURITY_PDCP_MODE_SHORT_MAC] = "short_mac" }; static int @@ -677,6 +678,11 @@ parse_pdcp_domain(struct cperf_options *opts, const char *arg) cperf_pdcp_domain_strs [RTE_SECURITY_PDCP_MODE_DATA], RTE_SECURITY_PDCP_MODE_DATA + }, + { + cperf_pdcp_domain_strs + [RTE_SECURITY_PDCP_MODE_SHORT_MAC], + RTE_SECURITY_PDCP_MODE_SHORT_MAC } }; diff --git a/doc/guides/prog_guide/rte_security.rst b/doc/guides/prog_guide/rte_security.rst index f72bc8a78f..ad92c16868 100644 --- a/doc/guides/prog_guide/rte_security.rst +++ b/doc/guides/prog_guide/rte_security.rst @@ -1,5 +1,5 @@ .. SPDX-License-Identifier: BSD-3-Clause - Copyright 2017,2020 NXP + Copyright 2017,2020-2021 NXP @@ -408,6 +408,15 @@ PMD which supports the IPsec and PDCP protocol. }, .crypto_capabilities = pmd_capabilities }, + { /* PDCP Lookaside Protocol offload short MAC-I */ + .action = RTE_SECURITY_ACTION_TYPE_LOOKASIDE_PROTOCOL, + .protocol = RTE_SECURITY_PROTOCOL_PDCP, + .pdcp = { + .domain = RTE_SECURITY_PDCP_MODE_SHORT_MAC, + .capa_flags = 0 + }, + .crypto_capabilities = pmd_capabilities + }, { .action = RTE_SECURITY_ACTION_TYPE_NONE } diff --git a/doc/guides/tools/cryptoperf.rst b/doc/guides/tools/cryptoperf.rst index be3109054d..9a7b990596 100644 --- a/doc/guides/tools/cryptoperf.rst +++ b/doc/guides/tools/cryptoperf.rst @@ -318,7 +318,7 @@ The following are the application command-line options: * ``--pdcp-domain `` - Set PDCP domain to specify Control/user plane. + Set PDCP domain to specify short_mac/control/user plane. * ``--docsis-hdr-sz `` diff --git a/lib/security/rte_security.h b/lib/security/rte_security.h index 88d31de0a6..2e136d7929 100644 --- a/lib/security/rte_security.h +++ b/lib/security/rte_security.h @@ -233,6 +233,7 @@ struct rte_security_macsec_xform { enum rte_security_pdcp_domain { RTE_SECURITY_PDCP_MODE_CONTROL, /**< PDCP control plane */ RTE_SECURITY_PDCP_MODE_DATA, /**< PDCP data plane */ + RTE_SECURITY_PDCP_MODE_SHORT_MAC, /**< PDCP short mac */ }; /** PDCP Frame direction */