From patchwork Tue Sep 7 08:39:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 507518 Delivered-To: patch@linaro.org Received: by 2002:a02:8629:0:0:0:0:0 with SMTP id e38csp4032962jai; Tue, 7 Sep 2021 01:44:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwW4RP8HHYuBQQOa+1aUzBbUwhS56j4+HMYA9sr4EnzoxCJ1IuE51vwAU8Rlzd1p5b3G9I6 X-Received: by 2002:a17:906:2dd8:: with SMTP id h24mr17031384eji.204.1631004274314; Tue, 07 Sep 2021 01:44:34 -0700 (PDT) Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id y17si10616044edt.337.2021.09.07.01.44.34; Tue, 07 Sep 2021 01:44:34 -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=PTBxGonH; 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 C052F410EC; Tue, 7 Sep 2021 10:44:33 +0200 (CEST) Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40052.outbound.protection.outlook.com [40.107.4.52]) by mails.dpdk.org (Postfix) with ESMTP id 6841B410EB for ; Tue, 7 Sep 2021 10:44:32 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EM/AqtHPhqmTPdENVETBtIk1N12GLHzf7OCE6zAnHOsSSJkWy5SwC7hLdYENOA9TuBslqMBoS4lFOAnk1cSAjhUJvReIv9KttSmy9kYlZJIBxZgtctE3EL9OyA/JyaUGo8TFrFKVw3DOlYJVMe3ZZ15pPAJEfzIzQdFpKWcTr+nv0sOcu5RsuFt11bzVBkQm7jy8CLkcuqFz9L2XinpNWEJm3LqvzN+UPLa7T4UihJZf3UVo878vNo+IzJSiYY8R+XoD4hXhwUDfgLA3nHV9vOy9gYYz73RltATN3fP/8jiC35VjInSmk7cyb17hoT1rOS36xqdwjrJaKfdxy0VL+Q== 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=b/UZnT8J2HmsjETj4Dq6CkcWTMQaOvjpqObUQkMb2mw=; b=A3MfOqyMyE6gTexTXIaL3CPFmXHs1juHgKTXv/aDjlGraj+bDp1w5cLINj4uSLlKvhNJwjkZ9w/8DHfuEQ7Q+ymH0JXjMLuFQMXtkvKjXeZzWtJHper8MEm4LQFGTqhcWF4sfW2ZYV/TE9ZgqiQ5W5hlfBKaedGmjZEk6tO+6neRT6iUKpiSctmFyURrLX0SJfo8Jwb9vDpoDnGMmJgRsebn/z/R4RaZ86IH+wFkEUUYfaVAo624GPgaxyWetPAzxlR1xWtkiCIB93nJxwbVfUwXohxkqiurhQVqCKi4+/hoWy/Gy9VmJjJ1S96zDzAX6HSw0IdO+lCieobYtLiCgg== 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=b/UZnT8J2HmsjETj4Dq6CkcWTMQaOvjpqObUQkMb2mw=; b=PTBxGonHJlWtlkGkGTDaza8R6QA50og1UnKky7FWmOl5wCJIb+mjZmQ1nXREsIqmaF1d0LDevd7sdsgUKJleDSs4XGB+1FjULnrHXi47jGrlEvFkD8RAnylt9iAUfWwpDE2vzqXMwU8MALQ5+nNK1BCL2sOL32IaBaVwiUiPjbA= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=nxp.com; Received: from DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) by DU2PR04MB8935.eurprd04.prod.outlook.com (2603:10a6:10:2e2::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14; Tue, 7 Sep 2021 08:44:31 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::945d:e362:712d:1b80]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::945d:e362:712d:1b80%4]) with mapi id 15.20.4478.025; Tue, 7 Sep 2021 08:44:31 +0000 From: Hemant Agrawal To: dev@dpdk.org, gakhil@marvell.com Cc: Gagandeep Singh Date: Tue, 7 Sep 2021 14:09:44 +0530 Message-Id: <20210907083953.8948-1-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210825081837.23830-1-hemant.agrawal@nxp.com> References: <20210825081837.23830-1-hemant.agrawal@nxp.com> X-ClientProxiedBy: SGBP274CA0024.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b0::36) To DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from dpdk-xeon.ap.freescale.net (92.120.0.67) by SGBP274CA0024.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b0::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.20 via Frontend Transport; Tue, 7 Sep 2021 08:44:30 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c0271ff3-295f-42e8-3041-08d971dbb5ee X-MS-TrafficTypeDiagnostic: DU2PR04MB8935: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:229; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Wn+wQl08/FRStFrANexuaw8H5Ql5Xjdler10Tgxj60ntCc3GuMJoi2Q8ktewpwC1VVvdIy/g8Gxhb3+yJZfWuZTx/Wems+YHYge18vuTnBmHz/3AEXOXlm6o8hXDgigWT5cQq+JtrUJQW30H6WGpgOhAsYa39lbxpRI3kAwSrCmYJGvb9KrtykXZ+64gVHS1xLAy3RtTKt+YquEwJVEn2pqrfSNfha/d4f96T2ww2DSyTm/7oAb7oM53IN9magH8yW6/Dr4huRkwiapKP1vJzWcG0gahSNJpFbZ2UoLZNBmAjfJx81QyRVUETZShh00aUYcPcb+SAO3vEE16qdLkDHP7IjW3suomTtObY+aCzpKKM56OETbSxhnwG0Qov5S2hNtRGQnsA6jEV2q3EkX8BTeJdYDpNEedDvRjimM9yguFwTnf+nZdz0dT+WigiCx5Iyb+jO+9+LO6rjW1mPJ8a5JIfPLGjTprditTUD0WKf8WkQcszxn7t2rsCM3cVPjdCngWGD4EHhgyix+NHKufqvm9oRvmv1k7zgIp2owdZf2fkSRVCVUcwksp1laJtiKun8ojqRDwiczApq2MY9vUQbyFPBhW9bCsdyBPYJ6YvwqjfVjiWfRfi5/MRtTn2zbSc8DfsvliSZn+7KAmLZSghLb51Ase+Rjgy3ePjgcW9ZTKOqaZqlcOJ7+H4215IiIh7fyOQVUHgZoqF3+6UOHCgA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DU2PR04MB8630.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(136003)(39860400002)(366004)(376002)(396003)(2906002)(956004)(86362001)(2616005)(83380400001)(478600001)(316002)(6512007)(4326008)(52116002)(1076003)(5660300002)(38100700002)(6666004)(36756003)(186003)(38350700002)(26005)(44832011)(66946007)(6486002)(6506007)(66476007)(66556008)(8936002)(8676002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Amfi627omWMkYvWVL0hV4vjY2FwG5KdkHg9GiwLOVW2e2rNE/OMTyxa7NOm3d4wECOshjWR9Z0vfEcO0kwd3nze0p4WxuXO0oM1AHFgOHuHv7jtR4Btz0O8PBkIPt/owJhFQ6dmA9G1HXEfYbi19okicMTpQ5FVT9zqgudYWwaF8YT4EpRqIjRCMrQTs2eyB47wswjWqO5KysLOwWRKFYem+rzSk4Q/xFNL/hzAh+rRxUH2OSjoAv1jd1wv8TAy59h0yV5OZG3RF7hJjs4SmvksCEkpSj/iMgTKoGFNbM/qO3xKdJ4iNv3IIH8YIUr/t39Y5AeJ8cboEGGjkaayPoA7PdJBP8q+d/flT47muPjxGDzPOS3d8NyY1HCLyON1F8pXqWBrAVCw9h7rq6pgahPOrwAdjBQrBVm9Y2mPXlArmXUMOfD0ttvPcAi9pdwevXSYu7r3UwVCvxq3M5lXauPde0CqQWE4rukCcKf/bV+AcTnQ/GnkoPCpQuWYQLx2eP/G1vDGo5KxzQwoCTpEkfCwnN7dgXJtzB1okDCu5nN9nCTYZKwgDRti4/jXNUSomVZjOVjAY9qmstNFFdvCxWEQNigWdK5U0ccsmYHbVy5padJIm9sEh++FuwqXND8MG0bjzrqrEL/a+9qpoeNoabDzyiqrYLLt3cP1MES6agyGBAUvZOZFZgQmHnoV3TEU2mbWi0VIBpxvjJTsLL2ryiNnIXb3AAOn9gZ5ORq3b8oBcsZ3OvMzx6sy/x2XPW9ApeCBAGB2cGd7okEIldxuuGP6X7q40eF/mQgg3SOEsNRpVFYnsi/tva1rb3TpSCMFLcxwYRn/4IKAvv8C/AAN+13YftbAsw/9D1uqJafo0bNNQZr696gbY/OkTNj8a8cZuIlwxBKoPjA6Ds9uz+1klLg5+sPUxAinHY4OS5gOReAnmhjTTjDWS8syeBqTkdpgsqvO41Ut4FWs49kTfGtO0TjfOBT5KoxaxvlF22gUKcRr2meQtMrWrMMyIb/hJRQBJKRs4pIRdl9N/NG+zvQoU+TsUmSSWP1ZgOTP/agdZ99HC9ucFSo9Xq4Yp5ESMDLZYfCzNKcYgIlQpdZ4v88E22f/uQbll/ZR5Baz1I27eD44l876jc16AoV/hDfdMQ3zPTXNvGJaGL6T9mZ4WVDQh1NYrWITgP6kVoBJeqnMWh2L0weFpI15p9dMfrHO3WweNCIRgUTt/4f9FrF5JnttYHfXVoy+JKwT4qQJR/HvDaHbFsLGd8/R213OFpnFf3RIBJLVIDhw0dfc7TVFP4cKgseO0GRCQBZOF+8JQsMbPE1yWAYSJjHWKfpXlTYIy34le X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c0271ff3-295f-42e8-3041-08d971dbb5ee X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Sep 2021 08:44:31.6705 (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: uzbsBOxCZ5CQyi945ZAiHl8T496ye5lvyndkXLQhbBOhuZSweEPoCevSvOXszF8MckORvLxQTvWKrcYPRcN0ww== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8935 Subject: [dpdk-dev] [PATCH v3 01/10] crypto/dpaa_sec: support DES-CBC 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: Gagandeep Singh add DES-CBC support and enable available cipher-only test cases. Signed-off-by: Gagandeep Singh --- doc/guides/cryptodevs/features/dpaa_sec.ini | 1 + drivers/crypto/dpaa_sec/dpaa_sec.c | 13 +++++++++++++ drivers/crypto/dpaa_sec/dpaa_sec.h | 20 ++++++++++++++++++++ 3 files changed, 34 insertions(+) -- 2.17.1 diff --git a/doc/guides/cryptodevs/features/dpaa_sec.ini b/doc/guides/cryptodevs/features/dpaa_sec.ini index 243f3e1d67..5d0d04d601 100644 --- a/doc/guides/cryptodevs/features/dpaa_sec.ini +++ b/doc/guides/cryptodevs/features/dpaa_sec.ini @@ -24,6 +24,7 @@ AES CBC (256) = Y AES CTR (128) = Y AES CTR (192) = Y AES CTR (256) = Y +DES CBC = Y 3DES CBC = Y SNOW3G UEA2 = Y ZUC EEA3 = Y diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c index 7534f80195..0a58f4e917 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c @@ -451,6 +451,7 @@ dpaa_sec_prep_cdb(dpaa_sec_session *ses) switch (ses->cipher_alg) { case RTE_CRYPTO_CIPHER_AES_CBC: case RTE_CRYPTO_CIPHER_3DES_CBC: + case RTE_CRYPTO_CIPHER_DES_CBC: case RTE_CRYPTO_CIPHER_AES_CTR: case RTE_CRYPTO_CIPHER_3DES_CTR: shared_desc_len = cnstr_shdsc_blkcipher( @@ -2040,6 +2041,10 @@ dpaa_sec_cipher_init(struct rte_cryptodev *dev __rte_unused, session->cipher_key.alg = OP_ALG_ALGSEL_AES; session->cipher_key.algmode = OP_ALG_AAI_CBC; break; + case RTE_CRYPTO_CIPHER_DES_CBC: + session->cipher_key.alg = OP_ALG_ALGSEL_DES; + session->cipher_key.algmode = OP_ALG_AAI_CBC; + break; case RTE_CRYPTO_CIPHER_3DES_CBC: session->cipher_key.alg = OP_ALG_ALGSEL_3DES; session->cipher_key.algmode = OP_ALG_AAI_CBC; @@ -2215,6 +2220,10 @@ dpaa_sec_chain_init(struct rte_cryptodev *dev __rte_unused, session->cipher_key.alg = OP_ALG_ALGSEL_AES; session->cipher_key.algmode = OP_ALG_AAI_CBC; break; + case RTE_CRYPTO_CIPHER_DES_CBC: + session->cipher_key.alg = OP_ALG_ALGSEL_DES; + session->cipher_key.algmode = OP_ALG_AAI_CBC; + break; case RTE_CRYPTO_CIPHER_3DES_CBC: session->cipher_key.alg = OP_ALG_ALGSEL_3DES; session->cipher_key.algmode = OP_ALG_AAI_CBC; @@ -2664,6 +2673,10 @@ dpaa_sec_ipsec_proto_init(struct rte_crypto_cipher_xform *cipher_xform, session->cipher_key.alg = OP_PCL_IPSEC_AES_CBC; session->cipher_key.algmode = OP_ALG_AAI_CBC; break; + case RTE_CRYPTO_CIPHER_DES_CBC: + session->cipher_key.alg = OP_PCL_IPSEC_DES; + session->cipher_key.algmode = OP_ALG_AAI_CBC; + break; case RTE_CRYPTO_CIPHER_3DES_CBC: session->cipher_key.alg = OP_PCL_IPSEC_3DES; session->cipher_key.algmode = OP_ALG_AAI_CBC; diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.h b/drivers/crypto/dpaa_sec/dpaa_sec.h index 2e0ab93ff0..9685010f3f 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.h +++ b/drivers/crypto/dpaa_sec/dpaa_sec.h @@ -482,6 +482,26 @@ static const struct rte_cryptodev_capabilities dpaa_sec_capabilities[] = { }, } }, } }, + { /* DES CBC */ + .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, + {.sym = { + .xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER, + {.cipher = { + .algo = RTE_CRYPTO_CIPHER_DES_CBC, + .block_size = 8, + .key_size = { + .min = 8, + .max = 8, + .increment = 0 + }, + .iv_size = { + .min = 8, + .max = 8, + .increment = 0 + } + }, } + }, } + }, { /* 3DES CBC */ .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, {.sym = { From patchwork Tue Sep 7 08:39:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 507519 Delivered-To: patch@linaro.org Received: by 2002:a02:8629:0:0:0:0:0 with SMTP id e38csp4033020jai; Tue, 7 Sep 2021 01:44:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwMyq64K5S5R/dp4nVAceEel5RqDUYTQRTwAXJHLaazKkdqIFP5epvpO3YClLI7fUDjwHxe X-Received: by 2002:aa7:c4c3:: with SMTP id p3mr17415648edr.122.1631004280952; Tue, 07 Sep 2021 01:44:40 -0700 (PDT) Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id q16si9811627edw.549.2021.09.07.01.44.40; Tue, 07 Sep 2021 01:44:40 -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=Gb8ZnTLM; 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 177A241123; Tue, 7 Sep 2021 10:44:35 +0200 (CEST) Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40045.outbound.protection.outlook.com [40.107.4.45]) by mails.dpdk.org (Postfix) with ESMTP id 69B6541100 for ; Tue, 7 Sep 2021 10:44:34 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kpJUP2bCYNnC8G8QBiIqLiuZ5Ycil4P+eLAV6AkWLq5AgTFZgN5k3FBewIRkp0o5TtdiM4XKg1tXhjgv/pqdatr3kmQq+tP/QL5GuoVoYNkhIPsCznXCgQyfOgN4UVnvYq7Vddyl9coqOIOOMWzGtAQvuJVhp9Vf6RVHTjigfaNJRGsmn8DoSXQlxrkbTMwppRZ1NZ0nxQkL3mTDg/fFW70tqE8y0FinS8meTOKpo9WhMWFBGIEQffss3sxQf2xCYK39W5vZL6DtUsvtxjhcf2uT/yLyMpvUhB/hd+Q2Ud9QYwdWI1Q20De6/Niuz5g6xRpqdCe8k8Uu2IC5mbkW2g== 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=szKEFX7wKRy9JNlscyzSYNe8o6r5Ua52+9HEk7MCQUI=; b=PI7Pobq/s8SanWqqlBs68Y7KNDA8J2SVKQyDntWbHJAbxCP5bx+gv0Y/HlyYyEoGn0YcsHbXFjnZABu+jji5at2UYsx4M25ydkQYhX+2u3sjEZBSHwWdYfsJE+hWYHOWSNkXvvAEY+wPC0jh2NRPtWaDsphQU8X5SrA/xqJ4H5yF84quM+VqqZIgOr3Pua5iwQ8MhAt0t0kYWF1aegUxy4gzRKtuSt5Y+Pe2dCDAWiSNxBII2LWNDZc7701zKX5vd5hQ4pAEMhsSFOEWXm0ooZRBGm/b4av70uE4YT4v1clhNCZQdN7KRMlPB7lfBZVrM9D3ErXrHwRnGB0VLEJlYQ== 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=szKEFX7wKRy9JNlscyzSYNe8o6r5Ua52+9HEk7MCQUI=; b=Gb8ZnTLMvc0MN9V/BqOEeaSj4JQZgQDIZNKhVg8kE8T30VNRtx0u/HaWxCx1dVY82Mw8IQvaRIiAFrlqdyqcPlc32XHzt2SLzH5bC++LO8mJaQ/InmrdHwiiwqVsexaHyjr4L+EYYNNnSs7UdE2KKx4c46N1Y5vutSi/NU1kmt4= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=nxp.com; Received: from DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) by DU2PR04MB8935.eurprd04.prod.outlook.com (2603:10a6:10:2e2::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14; Tue, 7 Sep 2021 08:44:33 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::945d:e362:712d:1b80]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::945d:e362:712d:1b80%4]) with mapi id 15.20.4478.025; Tue, 7 Sep 2021 08:44:33 +0000 From: Hemant Agrawal To: dev@dpdk.org, gakhil@marvell.com Cc: Gagandeep Singh Date: Tue, 7 Sep 2021 14:09:45 +0530 Message-Id: <20210907083953.8948-2-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210907083953.8948-1-hemant.agrawal@nxp.com> References: <20210825081837.23830-1-hemant.agrawal@nxp.com> <20210907083953.8948-1-hemant.agrawal@nxp.com> X-ClientProxiedBy: SGBP274CA0024.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b0::36) To DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from dpdk-xeon.ap.freescale.net (92.120.0.67) by SGBP274CA0024.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b0::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.20 via Frontend Transport; Tue, 7 Sep 2021 08:44:32 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 51f0f26b-28c4-450d-9cd0-08d971dbb72c X-MS-TrafficTypeDiagnostic: DU2PR04MB8935: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4502; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: M5exzIu64x2B6BuYX7Ps+OAKSm7cO5StRjNbbcPRQeo79XITZK4lm6TNj+UEFYx86ynMVpEr6L0RnzmqIgYi5lvtJ5AHffsfQ6+Jw+GXAABN2/oVqTmPKY9qlE0hz5//68Ns+eL7DWzRpbsY1thqiJL2aZvF1tZvzcn382tSOYnf1Ljos7esZ7ZSp+Sv/ieaUO7DGwMt3fvnsmrLJ44Qq1xmQ6b98TB1r9+KQbVj3G12IprB5+Pr1LnCWZv0z49uKUgzzFLbjRbjxi1YARuRPZ1Dofmqz3zmnfC75nwlW+SwQz0VJBG3qF1eRvGqot+eMztyuOoad4cpvsaCpZ7ilVMok6HHQ0+f/BCKUcjTrFEp4toTAzECdL+pv9n1n73ATIx6jzJ1Dvcgr/WuFyxhn5HJYOiai+v9GOmDpSfbuyKtExJofS/zzsaYh2KUmTIuP5PwB0LP0ggVmRaKGuLsz7OkXMZJd/Wxmm734L5AzMAFXNnz9EodIl2ihTEg4pFcY/51D40+H00/bMYKw2Qb++lF6IrRm8bMG+22dsszD1fIktbB9IuKw5k3qQNpuL1WMJI9+XGr6jbgxC1qBCKKcjl28KkeEhSP6C6En8Th06Jw+h8RHY/v4/4GcErIbTPHktpjRQC/rFbMIxwj0kEczcF+A/vdLgeDVqWa88dJtGXjzLcZHxfFaFUtGeoq3mVWvXUGUvzOT/d1h7nFGFTfiQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DU2PR04MB8630.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(136003)(39860400002)(366004)(376002)(396003)(2906002)(956004)(86362001)(2616005)(83380400001)(478600001)(316002)(6512007)(4326008)(52116002)(1076003)(5660300002)(38100700002)(6666004)(36756003)(186003)(38350700002)(26005)(44832011)(66946007)(6486002)(6506007)(66476007)(66556008)(8936002)(8676002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 7Qwkx24CVlFjdWxL1xW+0h7d6JdKhU9hfyWDUw9zTGecCt4U6ySyGuBadAvObVkivqDPE7/iVTHmaoE5gBIKwccD9hXBT1wBYHq0vdn5RHSdB2qeQL60Za7LgvDg/O9dY7azIIk97qKWH0mYWXNfvrRjR4e8NVIeq3j28k6a6797u+6zx3rCVJJi3eKGIBWPo89PkUWkliERh59WboSiQX5lkFYBTEmnvFtcFjlM/SH1oo8oBekgK24pk3wuxtSGRbseGkSlIEt9f78Ph8qbzNeNLvX4HQ+tuAmvtbS1sOVlQjwHCjvsp0fPdB6q+HCJsJDg7Os/ST5nWB9RHZQk2Azz+ICC8n6DawB0uwSn9MHYkMRz9N/VdbIBvqWUReaHtJAJ4NE044SJqNctFkR0b6MirkzpKgAhHAo+8uNG5umQTp5HPJJe17ly6jIprgjuHDPwPx1aVq7Bzg5We4ab1CHmyTtR5UztMwPZIXCh5w6lH1qp5L3R5EafEzW5KNH0hhg8XGqBsK6gDsWwT8eO95phz9ZReHVBo1UjOKgzGEBCDWvWvVASzOdFcJJHMItH13PD+a+uf2YEKlB53rW501dnBZcK6pf+8JQ2TYir6EDQw3Lk0LIpRJGLPVLp4SJmVzZqpbBkHEsEp33D9bnht8UG1v+QpoCx3awGnSOANl1VflqmWYRub5vsp3fWa0WZwy7PWXgiAawAne8ykWg5Np6Jpbr57zZd0FVK4bv9y3umq52samotCtIhlJjBlxaczFQNr3+xe3X/mtYsRUn0JWH/I3bxGgPW3EdrtUjz7LNFUT16N66LCpxv9UkVy4OasfnpbGXejjywfhHcnjBgNqSdETpVkUVTGszohFttbLDLmbtVLmsmbD7YHoL+P/6KG7zxV4HMLLIUxSa/RIQlkonxfzduVAElZUp4bZDeySN+l18T0UJzHJOvBocL2jFFQLxphlaLKXSqMXnTLv3h9iFGC5vfp6WnsmVviAW/etsWeWZ2S8jVQ8nrdmbCtgBTnruxm+I0bMmCKI0qO+F+OCQE6mV1AU24naSyDhzTkwmglqnQgozKndujFVApbHb0M/VN3EL6yb/omAW/oAa6i8zYIIXebREN21UTU2V80NOpvhheYuBsP+CLSLX407W7oNiFGvedo8qWdV3n/8LTM5FH6Ue2UNyl0V2aND9GkAcUfb2br0B0t/fFfUHIwf0haNJGkHv4MiRTeneRDEMAW9bqp0dpw87A6yfmM8eYGZHcS58OP0O4K8pPtPR5/ti+I/URJ9YVVyyPfNiUGi+osjYDoGdJXfMSJGJgrAJV7x9OMhrpiEDvXLt1I9BQae6d X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 51f0f26b-28c4-450d-9cd0-08d971dbb72c X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Sep 2021 08:44:33.6358 (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: JGIlivy2D29/sPNGLnVLJtG7ujQVl/V/Jw9uqPj3KAvfdrtZsVbPhqKCXKoTuQo3VWdP8X0Gf8rX/Uf4/tG7qg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8935 Subject: [dpdk-dev] [PATCH v3 02/10] crypto/dpaa_sec: support non-HMAC auth algos 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: Gagandeep Singh This patch add support for non-HMAC, md5, shax algos. Signed-off-by: Gagandeep Singh --- doc/guides/cryptodevs/features/dpaa_sec.ini | 8 +- drivers/crypto/dpaa_sec/dpaa_sec.c | 55 +++++++-- drivers/crypto/dpaa_sec/dpaa_sec.h | 126 ++++++++++++++++++++ 3 files changed, 180 insertions(+), 9 deletions(-) -- 2.17.1 diff --git a/doc/guides/cryptodevs/features/dpaa_sec.ini b/doc/guides/cryptodevs/features/dpaa_sec.ini index 5d0d04d601..eab14da96c 100644 --- a/doc/guides/cryptodevs/features/dpaa_sec.ini +++ b/doc/guides/cryptodevs/features/dpaa_sec.ini @@ -33,11 +33,17 @@ ZUC EEA3 = Y ; Supported authentication algorithms of the 'dpaa_sec' crypto driver. ; [Auth] +MD5 = Y MD5 HMAC = Y +SHA1 = Y SHA1 HMAC = Y +SHA224 = Y SHA224 HMAC = Y +SHA256 = Y SHA256 HMAC = Y +SHA384 = Y SHA384 HMAC = Y +SHA512 = Y SHA512 HMAC = Y SNOW3G UIA2 = Y ZUC EIA3 = Y @@ -53,4 +59,4 @@ AES GCM (256) = Y ; ; Supported Asymmetric algorithms of the 'dpaa_sec' crypto driver. ; -[Asymmetric] \ No newline at end of file +[Asymmetric] diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c index 0a58f4e917..4f5d9d7f49 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c @@ -486,6 +486,18 @@ dpaa_sec_prep_cdb(dpaa_sec_session *ses) alginfo_a.algtype = ses->auth_key.alg; alginfo_a.algmode = ses->auth_key.algmode; switch (ses->auth_alg) { + case RTE_CRYPTO_AUTH_MD5: + case RTE_CRYPTO_AUTH_SHA1: + case RTE_CRYPTO_AUTH_SHA224: + case RTE_CRYPTO_AUTH_SHA256: + case RTE_CRYPTO_AUTH_SHA384: + case RTE_CRYPTO_AUTH_SHA512: + shared_desc_len = cnstr_shdsc_hash( + cdb->sh_desc, true, + swap, SHR_NEVER, &alginfo_a, + !ses->dir, + ses->digest_length); + break; case RTE_CRYPTO_AUTH_MD5_HMAC: case RTE_CRYPTO_AUTH_SHA1_HMAC: case RTE_CRYPTO_AUTH_SHA224_HMAC: @@ -2077,43 +2089,70 @@ dpaa_sec_auth_init(struct rte_cryptodev *dev __rte_unused, { session->ctxt = DPAA_SEC_AUTH; session->auth_alg = xform->auth.algo; - session->auth_key.data = rte_zmalloc(NULL, xform->auth.key.length, + session->auth_key.length = xform->auth.key.length; + if (xform->auth.key.length) { + session->auth_key.data = + rte_zmalloc(NULL, xform->auth.key.length, RTE_CACHE_LINE_SIZE); - if (session->auth_key.data == NULL && xform->auth.key.length > 0) { - DPAA_SEC_ERR("No Memory for auth key"); - return -ENOMEM; + if (session->auth_key.data == NULL) { + DPAA_SEC_ERR("No Memory for auth key"); + return -ENOMEM; + } + memcpy(session->auth_key.data, xform->auth.key.data, + xform->auth.key.length); + } - session->auth_key.length = xform->auth.key.length; session->digest_length = xform->auth.digest_length; if (session->cipher_alg == RTE_CRYPTO_CIPHER_NULL) { session->iv.offset = xform->auth.iv.offset; session->iv.length = xform->auth.iv.length; } - memcpy(session->auth_key.data, xform->auth.key.data, - xform->auth.key.length); - switch (xform->auth.algo) { + case RTE_CRYPTO_AUTH_SHA1: + session->auth_key.alg = OP_ALG_ALGSEL_SHA1; + session->auth_key.algmode = OP_ALG_AAI_HASH; + break; case RTE_CRYPTO_AUTH_SHA1_HMAC: session->auth_key.alg = OP_ALG_ALGSEL_SHA1; session->auth_key.algmode = OP_ALG_AAI_HMAC; break; + case RTE_CRYPTO_AUTH_MD5: + session->auth_key.alg = OP_ALG_ALGSEL_MD5; + session->auth_key.algmode = OP_ALG_AAI_HASH; + break; case RTE_CRYPTO_AUTH_MD5_HMAC: session->auth_key.alg = OP_ALG_ALGSEL_MD5; session->auth_key.algmode = OP_ALG_AAI_HMAC; break; + case RTE_CRYPTO_AUTH_SHA224: + session->auth_key.alg = OP_ALG_ALGSEL_SHA224; + session->auth_key.algmode = OP_ALG_AAI_HASH; + break; case RTE_CRYPTO_AUTH_SHA224_HMAC: session->auth_key.alg = OP_ALG_ALGSEL_SHA224; session->auth_key.algmode = OP_ALG_AAI_HMAC; break; + case RTE_CRYPTO_AUTH_SHA256: + session->auth_key.alg = OP_ALG_ALGSEL_SHA256; + session->auth_key.algmode = OP_ALG_AAI_HASH; + break; case RTE_CRYPTO_AUTH_SHA256_HMAC: session->auth_key.alg = OP_ALG_ALGSEL_SHA256; session->auth_key.algmode = OP_ALG_AAI_HMAC; break; + case RTE_CRYPTO_AUTH_SHA384: + session->auth_key.alg = OP_ALG_ALGSEL_SHA384; + session->auth_key.algmode = OP_ALG_AAI_HASH; + break; case RTE_CRYPTO_AUTH_SHA384_HMAC: session->auth_key.alg = OP_ALG_ALGSEL_SHA384; session->auth_key.algmode = OP_ALG_AAI_HMAC; break; + case RTE_CRYPTO_AUTH_SHA512: + session->auth_key.alg = OP_ALG_ALGSEL_SHA512; + session->auth_key.algmode = OP_ALG_AAI_HASH; + break; case RTE_CRYPTO_AUTH_SHA512_HMAC: session->auth_key.alg = OP_ALG_ALGSEL_SHA512; session->auth_key.algmode = OP_ALG_AAI_HMAC; diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.h b/drivers/crypto/dpaa_sec/dpaa_sec.h index 9685010f3f..153747c87c 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.h +++ b/drivers/crypto/dpaa_sec/dpaa_sec.h @@ -266,6 +266,27 @@ static const struct rte_cryptodev_capabilities dpaa_sec_capabilities[] = { }, }, }, }, }, + { /* MD5 */ + .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, + {.sym = { + .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH, + {.auth = { + .algo = RTE_CRYPTO_AUTH_MD5, + .block_size = 64, + .key_size = { + .min = 0, + .max = 0, + .increment = 0 + }, + .digest_size = { + .min = 16, + .max = 16, + .increment = 0 + }, + .iv_size = { 0 } + }, } + }, } + }, { /* MD5 HMAC */ .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, {.sym = { @@ -287,6 +308,27 @@ static const struct rte_cryptodev_capabilities dpaa_sec_capabilities[] = { }, } }, } }, + { /* SHA1 */ + .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, + {.sym = { + .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH, + {.auth = { + .algo = RTE_CRYPTO_AUTH_SHA1, + .block_size = 64, + .key_size = { + .min = 0, + .max = 0, + .increment = 0 + }, + .digest_size = { + .min = 20, + .max = 20, + .increment = 0 + }, + .iv_size = { 0 } + }, } + }, } + }, { /* SHA1 HMAC */ .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, {.sym = { @@ -308,6 +350,27 @@ static const struct rte_cryptodev_capabilities dpaa_sec_capabilities[] = { }, } }, } }, + { /* SHA224 */ + .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, + {.sym = { + .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH, + {.auth = { + .algo = RTE_CRYPTO_AUTH_SHA224, + .block_size = 64, + .key_size = { + .min = 0, + .max = 0, + .increment = 0 + }, + .digest_size = { + .min = 28, + .max = 28, + .increment = 0 + }, + .iv_size = { 0 } + }, } + }, } + }, { /* SHA224 HMAC */ .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, {.sym = { @@ -329,6 +392,27 @@ static const struct rte_cryptodev_capabilities dpaa_sec_capabilities[] = { }, } }, } }, + { /* SHA256 */ + .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, + {.sym = { + .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH, + {.auth = { + .algo = RTE_CRYPTO_AUTH_SHA256, + .block_size = 64, + .key_size = { + .min = 0, + .max = 0, + .increment = 0 + }, + .digest_size = { + .min = 32, + .max = 32, + .increment = 0 + }, + .iv_size = { 0 } + }, } + }, } + }, { /* SHA256 HMAC */ .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, {.sym = { @@ -350,6 +434,27 @@ static const struct rte_cryptodev_capabilities dpaa_sec_capabilities[] = { }, } }, } }, + { /* SHA384 */ + .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, + {.sym = { + .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH, + {.auth = { + .algo = RTE_CRYPTO_AUTH_SHA384, + .block_size = 64, + .key_size = { + .min = 0, + .max = 0, + .increment = 0 + }, + .digest_size = { + .min = 48, + .max = 48, + .increment = 0 + }, + .iv_size = { 0 } + }, } + }, } + }, { /* SHA384 HMAC */ .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, {.sym = { @@ -371,6 +476,27 @@ static const struct rte_cryptodev_capabilities dpaa_sec_capabilities[] = { }, } }, } }, + { /* SHA512 */ + .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, + {.sym = { + .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH, + {.auth = { + .algo = RTE_CRYPTO_AUTH_SHA512, + .block_size = 128, + .key_size = { + .min = 0, + .max = 0, + .increment = 0 + }, + .digest_size = { + .min = 64, + .max = 64, + .increment = 0 + }, + .iv_size = { 0 } + }, } + }, } + }, { /* SHA512 HMAC */ .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, {.sym = { From patchwork Tue Sep 7 08:39:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 507520 Delivered-To: patch@linaro.org Received: by 2002:a02:8629:0:0:0:0:0 with SMTP id e38csp4033058jai; Tue, 7 Sep 2021 01:44:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwwgXPTLCQKPwzWdZusoH5YqzonCs+LmCCRk1hroNUiCANN43BAz5T3TAAu+d8N6OgAT+4x X-Received: by 2002:a17:906:1b14:: with SMTP id o20mr18228315ejg.154.1631004287029; Tue, 07 Sep 2021 01:44:47 -0700 (PDT) Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id a10si1693262ejf.122.2021.09.07.01.44.46; Tue, 07 Sep 2021 01:44:47 -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=pB0tdntg; 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 4345541104; Tue, 7 Sep 2021 10:44:37 +0200 (CEST) Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40072.outbound.protection.outlook.com [40.107.4.72]) by mails.dpdk.org (Postfix) with ESMTP id 2F7694111D for ; Tue, 7 Sep 2021 10:44:36 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FNS3LBPpeYVLR0fPBAy09BMfqLONDvUpZjP7JdTL2RL1Rhr8igl0Sd053s4sT9catakPcU+c+rgbi+n25meNC1cqLZDkARApJ5RWlk48xZuxSTcgfDwAViFPrLwExQZQGiyGTuWL/dD3xDzEPh8aljxk0COjzu8Q7z8TF0LuGLyP3ovDpOWPxzhRwGqbd+RU+rPdAXjaQf4hsaZPYz0iJcmLjXFj5pChWtAsHcLup3Pjm68BBN8W9VNzDgOImcm1czM258L2rdkqfWJdlmdMPEIOVyo5W34o1ScWhWMrrzqfY9225vx+nUvmTWLrKYYu4w7ciChQM3EBP72yHJMj1g== 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=Ba3V+HXzr0aPZg3Dm7OHfrVylgGmGBk+KXpHZ7pF9O8=; b=h50fnk71Zz5+OVIdAIc3EQxIJEdwPjmu6iHa1pr7Q6CEwpiNWpz7O1KGrUORtcZCBYx2BkSnL1AVXy7eFW/03xDPTGpSRyGaq8/FVH3lQo6mzlAz9EUepubr83D8tiztzOuMMLWGDfe//S3pCm7IVHHCSTOjV+K3B4ZAR+b7q8T+DfkOYBuK4ve0cPCtiW6dHX2OWNSTi2YdG5+bCsuQBoejDQzr2PzpMU+zfTWTd+C1AoEGslAj0aAtXX/K8opHmohgwA2iSsxYVmlBoyIZbP+UarOu+CJ7I8n5fo8r613doyS54GGGtF1kAI+4ZyJcQKhdv02ctUoFDToeysgqUg== 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=Ba3V+HXzr0aPZg3Dm7OHfrVylgGmGBk+KXpHZ7pF9O8=; b=pB0tdntgV/i3jkxBmGhHmshxSxt/UUaNN89FiScvYeYbB8avTWUYl7dOx0+eVFzlTxnRsXl65OOxIL0N08u6gubDCzTaDw/maEiBWzsmUgW2nDX3flW0sJebybc0OJ1uXuvAd5hIEz2jBFKYNI2rzj3cxjN6vFEbR7KLh1tyMgE= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=nxp.com; Received: from DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) by DU2PR04MB8935.eurprd04.prod.outlook.com (2603:10a6:10:2e2::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14; Tue, 7 Sep 2021 08:44:35 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::945d:e362:712d:1b80]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::945d:e362:712d:1b80%4]) with mapi id 15.20.4478.025; Tue, 7 Sep 2021 08:44:35 +0000 From: Hemant Agrawal To: dev@dpdk.org, gakhil@marvell.com Cc: Gagandeep Singh Date: Tue, 7 Sep 2021 14:09:46 +0530 Message-Id: <20210907083953.8948-3-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210907083953.8948-1-hemant.agrawal@nxp.com> References: <20210825081837.23830-1-hemant.agrawal@nxp.com> <20210907083953.8948-1-hemant.agrawal@nxp.com> X-ClientProxiedBy: SGBP274CA0024.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b0::36) To DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from dpdk-xeon.ap.freescale.net (92.120.0.67) by SGBP274CA0024.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b0::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.20 via Frontend Transport; Tue, 7 Sep 2021 08:44:34 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 387bb53b-8f07-497a-3860-08d971dbb83e X-MS-TrafficTypeDiagnostic: DU2PR04MB8935: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1122; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Ak600ZTPAgX1XU13e25ha8z4yGLR01hUpIYvwRvUtTibzRTrcvczGRjf+nLHDtf5GFZ3Go/M4Os0QPnbPNbtHOMqMrzYRTkAn74L2Z0qUSzJaOL9mG01UZ0ZA8uzKuTTF34IyMPkxCmlHpebjpeRnDf/WCXBckruLuKhop/rtJf0om/R/TN0D872Tpg3G0+tcOs/ZzpVy0jl5RTthjDuUxceYtmyF1og7kwpL7Clh2YaCzzmXkZp1fmSokNgauiGd7JsBSHCWjo0b0Bi3Hi5dHXc/J19rR1t0AfnZRFxQhC+MimgLQX1EOeQH4XDT/eH3OVeCQ19mrXKvsWrSyWp3SY6Bri0FZPq+uhGop2/jivRy/uicccN3YW4coLOXTnMihVmkhNLBXIftEG2VGRYTkXfEUYDbOzxa2GvloPDbAOc550e12P+wpzVTUQOlJ3i3NP59wFxMQEdoVP31PnI6nW+f9iGxomETYPJf68UfST8vSo6FyBOgzOTbBcbw8WXF/sL0CWzhvUXKzhCveMEU3i95hcSAtU3HvjN/EOhVtDjpILnX7mYrb6l/Yaw5yN6JRIqC+hZe0ZX7YbFP8Pcp40dMx/B/f+RsBoJG75/UVEQ3tlazqL+1MfWFedZwaZclvUnDptiR+szRMEl/fzPGmdQumMT0n/fUyNdvvy+ojnT+BNua7mNXlfel+bDBYajwd8AdK1bP4yHVjx9v7Jylg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DU2PR04MB8630.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(136003)(39860400002)(366004)(376002)(396003)(2906002)(956004)(86362001)(2616005)(83380400001)(478600001)(316002)(6512007)(4326008)(52116002)(1076003)(5660300002)(38100700002)(6666004)(36756003)(186003)(38350700002)(26005)(44832011)(66946007)(6486002)(6506007)(66476007)(66556008)(8936002)(8676002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Qp487NwvaLnrd/uw47PGeQ3LhbuvXrw28P6lLtwu96RbX854h3OTNM+f9mK6HjH0E3LmlYDOXDkps3WfOw13nlg7/ziOrlv/2lAsZNLvM0zdzllCMwyp8Ex/pS8GZf/o91oxt0PBh2Ni66QsZs9rLROLV85sdUxfiOZYBxwqivXvdKZ8JyDarcMl4C2VzUi9aqykz7FA46Yz26H8L9o6qcM6jQP2zsZEdmt7pu4TCaxticZ6egVqQEZNw3E5rw02+LAFOFkVgFskcTDP8Q8ivDtLkQPCKfGR8kNE6WIJr3MZld2+zLmjTzbykYUbIXOyz76gwUyxr3FbOHQ0SuLGVJuQygTOoakBe/GslyGfPCTPC+903LTMPl0i2dV7cZCTZBShIe/Tff84WCsomq59gI2K4lVK5R8xkpA+gUXDUFX8NrpoYaqaVENY5sDt09AInN0cGWJv98DufWOFA4zzNRz5mRrA80hqQzUZBGEnmOoRK5yKcInfpfFKZoZRUyR6wgCk8NgwCHwMpGSOi8AonWP99eA4FnKm5VoO05gJLyYiYegykxs1icPvkbX+3sU6Zty8Wv4BQPuIwjSoNjED8DOJW5w+tcDUoqpJu7OfJgALop5lLVAVgClChe9Azmrww7ESzJ1JLiOtDqKjWfM9tutxNKPffBKS2gc9xlbeqq+6t9IwmWDPB3N+/KEnATbE1cZEppULWKh4dSAUlmH8wmcD5hbAedQy97PewoWfyeXdOCVTQmg1oZ98dhWBI9TIBOBonXW2liXnyd/MJjgXqfJRmHQned8B32Ui6Enk9P1BYyPhWfekjr+veUwnI3PMW//aNzGVfPTFkiw9IcTEgaRaI9tq2oU3mRlUtdBur7+sLn5q+t6wn0un+UxU/tYdkobqvAuq/pLQgvfG/1uFHjZC3t1aQIYXA9hHfwIdGKyWsubUhsVH0uC76TbiQE4fyPLlWc43em5qon/1FgnF8B5elRF70Z14kav8Rux5re1fbAyoqYmk0hFCMzlQaxEH70iREPJrl+FCougNmextS/KlrWLH9Maq+ukA9G2p17RTi9pajLQv3x0poko+xNRfMB2HQ+em1FAXHf8KOjRClxkgApNrc3G/h2ezZKhcQoOzJKfKTjqR9Wf4OIdp6cXva9atzcFcl30FNBC2Cy6dx4dQ3eL7Q+U+ACdBQhOOML+TQWG68BbwCJVnsmQILtZ5xTS8FHVQDx7b13CO4VdRMyQMqLAwFC7TjiBB2qeZkaEoAOelgXKgD0AHPH2301IvlZOl5+8yhTefUWfuFJ3WZscinsVV8g6bOJbZR0NXT2WFsU/bIMydzWOYZ4ezK/LJ X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 387bb53b-8f07-497a-3860-08d971dbb83e X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Sep 2021 08:44:35.4409 (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: tCQgJC0znNP9ospML8q+/K8PHdjz7W04q28VThBqEIHD8uC3qHLWBqlcaNVcxZ5uSG2/GYgOfkoSVC00imykOg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8935 Subject: [dpdk-dev] [PATCH v3 03/10] crypto/dpaa_sec: support AES-XCBC-MAC 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: Gagandeep Singh This patch adds support for AES-XCBC-MAC algo. Signed-off-by: Gagandeep Singh --- doc/guides/cryptodevs/features/dpaa_sec.ini | 1 + drivers/crypto/dpaa_sec/dpaa_sec.c | 21 ++++++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/doc/guides/cryptodevs/features/dpaa_sec.ini b/doc/guides/cryptodevs/features/dpaa_sec.ini index eab14da96c..d7bc319373 100644 --- a/doc/guides/cryptodevs/features/dpaa_sec.ini +++ b/doc/guides/cryptodevs/features/dpaa_sec.ini @@ -47,6 +47,7 @@ SHA512 = Y SHA512 HMAC = Y SNOW3G UIA2 = Y ZUC EIA3 = Y +AES XCBC MAC = Y ; ; Supported AEAD algorithms of the 'dpaa_sec' crypto driver. diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c index 4f5d9d7f49..dab0ad28c0 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c @@ -524,6 +524,14 @@ dpaa_sec_prep_cdb(dpaa_sec_session *ses) !ses->dir, ses->digest_length); break; + case RTE_CRYPTO_AUTH_AES_XCBC_MAC: + shared_desc_len = cnstr_shdsc_aes_mac( + cdb->sh_desc, + true, swap, SHR_NEVER, + &alginfo_a, + !ses->dir, + ses->digest_length); + break; default: DPAA_SEC_ERR("unsupported auth alg %u", ses->auth_alg); } @@ -2165,6 +2173,10 @@ dpaa_sec_auth_init(struct rte_cryptodev *dev __rte_unused, session->auth_key.alg = OP_ALG_ALGSEL_ZUCA; session->auth_key.algmode = OP_ALG_AAI_F9; break; + case RTE_CRYPTO_AUTH_AES_XCBC_MAC: + session->auth_key.alg = OP_ALG_ALGSEL_AES; + session->auth_key.algmode = OP_ALG_AAI_XCBC_MAC; + break; default: DPAA_SEC_ERR("Crypto: Unsupported Auth specified %u", xform->auth.algo); @@ -2246,6 +2258,10 @@ dpaa_sec_chain_init(struct rte_cryptodev *dev __rte_unused, session->auth_key.alg = OP_ALG_ALGSEL_SHA512; session->auth_key.algmode = OP_ALG_AAI_HMAC; break; + case RTE_CRYPTO_AUTH_AES_XCBC_MAC: + session->auth_key.alg = OP_ALG_ALGSEL_AES; + session->auth_key.algmode = OP_ALG_AAI_XCBC_MAC; + break; default: DPAA_SEC_ERR("Crypto: Unsupported Auth specified %u", auth_xform->algo); @@ -2685,8 +2701,11 @@ dpaa_sec_ipsec_proto_init(struct rte_crypto_cipher_xform *cipher_xform, case RTE_CRYPTO_AUTH_NULL: session->auth_key.alg = OP_PCL_IPSEC_HMAC_NULL; break; - case RTE_CRYPTO_AUTH_SHA224_HMAC: case RTE_CRYPTO_AUTH_AES_XCBC_MAC: + session->auth_key.alg = OP_PCL_IPSEC_AES_XCBC_MAC_96; + session->auth_key.algmode = OP_ALG_AAI_XCBC_MAC; + break; + case RTE_CRYPTO_AUTH_SHA224_HMAC: case RTE_CRYPTO_AUTH_SNOW3G_UIA2: case RTE_CRYPTO_AUTH_SHA1: case RTE_CRYPTO_AUTH_SHA256: From patchwork Tue Sep 7 08:39:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 507521 Delivered-To: patch@linaro.org Received: by 2002:a02:8629:0:0:0:0:0 with SMTP id e38csp4033106jai; Tue, 7 Sep 2021 01:44:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz6MJWRFR/3lNRc+ZWTwxpNHEFJdILJdXxJAumzJCgBb6LCtN17RAHWXt7CbaK3MQzSFhjI X-Received: by 2002:a17:906:ed1:: with SMTP id u17mr17818048eji.304.1631004292799; Tue, 07 Sep 2021 01:44:52 -0700 (PDT) Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id aq28si10131767ejc.374.2021.09.07.01.44.52; Tue, 07 Sep 2021 01:44:52 -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=SUqXuY8B; 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 682BE4113B; Tue, 7 Sep 2021 10:44:40 +0200 (CEST) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70043.outbound.protection.outlook.com [40.107.7.43]) by mails.dpdk.org (Postfix) with ESMTP id E9E4F41136 for ; Tue, 7 Sep 2021 10:44:38 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BRuRvy+CyeY2X5TXQ2Z4mkQiN2ExG4duogQ1HNfK5HGMx43utBig1j2iZH55iIpQYwh2X9RjP/3TF5xoQtO+ZVyeXetdSA2xlcHaxze2F7umH0JFN2zQv+xXviSXq6xUab81vGYaUFwIRqhvAlcEASaDh0wLneO5rFbdw1pMemTMyk2arjcUHoB4Y+QkbwxLg5Qh9/mdsBlO66yUrNapvG0NZmCMBHTtGWgOoKvIZY/86Xk/eiy5v/n9fpLvjA2vu6+aa1IquQAmXs6K046RoQjRSUk0nbYj/sIi7eeNNnMIsiWGWrRIP37cUlJLExO+FfRYWsQVlScHbd1Th2asMw== 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=bEIyEIZTFzPH8Q/eZ5eTHPrDk0xotFP+NSgPBWkjmkg=; b=cc8L9iuN9dG3d+dM+n6e8VQ67ppL5DgpOIKHVGc0EXtg6r19jQ05Pd1BDo4rTyIZbh8dRrJR+zEkj7vUJ52X599/mqmUlcULv/I0FSI74QAjoDluzCj8G7dW8MO6MBT8bVy6b9MVRtuYrFwC9O/h/UrHTtQ4DvJ5OUYOu2Va+jtUE+coFDirIm40IZVdForFVE/6joOWVPnRoDz5bXrotxRerLVVXa4WB2PcbGBtWh/wmT+f+BnYoa8MNlLigpxg9Uajn70wpvGjOXDnAlgI23fh5YIG0krGTZgITA4axf6KeGi7UeKl92rFBQfJ69kWUlIqj6282qREyXCUShupIQ== 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=bEIyEIZTFzPH8Q/eZ5eTHPrDk0xotFP+NSgPBWkjmkg=; b=SUqXuY8BWWNr7Sa8k8axTDWZ5oiHa+9mQeSbsBwyw9nVw3FaQv9rLYUYTX00mJMN218pmqVo+R4LVTcEfXn1SnYOw5sZPxj8Uigd609/oOF1IK/fwkIzzjsJHbjK960D+W47UNvzcP0OIsQg/1dpRd5OFeOwaldR6zY8kpEHvmM= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=nxp.com; Received: from DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) by DU2PR04MB8949.eurprd04.prod.outlook.com (2603:10a6:10:2e0::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14; Tue, 7 Sep 2021 08:44:37 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::945d:e362:712d:1b80]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::945d:e362:712d:1b80%4]) with mapi id 15.20.4478.025; Tue, 7 Sep 2021 08:44:37 +0000 From: Hemant Agrawal To: dev@dpdk.org, gakhil@marvell.com Cc: Gagandeep Singh Date: Tue, 7 Sep 2021 14:09:47 +0530 Message-Id: <20210907083953.8948-4-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210907083953.8948-1-hemant.agrawal@nxp.com> References: <20210825081837.23830-1-hemant.agrawal@nxp.com> <20210907083953.8948-1-hemant.agrawal@nxp.com> X-ClientProxiedBy: SGBP274CA0024.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b0::36) To DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from dpdk-xeon.ap.freescale.net (92.120.0.67) by SGBP274CA0024.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b0::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.20 via Frontend Transport; Tue, 7 Sep 2021 08:44:35 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e504fb2e-6f53-430c-a9aa-08d971dbb94a X-MS-TrafficTypeDiagnostic: DU2PR04MB8949: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:359; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: N4h4wQF7FxqrlcGL/H0cvMVCo5U0mNEhQefDiZlIBULZPUBBfx2800wsdPltJtL51h1iLpD6qEnGFifxHNdK2T4o+DkeYREoKBNIby5o66t7ClzpoMuwDFkp3ZJ6ELqD+j4vZuatHpN4katR85+c0kLWI7YF2SA6AZlyoT/ZwKM8TBeQzqjUyA/ieIX8YaaBsdgHRpqPlfDmKrtq3irGGoYw7GQHmlhfYsZp2zO65SkoWZ6QjxvCvbFKb+IkSl2zW9EFR20ZH6RmVTBg6aD0gF33cZcOij3xx5hMvVHo9+56Kl/0zpkUIZo3h/9R87mca++2F94xzpHwCddCvXJVUWWsWERoAm7rcPaA360uGgXzGlaArdcbijt7gQAnEv2zdSEw2RlCXhDUAwjMVWjCvaYAi43JGAaNflj1zOzTAuq3gDlQndeXvvqAnqfUaQYXUemeRyaBw1WzDWcOS+sgS8kcJ4kvirmlydWZYCI4HLJDflSn7PJdFRMMe2c5jKusc/W8yZW2M2vM5t825tFzgcHODMJgP65TW3ToMklCEuA5Vaiq3SurspPCa2OzJss6+wCQZupMAHyjTGkU13sf6fy2821RGAo7b/XFOCU7NHLPDOxjw71FW/ujmGzM1wvhgdFn/BOHSM7jRYpHPq2Ng/NZfhGr/rcdQaPntnuxKfYb8h08nAu5+969cSbssT3n8CkZPGHLG6gPCeZsvELdtw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DU2PR04MB8630.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(366004)(136003)(376002)(346002)(39860400002)(86362001)(36756003)(38100700002)(38350700002)(316002)(44832011)(52116002)(6506007)(6512007)(186003)(2906002)(956004)(6666004)(5660300002)(8936002)(8676002)(6486002)(2616005)(26005)(1076003)(83380400001)(4326008)(66946007)(478600001)(66556008)(66476007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: GvuIacpOzxTFJOkE3Tw3sVp7Ho7gE/dQyrKnlqMfLAglarNSMmFQRHmKPoTGkqt8nouwGMmRY88JhKxnD3gg2uYRMR4xjIHXbuR6vqD+mZqkEx7m+1mbepyj5T0gFT+Mx629eyFV2nNOdbJMX8F3qZU/BNogjaDcyU/y8ZfG3a+qbPulX4V+1R0dpkZpe8bTb5mB3h5KLSAlHxcX03brhaVzbEwAd5kNBRf+rxLZ0vUEM9RWeK8yB2Pk+vEjviGnckSmRfshc76+cAhLqhe6StN1pzB1MwfQ9csw0WsTbDZra65bEBd5ZkiOmuCgq1KhLX8cKiESrie3c29xf+XmQKSt/9YWHtHx4Eybv5GXmKdcRgCYmnYkqwDc93F/3ySK36rDuBdVTImoVIh0/7pSDCX7tOteL1ITIp0ed3+OHqtEed5BJYt+mBw8DbQg62dChQYR6T85Zc9FgBKlU2PDbBEErJzInE105b84xNWfFHH5N3NYy/Cv68fYU2VSE2F2YDr/1mBPczD+J7u7JL0n6EhtD3H+ZY3CQjCNzOsfMCrKhWZvIWXY6oHZim7Uuf3CRYzsmzmYFRwlu5oNEG85mF+1LQxBPdjnpCSw8ke6qkpiGTDWynku1mcx1jEp43vJeSdPCW43LuN+EOw1Ae63nq9JwB103EhGuFQdLnSRiZ7H0z04CnmuoTOdTkaqJdhsRq5uuP2j6aeoCxzGQ5rhGzVPlnnEtjysKSZ0SBeGWnr0cgE4nMHUGUrnyQosREO+hn63QVUNCpzUGTi5uZ4EZ8I2AjaxnYMQpFO1NMOjQvyUJXEldbOFtMPAP6zPw/JC8WcakNUdg8tptfRynBCnQM4Q6kE7IwrWuVvL7I9nkAnZm86MnYFYTVtW3gkd/n+GBsVVepFBnRVMoSY6/CsxDyiesy+cRiFnYu7Dk5SChoFKZwBAWelzNrBfCrpWYUYyW1WZcovaX9t6HTVZxQqtqbZUbaGM0489bWaO6JrlKYiC2vN3+0U4HfxIQP1qiLT/vCaLNhXDa5wL4gtperrUg3tvdKoLgQheDRPltQt7/5g2UQERyLJ/qCCDyKcDgOjoF2Zw5xPwNf0gBRCNKe8nJndjG+6yJklF6W2mQdm9wQYlu/DSViaqFlUUbe2549Z/C0ppB16Wf/WQlwP14Kheo+v4VSXLl06SdEu1CzmlBF8WgaJRp7AvWSJjWNG7cTOvJ3gYKr+ucqMeABn7v3BGE8eonT2Ynj7s7HEPgNLc0mC6mMexPPy1+fj5Mus2Oa5H+9CEUfJMdVCgs8dHeEpGGqoAyEu5VYf9tujWsYNgy0ErmNq0azdvoegxUJ7TyGtF X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e504fb2e-6f53-430c-a9aa-08d971dbb94a X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Sep 2021 08:44:37.1932 (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: fHPEIvXTIyXhsP08AVevQEFcOJlcWHPrZpu+ohWrcvhrjnXRfaJEAxcU6o8Zfhaq8LyBCac6B8tmZ1VQ03Qfzw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8949 Subject: [dpdk-dev] [PATCH v3 04/10] crypto/dpaa_sec: add support for AES CMAC integrity check 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: Gagandeep Singh This patch adds support for AES_CMAC integrity in non-security mode. Signed-off-by: Gagandeep Singh --- doc/guides/cryptodevs/features/dpaa_sec.ini | 1 + drivers/crypto/dpaa_sec/dpaa_sec.c | 10 +++++ drivers/crypto/dpaa_sec/dpaa_sec.h | 43 +++++++++++++++++++++ 3 files changed, 54 insertions(+) -- 2.17.1 diff --git a/doc/guides/cryptodevs/features/dpaa_sec.ini b/doc/guides/cryptodevs/features/dpaa_sec.ini index d7bc319373..6a8f77fb1d 100644 --- a/doc/guides/cryptodevs/features/dpaa_sec.ini +++ b/doc/guides/cryptodevs/features/dpaa_sec.ini @@ -48,6 +48,7 @@ SHA512 HMAC = Y SNOW3G UIA2 = Y ZUC EIA3 = Y AES XCBC MAC = Y +AES CMAC (128) = Y ; ; Supported AEAD algorithms of the 'dpaa_sec' crypto driver. diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c index dab0ad28c0..7d3f971f3c 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c @@ -525,6 +525,7 @@ dpaa_sec_prep_cdb(dpaa_sec_session *ses) ses->digest_length); break; case RTE_CRYPTO_AUTH_AES_XCBC_MAC: + case RTE_CRYPTO_AUTH_AES_CMAC: shared_desc_len = cnstr_shdsc_aes_mac( cdb->sh_desc, true, swap, SHR_NEVER, @@ -2177,6 +2178,10 @@ dpaa_sec_auth_init(struct rte_cryptodev *dev __rte_unused, session->auth_key.alg = OP_ALG_ALGSEL_AES; session->auth_key.algmode = OP_ALG_AAI_XCBC_MAC; break; + case RTE_CRYPTO_AUTH_AES_CMAC: + session->auth_key.alg = OP_ALG_ALGSEL_AES; + session->auth_key.algmode = OP_ALG_AAI_CMAC; + break; default: DPAA_SEC_ERR("Crypto: Unsupported Auth specified %u", xform->auth.algo); @@ -2262,6 +2267,10 @@ dpaa_sec_chain_init(struct rte_cryptodev *dev __rte_unused, session->auth_key.alg = OP_ALG_ALGSEL_AES; session->auth_key.algmode = OP_ALG_AAI_XCBC_MAC; break; + case RTE_CRYPTO_AUTH_AES_CMAC: + session->auth_key.alg = OP_ALG_ALGSEL_AES; + session->auth_key.algmode = OP_ALG_AAI_CMAC; + break; default: DPAA_SEC_ERR("Crypto: Unsupported Auth specified %u", auth_xform->algo); @@ -2697,6 +2706,7 @@ dpaa_sec_ipsec_proto_init(struct rte_crypto_cipher_xform *cipher_xform, break; case RTE_CRYPTO_AUTH_AES_CMAC: session->auth_key.alg = OP_PCL_IPSEC_AES_CMAC_96; + session->auth_key.algmode = OP_ALG_AAI_CMAC; break; case RTE_CRYPTO_AUTH_NULL: session->auth_key.alg = OP_PCL_IPSEC_HMAC_NULL; diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.h b/drivers/crypto/dpaa_sec/dpaa_sec.h index 153747c87c..faa740618f 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.h +++ b/drivers/crypto/dpaa_sec/dpaa_sec.h @@ -738,6 +738,49 @@ static const struct rte_cryptodev_capabilities dpaa_sec_capabilities[] = { }, } }, } }, + { /* AES CMAC */ + .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, + {.sym = { + .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH, + {.auth = { + .algo = RTE_CRYPTO_AUTH_AES_CMAC, + .block_size = 16, + .key_size = { + .min = 1, + .max = 16, + .increment = 1 + }, + .digest_size = { + .min = 12, + .max = 16, + .increment = 4 + }, + .iv_size = { 0 } + }, } + }, } + }, + { /* AES XCBC HMAC */ + .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, + {.sym = { + .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH, + {.auth = { + .algo = RTE_CRYPTO_AUTH_AES_XCBC_MAC, + .block_size = 16, + .key_size = { + .min = 1, + .max = 16, + .increment = 1 + }, + .digest_size = { + .min = 12, + .max = 16, + .increment = 4 + }, + .aad_size = { 0 }, + .iv_size = { 0 } + }, } + }, } + }, RTE_CRYPTODEV_END_OF_CAPABILITIES_LIST() }; From patchwork Tue Sep 7 08:39:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 507522 Delivered-To: patch@linaro.org Received: by 2002:a02:8629:0:0:0:0:0 with SMTP id e38csp4033157jai; Tue, 7 Sep 2021 01:45:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxyEPbFw+TuJZy7tWm6jgz0j8VP2G8ENTCdTAXi/d11/krghHF+U51J/VaBeA5YROQCg5Rd X-Received: by 2002:a17:906:608e:: with SMTP id t14mr17486229ejj.441.1631004299873; Tue, 07 Sep 2021 01:44:59 -0700 (PDT) Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id dp5si10286975ejc.590.2021.09.07.01.44.59; Tue, 07 Sep 2021 01:44:59 -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="sg7B/Lbe"; 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 D2B6141145; Tue, 7 Sep 2021 10:44:41 +0200 (CEST) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70070.outbound.protection.outlook.com [40.107.7.70]) by mails.dpdk.org (Postfix) with ESMTP id 18BB041139 for ; Tue, 7 Sep 2021 10:44:40 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EBwCU4HbygI5+wO2fhCSf/3932jkaqIHp64ayPdQq61qFHSESMpsL1kCEc3MsHQZWokjBGR8IlmKnfRKnqT0TBE9rk3YxoiOrlJzkkNsiRyI1/bnHfJ7ArswDcTIrWrjtibjpyGAk6DTnNO0PXb/OOWkPkYUUvX0uy//PQ0bTAWOJg3hnyteciHp7QB/yXSs5l7PlbvqdYW+fFOvlfp23DYGiBVGNdoqjb6HSHfvmVimMUvYiSTFE7v6nLDxW5CPu6JNx/ueNJJfT23RIq/x41YAvuHmKAQ4aLHN8CJN7+XAVXLHuuYarrFhsjA8d4JArdK7HqeKnDFsQuktmSntTQ== 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=6EJIORFNXa7FdvJg1o7Ys9xXalITj78ptB6rE1u5eyQ=; b=jSzIaY1gTjEUJVWghz1eMwwr0JZiKCauVq8A/0jMIHHzHY9tLR1V+HFlR04ZZXf93ivlZcVgWCO8PS4CqYyDNNIq4GTBgFP/dR9T56SMqny41WkMxFqn9vNhzi8/MIMshRFzDrQ7hWDPMghXj0sw9OoCm5ZwLhJKcY+l18IvoBwlR183LhWlnV6kIY0AQGBmURG/Awdflak1+jfdoCRkSBvZAXGOdMYOHaDfVpIiD+gLyoWsBeE5cYUlg1bSvG7KOXmtMGpdhEqR0FqS1hZpkg+AKDAcurkwngLeKJjKxILhFTi74B88YPeQHKlwgl+T8yNKmSYcA6SAKN9CNoZQyA== 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=6EJIORFNXa7FdvJg1o7Ys9xXalITj78ptB6rE1u5eyQ=; b=sg7B/LbeN1u1y3/I/j4q2+biADwc9oyOlM4X72nRVJP1K4om1TQubT+JjclFxX37cFRqOMLvRMGHomt2/oXWWrrWxw25l9bzaOW60WgUyxzs2cVatmEdHvIDwBD902MIK9P9GBjM5aaVxFLdUJyrKU/JPbBONe7/IrHrzVl1PHU= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=nxp.com; Received: from DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) by DU2PR04MB8949.eurprd04.prod.outlook.com (2603:10a6:10:2e0::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14; Tue, 7 Sep 2021 08:44:39 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::945d:e362:712d:1b80]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::945d:e362:712d:1b80%4]) with mapi id 15.20.4478.025; Tue, 7 Sep 2021 08:44:39 +0000 From: Hemant Agrawal To: dev@dpdk.org, gakhil@marvell.com Cc: Franck LENORMAND Date: Tue, 7 Sep 2021 14:09:48 +0530 Message-Id: <20210907083953.8948-5-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210907083953.8948-1-hemant.agrawal@nxp.com> References: <20210825081837.23830-1-hemant.agrawal@nxp.com> <20210907083953.8948-1-hemant.agrawal@nxp.com> X-ClientProxiedBy: SGBP274CA0024.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b0::36) To DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from dpdk-xeon.ap.freescale.net (92.120.0.67) by SGBP274CA0024.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b0::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.20 via Frontend Transport; Tue, 7 Sep 2021 08:44:37 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: da1efdbc-c223-446e-b66f-08d971dbba57 X-MS-TrafficTypeDiagnostic: DU2PR04MB8949: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:165; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PTohNOSvZJkcdzNvpZbSsZFQBiXRe/HZckia5U7vwOPMgvR6cnY+tM2pPXOL9barMardydOnM91jEkMjNMIjkS2yCwKm2u2kXgN/W7ErJNO5lhL9MtaDJMTQGvVvlyqLNuMjGXy9Cdru4RUbOBZYvKF5/XEEreOgJweZSMpI4bOV9DOzvvDr3eyakokw5Zz3xfXJjjioFvu7GaIKSs0/hcsN6D7PXO8Og6cH4PPNYc47Pg/Hs0XGTttVYYEdSdf1usF5b6NN6ekveE5VD5ahpDCdy3L3oZD1RHskyqoZqe5PGNDeyvHZqglNeP7kaHHqhyqwt6GxS0TmiHUOhbQJBgyEAOqkjUT1Ph+WCBJz01YwM38M/d2x4mFLssakHDbiX1q3oD1IYIaVz+We4+vHh2CNb4LdnxKa/a+pbUuXIyOclWxYMpemPCVWC7h0eck7mATMCbV3MBj+CLObfhMbDNOTtL7CA7TaMGIRbkt7o0+Zf0XLVxhEQyPUgzgwa2922/em7EhC8voRTcxoNBPWRrDckK6BW3QifkirF014ZE67TJcrDR3sehv0hm3UDepUFc48u/GjoJ8kr+/6+U7w9Cl0dBxo97ZR4qmJC8cwJeioTumNdKC+JfQy0nf3YQr9s5ccdK1yc4OHHBdvmAsGvvLtWyPasGbE6l3swYPNs2GckdL2Q6xDcmtF8rqNyHf9ss8qAl2fWBL78kndmC1AvQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DU2PR04MB8630.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(366004)(136003)(376002)(346002)(39860400002)(86362001)(36756003)(38100700002)(38350700002)(316002)(44832011)(52116002)(6506007)(6512007)(186003)(2906002)(956004)(6666004)(5660300002)(8936002)(8676002)(6486002)(2616005)(26005)(1076003)(83380400001)(4326008)(66946007)(478600001)(66556008)(66476007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 2df95PSwTEZLtJvXjB+8PmxjY4DZan6GdHfJ1a/jvX0PcJY8YArgGZ/XcBktxl4XB+3vksauCfswUuhunjDxN0syZ+FTk8hBiz53hsZiAd+3L0O/1oYRhAjMshPBhNjeRiSA3vWg1ODLcAJYwwwOFU6h4XkEsxBP7k9IItnnvs9dYbxeUWJiiy5Js7tGQZmPPknJROvIsBm3G6VJYC7pDeep+J6EaBq3z5TJJnSyK5IobNLPjsEflY9wWuCA9CtkCl2+665QL9Z8RPYy7torg75dPkY6KV0Y13IEp1h9Gyygm6rnmkqo5P0dUyLJCr36epYXuU/3KLf3jtgbSlEmICmVWJ3iamhlrYB7iVjEKTTOgsifg5ni2KlofbG0VRk5WOw1PQJ2k8jPqiAS60KFYU57u2jk9a29U2y1c5UUXVzUBHRT2gEum+jp4DegnYJCYCUiNqNxte5X3qTagzVN834egirMB6k+rrJW9prj3zxxmZspk0ods9UiaGKqMnlUrqAFe274QnmTXvhsPqur5lgKKRJUi76WxeWJssoYOd63U2XTxKBkx4Nh/F6+iLRIyxetIiRgvdiupq+jiK4uTTZ4pSmwjCtiyirus4bXYJJqggt/6YBQenXT68KQXogvsxTj3PyOdOzdqY6kFxS8JCaTQov2RSD1thU9aqwO8vUajIT0BBGmFrRPQQjWz3/+aGtdziXy/h9r/tGvDySAdHByUUUnU4OidZgirt10sPo6/BLmRBVzBlFVG4+LyUdGxyYRh5y2It88pIGOwG8StZGuokwCbD7GD7vCc0j1a7hBBLhNToHvTMSAILhVpZGlHkYf+pdcI62cdlimtQZ6kjt52jcJGhwVlpbNZ5ALw+WV3a4GCrwlS9arQE1UFJ+7SB7PstTHbc95/qsfJ4/6wouCWyVZtKdowrb7NhwTh4zsNj65wbDOWCPcnDNH8DSOdfIURQHbhTGFy8Tw+WTFNbZSTTXhMvIweVhiEi4om7BMEyKaTdjYmHf+lZYJdwkqvMrefc6MSQBNmJkliGHl3I6vJHxlECD/RT2SgRJKtiDJiV5485bkreM4H6Jcf27QDm9H6IXcXUHc1mA7vfgTFnG1/SGTOpYA/MxDELoNLuKb7+SEcf2VEpzebVDPuF9WsAqxiCAb90gXkduN/DHZ6GqSmCToTDGXevPR49IgGd3qwMWXTWEzZpHfZtrN6GdK5wRWbXULFyePN+i1nd277ylmd0MPEoRxlbOJYfM3s5xmHjnMCJDGkDBMfdCUtHAcWQHQkdIJCNliifSjH/ANb6ccYyXt9pqIS2S46Q7uhLFwWAO0oJkTxZ4UoDQE/ExJ X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: da1efdbc-c223-446e-b66f-08d971dbba57 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Sep 2021 08:44:39.1237 (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: TQN4nHamtV5C5+AIcxp7NEhQOHdDlq93ZODyhdlwyKyK41y+9Fa/pcE6/5gI+DkDsDeUPNYXjdbHkPeLR8hZ6g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8949 Subject: [dpdk-dev] [PATCH v3 05/10] common/dpaax: caamflib load correct HFN from DESCBUF 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: Franck LENORMAND The offset of the HFn word and Bearer/Dir word is different depending on type of PDB. The wrong value was used. This patch address this issue Signed-off-by: Franck LENORMAND --- drivers/common/dpaax/caamflib/desc/pdcp.h | 7 +- drivers/common/dpaax/caamflib/desc/sdap.h | 96 ++++++++++++++++++----- 2 files changed, 80 insertions(+), 23 deletions(-) -- 2.17.1 diff --git a/drivers/common/dpaax/caamflib/desc/pdcp.h b/drivers/common/dpaax/caamflib/desc/pdcp.h index 659e289a45..e97d58cbc1 100644 --- a/drivers/common/dpaax/caamflib/desc/pdcp.h +++ b/drivers/common/dpaax/caamflib/desc/pdcp.h @@ -270,6 +270,9 @@ enum pdb_type_e { PDCP_PDB_TYPE_INVALID }; +#define REDUCED_PDB_DESCBUF_HFN_BEARER_DIR_OFFSET 4 +#define FULL_PDB_DESCBUF_HFN_BEARER_DIR_OFFSET 8 + /** * rta_inline_pdcp_query() - Provide indications if a key can be passed as * immediate data or shall be referenced in a @@ -2564,11 +2567,11 @@ insert_hfn_ov_op(struct program *p, return 0; case PDCP_PDB_TYPE_REDUCED_PDB: - hfn_pdb_offset = 4; + hfn_pdb_offset = REDUCED_PDB_DESCBUF_HFN_BEARER_DIR_OFFSET; break; case PDCP_PDB_TYPE_FULL_PDB: - hfn_pdb_offset = 8; + hfn_pdb_offset = FULL_PDB_DESCBUF_HFN_BEARER_DIR_OFFSET; break; default: diff --git a/drivers/common/dpaax/caamflib/desc/sdap.h b/drivers/common/dpaax/caamflib/desc/sdap.h index 6523db1733..f1c49ea3e6 100644 --- a/drivers/common/dpaax/caamflib/desc/sdap.h +++ b/drivers/common/dpaax/caamflib/desc/sdap.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright 2020 NXP + * Copyright 2020-2021 NXP */ #ifndef __DESC_SDAP_H__ @@ -109,12 +109,17 @@ static inline int pdcp_sdap_insert_no_int_op(struct program *p, bool swap __maybe_unused, struct alginfo *cipherdata, unsigned int dir, - enum pdcp_sn_size sn_size) + enum pdcp_sn_size sn_size, + enum pdb_type_e pdb_type) { int op; uint32_t sn_mask = 0; uint32_t length = 0; uint32_t offset = 0; + int hfn_bearer_dir_offset_in_descbuf = + (pdb_type == PDCP_PDB_TYPE_FULL_PDB) ? + FULL_PDB_DESCBUF_HFN_BEARER_DIR_OFFSET : + REDUCED_PDB_DESCBUF_HFN_BEARER_DIR_OFFSET; if (pdcp_sdap_get_sn_parameters(sn_size, swap, &offset, &length, &sn_mask)) @@ -137,7 +142,8 @@ static inline int pdcp_sdap_insert_no_int_op(struct program *p, SEQSTORE(p, MATH0, offset, length, 0); MATHB(p, MATH1, SHLD, MATH1, MATH1, 8, 0); - MOVEB(p, DESCBUF, 8, MATH2, 0, 8, WAITCOMP | IMMED); + MOVEB(p, DESCBUF, hfn_bearer_dir_offset_in_descbuf, + MATH2, 0, 8, WAITCOMP | IMMED); MATHB(p, MATH1, OR, MATH2, MATH2, 8, 0); MATHB(p, SEQINSZ, SUB, MATH3, VSEQINSZ, 4, 0); @@ -190,9 +196,14 @@ pdcp_sdap_insert_enc_only_op(struct program *p, bool swap __maybe_unused, struct alginfo *cipherdata, struct alginfo *authdata __maybe_unused, unsigned int dir, enum pdcp_sn_size sn_size, - unsigned char era_2_sw_hfn_ovrd __maybe_unused) + unsigned char era_2_sw_hfn_ovrd __maybe_unused, + enum pdb_type_e pdb_type) { uint32_t offset = 0, length = 0, sn_mask = 0; + int hfn_bearer_dir_offset_in_descbuf = + (pdb_type == PDCP_PDB_TYPE_FULL_PDB) ? + FULL_PDB_DESCBUF_HFN_BEARER_DIR_OFFSET : + REDUCED_PDB_DESCBUF_HFN_BEARER_DIR_OFFSET; if (pdcp_sdap_get_sn_parameters(sn_size, swap, &offset, &length, &sn_mask)) @@ -217,7 +228,8 @@ pdcp_sdap_insert_enc_only_op(struct program *p, bool swap __maybe_unused, /* Word (32 bit) swap */ MATHB(p, MATH1, SHLD, MATH1, MATH1, 8, 0); /* Load words from PDB: word 02 (HFN) + word 03 (bearer_dir)*/ - MOVEB(p, DESCBUF, 8, MATH2, 0, 8, WAITCOMP | IMMED); + MOVEB(p, DESCBUF, hfn_bearer_dir_offset_in_descbuf, + MATH2, 0, 8, WAITCOMP | IMMED); /* Create basic IV */ MATHB(p, MATH1, OR, MATH2, MATH2, 8, 0); @@ -309,13 +321,18 @@ static inline int pdcp_sdap_insert_snoop_op(struct program *p, bool swap __maybe_unused, struct alginfo *cipherdata, struct alginfo *authdata, unsigned int dir, enum pdcp_sn_size sn_size, - unsigned char era_2_sw_hfn_ovrd __maybe_unused) + unsigned char era_2_sw_hfn_ovrd __maybe_unused, + enum pdb_type_e pdb_type) { uint32_t offset = 0, length = 0, sn_mask = 0; uint32_t int_op_alg = 0; uint32_t int_op_aai = 0; uint32_t cipher_op_alg = 0; uint32_t cipher_op_aai = 0; + int hfn_bearer_dir_offset_in_descbuf = + (pdb_type == PDCP_PDB_TYPE_FULL_PDB) ? + FULL_PDB_DESCBUF_HFN_BEARER_DIR_OFFSET : + REDUCED_PDB_DESCBUF_HFN_BEARER_DIR_OFFSET; if (authdata->algtype == PDCP_CIPHER_TYPE_ZUC) { if (rta_sec_era < RTA_SEC_ERA_5) { @@ -362,11 +379,13 @@ pdcp_sdap_insert_snoop_op(struct program *p, bool swap __maybe_unused, /* Load the HFN / Beare / Dir from the PDB * CAAM word are 32bit hence loading 8 byte loads 2 words: - * - The HFN at offset 8 - * - The Bearer / Dir at offset 12 + * - The HFN at offset hfn_bearer_dir_offset_in_descbuf + * - The Bearer / Dir at next word */ - MOVEB(p, DESCBUF, 8, MATH2, 0, 8, WAITCOMP | IMMED); - /* Create the 4 first byte of the ICV by oring the math registers */ + MOVEB(p, DESCBUF, hfn_bearer_dir_offset_in_descbuf, + MATH2, 0, 8, WAITCOMP | IMMED); + + /* Create the 4 first byte of the ICV by or-ing the math registers */ MATHB(p, MATH1, OR, MATH2, MATH1, 8, 0); /* Set the IV of class 1 CHA */ @@ -562,11 +581,16 @@ pdcp_sdap_insert_snoop_op(struct program *p, bool swap __maybe_unused, static inline int pdcp_sdap_insert_no_snoop_op( struct program *p, bool swap __maybe_unused, struct alginfo *cipherdata, struct alginfo *authdata, unsigned int dir, enum pdcp_sn_size sn_size, - unsigned char era_2_sw_hfn_ovrd __maybe_unused) + unsigned char era_2_sw_hfn_ovrd __maybe_unused, + enum pdb_type_e pdb_type) { uint32_t offset = 0, length = 0, sn_mask = 0; uint32_t cipher_alg_op = 0; uint32_t cipher_alg_aai = 0; + int hfn_bearer_dir_offset_in_descbuf = + (pdb_type == PDCP_PDB_TYPE_FULL_PDB) ? + FULL_PDB_DESCBUF_HFN_BEARER_DIR_OFFSET : + REDUCED_PDB_DESCBUF_HFN_BEARER_DIR_OFFSET; if (authdata->algtype == PDCP_CIPHER_TYPE_ZUC) { if (rta_sec_era < RTA_SEC_ERA_5) { @@ -592,7 +616,8 @@ static inline int pdcp_sdap_insert_no_snoop_op( #endif MATHB(p, MATH1, SHLD, MATH1, MATH1, 8, 0); - MOVEB(p, DESCBUF, 8, MATH2, 0, 0x08, WAITCOMP | IMMED); + MOVEB(p, DESCBUF, hfn_bearer_dir_offset_in_descbuf, + MATH2, 0, 0x08, WAITCOMP | IMMED); MATHB(p, MATH1, OR, MATH2, MATH2, 8, 0); SEQSTORE(p, MATH0, offset, length, 0); @@ -753,22 +778,51 @@ static inline int pdcp_sdap_insert_no_snoop_op( return 0; } +static inline int +pdcp_sdap_insert_cplane_null_op(struct program *p, + bool swap __maybe_unused, + struct alginfo *cipherdata, + struct alginfo *authdata, + unsigned int dir, + enum pdcp_sn_size sn_size, + unsigned char era_2_sw_hfn_ovrd, + enum pdb_type_e pdb_type __maybe_unused) +{ + return pdcp_insert_cplane_int_only_op(p, swap, cipherdata, authdata, + dir, sn_size, era_2_sw_hfn_ovrd); +} + +static inline int +pdcp_sdap_insert_cplane_int_only_op(struct program *p, + bool swap __maybe_unused, + struct alginfo *cipherdata, + struct alginfo *authdata, + unsigned int dir, + enum pdcp_sn_size sn_size, + unsigned char era_2_sw_hfn_ovrd, + enum pdb_type_e pdb_type __maybe_unused) +{ + return pdcp_insert_cplane_int_only_op(p, swap, cipherdata, authdata, + dir, sn_size, era_2_sw_hfn_ovrd); +} + static int pdcp_sdap_insert_with_int_op( struct program *p, bool swap __maybe_unused, struct alginfo *cipherdata, struct alginfo *authdata, enum pdcp_sn_size sn_size, - unsigned char era_2_sw_hfn_ovrd, unsigned int dir) + unsigned char era_2_sw_hfn_ovrd, unsigned int dir, + enum pdb_type_e pdb_type) { static int ( *pdcp_cp_fp[PDCP_CIPHER_TYPE_INVALID][PDCP_AUTH_TYPE_INVALID])( struct program *, bool swap, struct alginfo *, struct alginfo *, unsigned int, enum pdcp_sn_size, - unsigned char __maybe_unused) = { + unsigned char __maybe_unused, enum pdb_type_e pdb_type) = { { /* NULL */ - pdcp_insert_cplane_null_op, /* NULL */ - pdcp_insert_cplane_int_only_op, /* SNOW f9 */ - pdcp_insert_cplane_int_only_op, /* AES CMAC */ - pdcp_insert_cplane_int_only_op /* ZUC-I */ + pdcp_sdap_insert_cplane_null_op, /* NULL */ + pdcp_sdap_insert_cplane_int_only_op, /* SNOW f9 */ + pdcp_sdap_insert_cplane_int_only_op, /* AES CMAC */ + pdcp_sdap_insert_cplane_int_only_op /* ZUC-I */ }, { /* SNOW f8 */ @@ -796,7 +850,7 @@ static int pdcp_sdap_insert_with_int_op( err = pdcp_cp_fp[cipherdata->algtype] [authdata->algtype](p, swap, cipherdata, authdata, dir, - sn_size, era_2_sw_hfn_ovrd); + sn_size, era_2_sw_hfn_ovrd, pdb_type); if (err) return err; @@ -948,7 +1002,7 @@ cnstr_shdsc_pdcp_sdap_u_plane(uint32_t *descbuf, } else { err = pdcp_sdap_insert_no_int_op(p, swap, cipherdata, caps_mode, - sn_size); + sn_size, pdb_type); if (err) { pr_err("Fail pdcp_sdap_insert_no_int_op\n"); return err; @@ -958,7 +1012,7 @@ cnstr_shdsc_pdcp_sdap_u_plane(uint32_t *descbuf, err = pdcp_sdap_insert_with_int_op(p, swap, cipherdata, authdata, sn_size, era_2_sw_hfn_ovrd, - caps_mode); + caps_mode, pdb_type); if (err) { pr_err("Fail pdcp_sdap_insert_with_int_op\n"); return err; From patchwork Tue Sep 7 08:39:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 507523 Delivered-To: patch@linaro.org Received: by 2002:a02:8629:0:0:0:0:0 with SMTP id e38csp4033192jai; Tue, 7 Sep 2021 01:45:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwzh4ovdj9B696skEM9w/zuTX0y+8qtLC+6Sw9uP9wcksObS+AYw4m3ZUjszStH/48RGDLb X-Received: by 2002:aa7:c884:: with SMTP id p4mr16956239eds.203.1631004305191; Tue, 07 Sep 2021 01:45:05 -0700 (PDT) Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id z1si11156177edd.89.2021.09.07.01.45.05; Tue, 07 Sep 2021 01:45:05 -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="TztQoDw/"; 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 F16944114A; Tue, 7 Sep 2021 10:44:42 +0200 (CEST) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70082.outbound.protection.outlook.com [40.107.7.82]) by mails.dpdk.org (Postfix) with ESMTP id E1AC541147 for ; Tue, 7 Sep 2021 10:44:41 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oThZ/pbk+MRRG0no736j7JqPUY8v23Fq6DoCW6HqC0DOCDBuZBadjfPqSFDEUMm0sCenQvq97GcJjN6ZZpeyZHYDrhJ4gCWXbdXDr8gEYyL+l25KDpfreaGxl2NUldJHikR7YixPFCvBIzrrgjud7KET7iKJyOF+e89Fwoq/eP3dSpbBT8jrRUZ3DLjPm07suwv79KgDz63yWHjzCTwRPiiuICmS7kO3zsveGxoX7xDdxl/fCNOL0DC0TzBsH/hTwctZtZOHeDt2n9vKULRnjwED6pfxyie/lHd7kt9XRrkeS1lD+fibnwjriujSOCfM9xW9bz83aEr1PtvpSRejlg== 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=iH5cuKgZBTdYaSnoGB2/fO/69P0Gm9xN1QfkkCR4kfM=; b=db3ZC7FDDCXMuVFBFYjJmUlp/Wv3wxYr73aSYcZkKbAbsWAX4Zx7zM2FCOuc4J6eZWB6RS7r4JdEQPWy3Eyim14v0ELjMaAgvQ+fe8jeUCaeIb827WwCFvBYKvfuGmrZr8FYGyMc2pAWS9Y5vd4DsP/4hfCG+BNvwRR+PK4hiwPQDy0bLOM2m9I7OsqpMrwqLQn7sQxgcSmH46vKXcw2XwHoY2VlBKO0t3PqNHrY75KA2KMB7PUMXpTR0YCd5dymeSfQCc7/3P6tQLxIkY2zIOX5EHfXmKSw9ftXDgZHAZy7fRHbdmY7aVF1N5RkY7n/lv45gzwe/jOobU2jT7vvoQ== 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=iH5cuKgZBTdYaSnoGB2/fO/69P0Gm9xN1QfkkCR4kfM=; b=TztQoDw/+X35PCYraQwuBVQxK7iZY66uvB0oQGWa5fbuXEQnR7aZtbhQlNZY5saV5RFgyuPfy5gebooXSi+AZaIFu8cUHGvCbKSteiMjfS4qD3g0u5Xw1Vnayq/hRghsMF54708PciJdsz5URROyY06BOChdvB9YAydQFXmctnc= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=nxp.com; Received: from DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) by DU2PR04MB8949.eurprd04.prod.outlook.com (2603:10a6:10:2e0::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14; Tue, 7 Sep 2021 08:44:41 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::945d:e362:712d:1b80]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::945d:e362:712d:1b80%4]) with mapi id 15.20.4478.025; Tue, 7 Sep 2021 08:44:41 +0000 From: Hemant Agrawal To: dev@dpdk.org, gakhil@marvell.com Cc: Franck LENORMAND Date: Tue, 7 Sep 2021 14:09:49 +0530 Message-Id: <20210907083953.8948-6-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210907083953.8948-1-hemant.agrawal@nxp.com> References: <20210825081837.23830-1-hemant.agrawal@nxp.com> <20210907083953.8948-1-hemant.agrawal@nxp.com> X-ClientProxiedBy: SGBP274CA0024.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b0::36) To DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from dpdk-xeon.ap.freescale.net (92.120.0.67) by SGBP274CA0024.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b0::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.20 via Frontend Transport; Tue, 7 Sep 2021 08:44:39 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d88afe7c-8634-4d1a-3045-08d971dbbb9e X-MS-TrafficTypeDiagnostic: DU2PR04MB8949: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bcYUe9dRt/sltQ4TusJLSNM6W7/agPVmYQaZKkSTuKPVWAPXjn+PrQBNzWvNKSTmfaeMfEmGbgBZh9dQydc62/QKIxmOo7ZapBDMOFT9c7KLG2FThVumz2WnPz9KaAA+trPrblVN+3cmaOZWhPTwpI2ZrEZ3msB4JpyO1lERKvLKyuP7SetZD5R7ydBacCHOV5134j/SomPoI1NqUheqi3np1NyawvJBzURnXRBDh4ujSKLwjVD+mqJjVKeOaihMMYnkr3LXO+0sfqBCLoE2op2bD221+43qCr7QGd/79Fk30BcL5LgRC92ppeKZO3+InfeAw6089gfsvdnQznPGUz+qoQ2kQUn62BVTiVtZ+fQ12f0aXNPWeKuxIlkYuG8j79Nxzfoh2OIJ95VgUQ7o4Gz8RKtcsgvPc+FigvAZeBqT9BJSRoEkx2IkelD2asLRV9dKGduDx/5M3dOLJCATPiI43N32Jh1KbT+kXPbbb7XV5Uaw2X7rygZquJqK9B0u6pp6rCOKlHsiUyoELqhydyt3j0zmYiPAPP6R/DCiP0Uoj1yrteRE7OpXf0katn0lhbIS1aucbRSmInmc9At0LRrxQoRSJnKLPO2ToIPGevBHw3tt029RyF9+USY3tsF4BMeZf7n6z1BcW/oPM9qqsqH2pKQeOycunK6cjX3cBm/09TBU1EZjtQd9x0Q+D37BIqtbQYsG3WcKYlv5+G1fSg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DU2PR04MB8630.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(366004)(136003)(376002)(346002)(39860400002)(86362001)(36756003)(38100700002)(38350700002)(316002)(44832011)(52116002)(6506007)(6512007)(186003)(2906002)(956004)(6666004)(5660300002)(8936002)(8676002)(6486002)(2616005)(26005)(1076003)(83380400001)(4326008)(66946007)(478600001)(66556008)(66476007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: YL9InBKgajNZW06jGM/tucol78puaoM5WAfVsG2HJxBrceLDTHSV8coRwuD2H1Uv9AsTt6SKFwfAcBy+uVA73+Dm2x2TWc+SqzzuGXEQMrpdn8hNFvbc8N5/q+2z/Syocc30eyrziu9iAQkfFP9QUiiyipRHFhCsOC6AcbjABnqArrATlTiuUwSamFnZTfdmpz+ncp9T4+C7cU7laAm3SpV/WNOmFx46SRvOQJ26uaOzKUwRI9d5aj7jUKA+yi5pxi/AH6Qy20bAlBqNMijIn/nLoGAPDfE3njhsaqsBJdB9qLZwOMg4JZ2PZThvT2lkHvPijIKmpcZN4jfjshSsxb7GvGp1OjA1vf/uUi4rkp76Nc942WngkVZpvhcsUlfPkMIlJRsnHj9k5Q8agLFKbKci11iBiIcrF/FGqZ1CDRi6eF9K0mroAhEZjWvZzpzlFBBIMC9QZsZc2oryYxWrwv/a0vs1zJzcG1kSVeUsbZfKfldaddXP6kuLYjhPJITdaALR52Sk1nj5e5YaSOxdpbFD1Uc4NcQpZEXW1XPmI8wEkgkV/QcniIY6L3y2GGUhHu+Q7Gu5mPjifWG+uGzyZS3ft5LXb5ozpE8VHJnKHESSC4vD41jE4uZp/sMiM8AQxHTeY5fztKvvU6mraT4dF0SskxtBLVmmadGzdzBaEBK4VuttXT8i3HqZ0mEAPvMfC8zrriXAcu3V0FcTAW3HUCALZQ7kcVrY9UBoetbtYhBVtLAU/UOfO6UIvybNCGtxbTenzZFhQKs9dBcsVdggCqTvCMrLOKg/iFsooMluGcCNc5zCkKj9shyidUBc+ZWYK/nhowT3IMUPwsDqAO8coWbhXOTgsOoT86llR9KZGlAzpm7ZIlYH07/dvmcrk4UwgdQgwzBHnTgxMipQqrK/7NXjdoRKKng94Yo026Bs7aS/3r4rdJ9uVUr7ZOcwSLDCJBvK4n1GI7DkEs3DZ2Sf7ogbEqJGicT/4LwQlAMIAKq6MxCjSwH9eSergKKf+wI2IRcYMnqcizyeE2mn54B8HHSYgs35KCw93PKPfMcH/66n10TH7BwfN8FlSHd3XEp57vGI65+FH5DE79RvOiOx1DeLBbPx+utUujGTpg5pjFBkK+qo0+OlgSQYrkCKzr9Wdi47yX9fDZgNQQ3rxCpuBgH7Y1NVkC4bOtVhUCRSyh+GH4qnCmMp6Mkf267j7LEz0jMhPr1/NQm+nXOjC+FL2tSU2DtFT26qrYXnA78ZbDih4f34jaCnOkHKLIuGU5kuYVo7T+ZtHcnixkFu62o0NbAU+kyj4QBDV5u1uSLaITHRUJPBSMG7EAfrbbIz7r9F X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d88afe7c-8634-4d1a-3045-08d971dbbb9e X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Sep 2021 08:44:41.1826 (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: 65InO/FYOv7BaStaDHgQW3VABoI0OpKfIq7qTaRgUOQkkq4mPVe8Zi0rPMtG39AbQe5BovNCKFUyiQ2O2iIFQQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8949 Subject: [dpdk-dev] [PATCH v3 06/10] common/dpaax: caamflib do not clear DPOVRD 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: Franck LENORMAND For SDAP, we are not using the protocol operation to perform 4G/LTE operation so the DPOVRD option is not used. Removing it save some space in the descriptor buffer and execution time. Signed-off-by: Franck LENORMAND --- drivers/common/dpaax/caamflib/desc/pdcp.h | 14 ++++++++------ drivers/common/dpaax/caamflib/desc/sdap.h | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) -- 2.17.1 diff --git a/drivers/common/dpaax/caamflib/desc/pdcp.h b/drivers/common/dpaax/caamflib/desc/pdcp.h index e97d58cbc1..5b3d846099 100644 --- a/drivers/common/dpaax/caamflib/desc/pdcp.h +++ b/drivers/common/dpaax/caamflib/desc/pdcp.h @@ -2546,7 +2546,8 @@ static inline int insert_hfn_ov_op(struct program *p, uint32_t shift, enum pdb_type_e pdb_type, - unsigned char era_2_sw_hfn_ovrd) + unsigned char era_2_sw_hfn_ovrd, + bool clear_dpovrd_at_end) { uint32_t imm = PDCP_DPOVRD_HFN_OV_EN; uint16_t hfn_pdb_offset; @@ -2597,13 +2598,14 @@ insert_hfn_ov_op(struct program *p, MATHB(p, MATH0, SHLD, MATH0, MATH0, 8, 0); MOVE(p, MATH0, 0, DESCBUF, hfn_pdb_offset, 4, IMMED); - if (rta_sec_era >= RTA_SEC_ERA_8) + if (clear_dpovrd_at_end && (rta_sec_era >= RTA_SEC_ERA_8)) { /* * For ERA8, DPOVRD could be handled by the PROTOCOL command * itself. For now, this is not done. Thus, clear DPOVRD here * to alleviate any side-effects. */ MATHB(p, DPOVRD, AND, ZERO, DPOVRD, 4, STL); + } SET_LABEL(p, keyjump); PATCH_JUMP(p, pkeyjump, keyjump); @@ -2989,7 +2991,7 @@ cnstr_shdsc_pdcp_c_plane_encap(uint32_t *descbuf, SET_LABEL(p, pdb_end); err = insert_hfn_ov_op(p, sn_size, pdb_type, - era_2_sw_hfn_ovrd); + era_2_sw_hfn_ovrd, true); if (err) return err; @@ -3143,7 +3145,7 @@ cnstr_shdsc_pdcp_c_plane_decap(uint32_t *descbuf, SET_LABEL(p, pdb_end); err = insert_hfn_ov_op(p, sn_size, pdb_type, - era_2_sw_hfn_ovrd); + era_2_sw_hfn_ovrd, true); if (err) return err; @@ -3319,7 +3321,7 @@ cnstr_shdsc_pdcp_u_plane_encap(uint32_t *descbuf, } SET_LABEL(p, pdb_end); - err = insert_hfn_ov_op(p, sn_size, pdb_type, era_2_sw_hfn_ovrd); + err = insert_hfn_ov_op(p, sn_size, pdb_type, era_2_sw_hfn_ovrd, true); if (err) return err; @@ -3523,7 +3525,7 @@ cnstr_shdsc_pdcp_u_plane_decap(uint32_t *descbuf, } SET_LABEL(p, pdb_end); - err = insert_hfn_ov_op(p, sn_size, pdb_type, era_2_sw_hfn_ovrd); + err = insert_hfn_ov_op(p, sn_size, pdb_type, era_2_sw_hfn_ovrd, true); if (err) return err; diff --git a/drivers/common/dpaax/caamflib/desc/sdap.h b/drivers/common/dpaax/caamflib/desc/sdap.h index f1c49ea3e6..d5d5850b4f 100644 --- a/drivers/common/dpaax/caamflib/desc/sdap.h +++ b/drivers/common/dpaax/caamflib/desc/sdap.h @@ -990,7 +990,7 @@ cnstr_shdsc_pdcp_sdap_u_plane(uint32_t *descbuf, SET_LABEL(p, pdb_end); /* Inser the HFN override operation */ - err = insert_hfn_ov_op(p, sn_size, pdb_type, era_2_sw_hfn_ovrd); + err = insert_hfn_ov_op(p, sn_size, pdb_type, era_2_sw_hfn_ovrd, false); if (err) return err; From patchwork Tue Sep 7 08:39:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 507524 Delivered-To: patch@linaro.org Received: by 2002:a02:8629:0:0:0:0:0 with SMTP id e38csp4033235jai; Tue, 7 Sep 2021 01:45:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJycM2dCgZDMWDVDyJoa6xVzXC55KGpPCqYm8JTg79j0coBvRTQFXusF1F1noxMxPuEHkdHK X-Received: by 2002:aa7:dd93:: with SMTP id g19mr17445673edv.262.1631004310345; Tue, 07 Sep 2021 01:45:10 -0700 (PDT) Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id i25si9697360eds.119.2021.09.07.01.45.10; Tue, 07 Sep 2021 01:45:10 -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=q+eAYeVP; 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 1E6D941150; Tue, 7 Sep 2021 10:44:46 +0200 (CEST) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70089.outbound.protection.outlook.com [40.107.7.89]) by mails.dpdk.org (Postfix) with ESMTP id 0A1DC41150 for ; Tue, 7 Sep 2021 10:44:43 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=b4A9lNIds7hsS7HO7K1AVmQ4quSA7OdTERFW97TbNyMM8sL7hWFoTfF47PBy3IX3IQLt1tgUmdo+aaL0aH9vbG62YJ+iMFPT15w0t2xq2V0pInakKfdXN3WFoR3pgTrzN8OrWgIDbi5FHYQEyLTWyemE14/ipHcEBeuHjM4hfUjlHU1Bw6krz+6xsx1IFSgp3rX3PxIJBh4Q0gXU8v8PzbBCMdYnXm4h+WukyuXkq30BSKJw+/JurAa0zkU58H0oqfRW4Ba9YcAt4UtALnGt4fF1xEdH4Zdz8aOB4Qjv4We8ytyFpMxwyNUD+aGT6434tRNoKSeoeGmKOP/RJkbAdQ== 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=Yl1I/8ZX3chRpyMeMXT10jeAlhOt6BgA+SkvQ5QWsXA=; b=gLptQ9p+x+nVmdw1R9p0qkqGatwi8FvXobfDcDrYHbcZGnP6cMJpWk7OHqjBoMxl+n2vkm2Q2x9WQLz8dQVgXAKRIN9kCH+o5Zc1/FqeruUrcVzyEabf/O5AaA3X7EdFU6PWirGTak24T0bO+DWXh1ac0uqgV6JGS7pS5YeGWno3Uw1HcqdfkmodIJPHinnw1PRn43w4dTsRHKp3wceZNCkGYl1b6HyfpKPA/PKUBVGOsB3oIQsRfAsm6caE7tycctekHBKPmVnHdaziDy9kmCfksIpFFe06vSxZDV7bYZkmOyKKaMkEfBUbTLor/l5WkpTp4EQEqSbugZx3/roPMA== 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=Yl1I/8ZX3chRpyMeMXT10jeAlhOt6BgA+SkvQ5QWsXA=; b=q+eAYeVPMkfjpORORri/0VuAuTXThjIv76KlZAXHq+4fz+KwGe6iNgM4LBG5/NN4+ZfJVB541UUowcYOUCbFIt9N+1yUy87SnaLIpLWzCUIYJX6oUAm0jXlewiYhtia8zl0VcBGYXOrAaoMHA5j0eg4SaIo5cL5O5gIsGxsHKHQ= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=nxp.com; Received: from DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) by DU2PR04MB8949.eurprd04.prod.outlook.com (2603:10a6:10:2e0::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14; Tue, 7 Sep 2021 08:44:43 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::945d:e362:712d:1b80]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::945d:e362:712d:1b80%4]) with mapi id 15.20.4478.025; Tue, 7 Sep 2021 08:44:43 +0000 From: Hemant Agrawal To: dev@dpdk.org, gakhil@marvell.com Cc: Franck LENORMAND Date: Tue, 7 Sep 2021 14:09:50 +0530 Message-Id: <20210907083953.8948-7-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210907083953.8948-1-hemant.agrawal@nxp.com> References: <20210825081837.23830-1-hemant.agrawal@nxp.com> <20210907083953.8948-1-hemant.agrawal@nxp.com> X-ClientProxiedBy: SGBP274CA0024.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b0::36) To DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from dpdk-xeon.ap.freescale.net (92.120.0.67) by SGBP274CA0024.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b0::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.20 via Frontend Transport; Tue, 7 Sep 2021 08:44:41 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2d604fae-4594-4462-4dc0-08d971dbbcb8 X-MS-TrafficTypeDiagnostic: DU2PR04MB8949: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XuecXE1xjAvWfOAF3Hm5dnb4WrC3uY41tJd0MAEl72tgIaUnTsY+Z9cxGXFiLYvvyDR3yCsXRPMb4jh4WSRo6ziaw4iapHsgyYlHdAnh9762MCeZe5pYawmLFlIC/9JZ/m1EhVBtPs3RymGWNIlpL9c/5zuX9+m3wSRGFZi1Vouym4PEon7oym7JjWI/VVorXvKSlwEuqDegK5xb+6iE9kKjVdho4HzlEZL5LpZmq5H8/k1ht8aXUs3TaJwujijzed3ONeXZN3nItYEeaNDF85wdUUnyM3eiUC3jpMqXFco5TrPtS518B0Pjl++tlYCrHblZC4tKa4YtwWTgvgqu0rPz3Tnu3BzRSRQpkp5bFY+gAF5HgCpbUUo1ECeTheyo6/WgOGDs8hPOBQ7us6nF/mtU9bum4ifKr2heO57pUS+bfEYRarb2IiHwlEtVsI3WE/cdei2Fzvn6ntr2Zg0cMM5KE+47VVU4x0aVfB4HOknn9I61pXuH6Dkj0AQjde27A+Yp6SO81X44eyTAIAtRdPMV7zgwt3St5waNTDPnAEJOkUWfhZWfeWpBetVXTfuXUR7H2rO29YQD1QE82qCVSH8b8LVhcno3AWGufxjzb4OHN6a9PGFp9iX3IAuMf3NridgVRWiTcl+Mqch3u6srKsphC1EzmQGDdKsoOpEjO0+oCD9gIWQwaFn2tHlp+12KFDEBOenUpZMJbGqYi+QEeA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DU2PR04MB8630.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(366004)(136003)(376002)(346002)(39860400002)(86362001)(36756003)(38100700002)(38350700002)(316002)(44832011)(52116002)(6506007)(6512007)(186003)(2906002)(956004)(6666004)(5660300002)(8936002)(8676002)(6486002)(2616005)(26005)(1076003)(83380400001)(4326008)(66946007)(478600001)(66556008)(66476007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: rtx28NNxFBTfhDa0FIdL6+xAzphys0MZ2DoG4Hw86CXey2I0OPteLbhjN7aKPAmfOaXUXH6auM99F1Yk5BHBPYqt99mne2zUK1lFYZCgN1euMJ2aNIt0e9RrQn4HltX7yg9wvQPzCZ95tVrh0E4uEWJ3bY4/HHwtHgfbmKmoJINsOkp1Xk9HyM75JsmJkZrsf809J13uG99/yjFygwtSGSWf6fOde0HAI1/D9WWm5Gjg0RvTmdq9vmFtByp8NPnhkTQMOS+tXheBAKfTEnnE9ZfLaniZHPZVhGldUQ68r5kGoiwH8y/5EMI2JDX5JD7UGKQhRL0AAFyKx4mAlpQujqaiEo2ff8tVjVSVYK73j4qXTsZhjIw0iJ/lla/YQEtQNcsfqnHJqVDfNFVZnIaGZ2dhT+qn0y3+bxMAelTE/8StUX5PNfIP6xink7FWQf4IMQt8uPb1w8/wGuymkkqv7Ox+a/pnwrkD6BCC5lbvnCWQsj4d3l3kX4oh4biC2Le50214oqaPjHW1nb7Z3eIe4SQTRmyDBOC+gCpT9llghX56N14CYIMYm1iJND7rZFGEXAf8ntI9tsddOM+ZoVHs0rdz1qoREQrJ67ffXj5zpLM5PVLE4uejsonKL4CoRE/GV6fypdsPh5ADxEJDSkdXry4ONbRjuMERKpCA4Qoyc3dYFEwWEliMe73MFCk4UxzcZ+bwteqPPzBRdUEMxS8gPY6htAZBLNeJjK/nlPLPuFZKtBhL8MYxlrlDIJCP82d8cz+8J9PQyZQP+MT36DFlHQsOvOLoLf0bpbfAxMtES5ud13iNdO0eVLDNbbb6PItiVvvLwY9af5YF5RshpljsPfrjVB3hQheZoJaMedbY5U5t8ST1pjQR1GsyJNDaaATlRdtW1fPHULQZ6GZRvT5jVgrakoG3MO0kCk+gvln1uVWQVuFBQDG5bapXCjA4M0CJ3EdqsM7f6fWQQP981ltiiR+6qxd7mjw5Hypwfv6wXkChACJldVRRyc6c4x0EFGwNoGmcKt/1Dt6tHY1T7+U5aZ2ktoLss3LPe79b+PRfi/8MCS7LwmnwXVtEa2eSrc9fMLsYmhlyLk3xr0CnJYwBUEyaFQeYXpGl17bw58rmkNgD+REU3OanxSUWxpTuYKA+5sahmumpWDgUH+vFFg/on81L+kosIWmFhAT8xHFRJ4fdZ0aNAzC/g9V1fXjO4KEZdzOMvIMKjDeC96POm+35h8XY449e0goYUB8Js0uZxLAiAa2v6l3sMqmuEv/kdDQRhnYon57dk/1bmT7DJ4gI56bQjw0FBrYNdNKmsdl73kDl8nQmn4Ig6xjTxnsRGrc6 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2d604fae-4594-4462-4dc0-08d971dbbcb8 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Sep 2021 08:44:42.9310 (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: KmiGK3owuX3OdApn89W9gFQlRykw0vYoXlgOvPeckAq9DslH56D7iG/Jud89aAe5JVIWW/ZG/NljrYgOJHfKvQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8949 Subject: [dpdk-dev] [PATCH v3 07/10] common/dpaax: enhance caamflib with inline keys 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: Franck LENORMAND The space in descriptor buffer is scarce as it is limited to 64 words for platforms except ERA10 (which has 128). As the descriptors are processed with QI, it adds some words to the descriptor which is passed. Some descriptors used for SDAP were using too much words reaching the limit. This patch reduces the number of words used by removing the inlining of some keys (done for performance) in order to have working descriptors. Signed-off-by: Franck LENORMAND --- drivers/common/dpaax/caamflib/desc/sdap.h | 61 ++++++++++++++++++++- drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 28 ++++++++-- 2 files changed, 81 insertions(+), 8 deletions(-) -- 2.17.1 diff --git a/drivers/common/dpaax/caamflib/desc/sdap.h b/drivers/common/dpaax/caamflib/desc/sdap.h index d5d5850b4f..b2497a5424 100644 --- a/drivers/common/dpaax/caamflib/desc/sdap.h +++ b/drivers/common/dpaax/caamflib/desc/sdap.h @@ -20,6 +20,63 @@ #define SDAP_BITS_SIZE (SDAP_BYTE_SIZE * 8) #endif +/** + * rta_inline_pdcp_query() - Provide indications if a key can be passed as + * immediate data or shall be referenced in a + * shared descriptor. + * Return: 0 if data can be inlined or 1 if referenced. + */ +static inline int +rta_inline_pdcp_sdap_query(enum auth_type_pdcp auth_alg, + enum cipher_type_pdcp cipher_alg, + enum pdcp_sn_size sn_size, + int8_t hfn_ovd) +{ + int nb_key_to_inline = 0; + + if ((cipher_alg != PDCP_CIPHER_TYPE_NULL) && + (auth_alg != PDCP_AUTH_TYPE_NULL)) + return 2; + else + return 0; + + /** + * Shared Descriptors for some of the cases does not fit in the + * MAX_DESC_SIZE of the descriptor + * The cases which exceed are for RTA_SEC_ERA=8 and HFN override + * enabled and 12/18 bit uplane and either of following Algo combo. + * - AES-SNOW + * - AES-ZUC + * - SNOW-SNOW + * - SNOW-ZUC + * - ZUC-SNOW + * - ZUC-SNOW + * + * We cannot make inline for all cases, as this will impact performance + * due to extra memory accesses for the keys. + */ + + /* Inline only the cipher key */ + if ((rta_sec_era == RTA_SEC_ERA_8) && hfn_ovd && + ((sn_size == PDCP_SN_SIZE_12) || + (sn_size == PDCP_SN_SIZE_18)) && + (cipher_alg != PDCP_CIPHER_TYPE_NULL) && + ((auth_alg == PDCP_AUTH_TYPE_SNOW) || + (auth_alg == PDCP_AUTH_TYPE_ZUC))) { + + nb_key_to_inline++; + + /* Sub case where inlining another key is required */ + if ((cipher_alg == PDCP_CIPHER_TYPE_AES) && + (auth_alg == PDCP_AUTH_TYPE_SNOW)) + nb_key_to_inline++; + } + + /* Inline both keys */ + + return nb_key_to_inline; +} + static inline void key_loading_opti(struct program *p, struct alginfo *cipherdata, struct alginfo *authdata) @@ -788,8 +845,8 @@ pdcp_sdap_insert_cplane_null_op(struct program *p, unsigned char era_2_sw_hfn_ovrd, enum pdb_type_e pdb_type __maybe_unused) { - return pdcp_insert_cplane_int_only_op(p, swap, cipherdata, authdata, - dir, sn_size, era_2_sw_hfn_ovrd); + return pdcp_insert_cplane_null_op(p, swap, cipherdata, authdata, dir, + sn_size, era_2_sw_hfn_ovrd); } static inline int diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c index fe90d9d2d8..cca1963da9 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -3254,12 +3254,28 @@ dpaa2_sec_set_pdcp_session(struct rte_cryptodev *dev, goto out; } - if (rta_inline_pdcp_query(authdata.algtype, - cipherdata.algtype, - session->pdcp.sn_size, - session->pdcp.hfn_ovd)) { - cipherdata.key = DPAA2_VADDR_TO_IOVA(cipherdata.key); - cipherdata.key_type = RTA_DATA_PTR; + if (pdcp_xform->sdap_enabled) { + int nb_keys_to_inline = + rta_inline_pdcp_sdap_query(authdata.algtype, + cipherdata.algtype, + session->pdcp.sn_size, + session->pdcp.hfn_ovd); + if (nb_keys_to_inline >= 1) { + cipherdata.key = DPAA2_VADDR_TO_IOVA(cipherdata.key); + cipherdata.key_type = RTA_DATA_PTR; + } + if (nb_keys_to_inline >= 2) { + authdata.key = DPAA2_VADDR_TO_IOVA(authdata.key); + authdata.key_type = RTA_DATA_PTR; + } + } else { + if (rta_inline_pdcp_query(authdata.algtype, + cipherdata.algtype, + session->pdcp.sn_size, + session->pdcp.hfn_ovd)) { + cipherdata.key = DPAA2_VADDR_TO_IOVA(cipherdata.key); + cipherdata.key_type = RTA_DATA_PTR; + } } if (pdcp_xform->domain == RTE_SECURITY_PDCP_MODE_CONTROL) { From patchwork Tue Sep 7 08:39:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 507525 Delivered-To: patch@linaro.org Received: by 2002:a02:8629:0:0:0:0:0 with SMTP id e38csp4033303jai; Tue, 7 Sep 2021 01:45:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxUOBHdVrA+xwiX5e2SCXl7uaruLviIPTr4AYzEm3HtE5Xd6Ild9bSoruxjfm9x/2//CvJs X-Received: by 2002:a17:907:989c:: with SMTP id ja28mr14057251ejc.348.1631004317032; Tue, 07 Sep 2021 01:45:17 -0700 (PDT) Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id g3si10453336edp.507.2021.09.07.01.45.16; Tue, 07 Sep 2021 01:45:17 -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=T1QjHUtW; 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 94D7B4115B; Tue, 7 Sep 2021 10:44:47 +0200 (CEST) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70079.outbound.protection.outlook.com [40.107.7.79]) by mails.dpdk.org (Postfix) with ESMTP id E18C341124; Tue, 7 Sep 2021 10:44:45 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LdyrK6MJKGKCC3CTaHH1wnU+2ao8uJLiJQlxFxB4zmMZjZMlpxKHdHbhI8zQfwic40R56/WSPhoa5Tzfvxz37KHIMWenafq2JJSArVujaowJ9P07b0lj9KnzBp0ONl9U8NGB817lBGlMvxNQ0s4HiM/PQEuRmUjD0cl/4+4xcc+biQA5dqxwbhaz0Vh+Y6Er1O01AMpKFuYz9QEKnh6J7ACCNyOl9ZXdIRgILJw9QP6AZ3JiNxVSwFLIYdHDWJGZhzUZI5oVWYUvN5RuqgzRO5HLTFXMFJaBp9yk4/TKRnG7CVeN1gBS3DSZIKW7IpqGvXrxmXdJ73uDNtHfBaIvUA== 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=Dfwi0F0b/znP6RYWmOopmfjKTDxG/F0VJQzp5T3RuWo=; b=Xq8it9cTYRug7Gxlb4qfi7HiHrg9h/e/2Ullrk8z2cdVsLiNcdGxUh9WH1m1Dx3R1zPd//rSBEHTIbgUK3bVtuHgoNGgfm1YJ73g+8TfaxdaG173VC03Zm46GIIhEjEKcFTJCMLXivHhCraMxxXUo7CkcyBbjC4VRuq7BV1NWeuDZQu/0O9uEZzP+u3fJZfw1zXbesUzjR87YjKvOZkR/9ilh6CVTPu8dyNqeh9sXtR8eRPmD4MiTvAzoL84mNK9QnLcnboTdokZOgcpKFyMLs8pZPrEqhDlgPKbkAF8ELByuxLXf6xBjnxSv95yu5cCb5jCL889X1gS8Muh9jN+9Q== 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=Dfwi0F0b/znP6RYWmOopmfjKTDxG/F0VJQzp5T3RuWo=; b=T1QjHUtW0afH65PPYbkjP5t/1tP28W0NESzLc5Re/eFpjq5ieV+4e+pMwdwvf8TMLkkWClUzoRY6rW/Pxy8QOVQWWo7FLsAxbRzsq7YbLRMIOEiylLVnmjvP1MBVVDJYl7yhitVdnPc/VgLYQHqFzJxFka2rRekJECK23gm1Fhs= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=nxp.com; Received: from DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) by DU2PR04MB8949.eurprd04.prod.outlook.com (2603:10a6:10:2e0::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14; Tue, 7 Sep 2021 08:44:45 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::945d:e362:712d:1b80]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::945d:e362:712d:1b80%4]) with mapi id 15.20.4478.025; Tue, 7 Sep 2021 08:44:45 +0000 From: Hemant Agrawal To: dev@dpdk.org, gakhil@marvell.com Cc: Gagandeep Singh , stable@dpdk.org Date: Tue, 7 Sep 2021 14:09:51 +0530 Message-Id: <20210907083953.8948-8-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210907083953.8948-1-hemant.agrawal@nxp.com> References: <20210825081837.23830-1-hemant.agrawal@nxp.com> <20210907083953.8948-1-hemant.agrawal@nxp.com> X-ClientProxiedBy: SGBP274CA0024.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b0::36) To DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from dpdk-xeon.ap.freescale.net (92.120.0.67) by SGBP274CA0024.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b0::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.20 via Frontend Transport; Tue, 7 Sep 2021 08:44:43 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 309f1c85-c0ce-415c-ed96-08d971dbbde6 X-MS-TrafficTypeDiagnostic: DU2PR04MB8949: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:747; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RxJdDqybT/KPdQg4u+IP0wbgdGyLKs8/dZYyT6tgvJ+axb3zlUWeP/C59vmujHpUrVMTdDQyo5hlj4i0eG0xe7/BIlw04eLJmoa9IRoCUfg3NdWqiCWvyPxZ9+7zdTzsBDPg8/4955qSiGl36vOkm80+KgKiPzw3Zlt4M6gcEA80ZqwsIOmcG4Vid/Bw0JpvqAeTfkyn/ibimAosrBZvzI8/kYu7g/z5skOE+x9FFVmc8wuOnnzMKsWOmANR+6WrH2GlICIzMuA9+sIxulf7CXn6iJxh7QXHNcZ8qUyZFfPKIMMYHYmKoAHHPYxnTqb5GVWnbyyGrcdAKw/uNV0CDbMtqwD/hboLQ4nQNJ6xHP8dpdh7rnGB30HDIdq6P8ZrJ7iCNHa4pzq/BQTJl8Nh/f29OuSOIiKQ/uboovefXr+utk0Nr6MHXJeOSjiV1axAEP8UXZU35T7PotEeZSfttow3JLdv/6fXTLU8HnR7Ewqjtr4jStU77hEvuaJGu2m3RyUs+zoZD7nol6wgJW42KLTl8ZDFz/t/fcbVZkIU0UDy6LMx30c6ltYJsW5fHKc5lPXsuKMZ1eaBZVf5zN2DmuaUi2nlzuO03r1avmjmAizBeQ0c5eZ3DWHGFDR5SZwKMmhdAYzOcwA8Fo4s99yV68VUbpYs3aJk5JDF64vzC5b5VqUtWfkfb0mjMOx3W0u1TbJYpoAia0GWRr2ktQS88A== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DU2PR04MB8630.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(366004)(136003)(376002)(346002)(39860400002)(86362001)(36756003)(38100700002)(38350700002)(316002)(44832011)(52116002)(6506007)(6512007)(186003)(2906002)(956004)(6666004)(5660300002)(8936002)(8676002)(6486002)(2616005)(26005)(1076003)(83380400001)(4326008)(66946007)(478600001)(66556008)(66476007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: qjxw2y4jRuzSKYL9LuaZ4wmkqSqzCQy9n1/OnDbBwRClr1yMksiiX2+q1+sOQOcb5sKEtbIsbh9bHHg6A24zo9BqKBSSZ3kqHWZUsAU5qdIMQGeFXV06QEWi/w/uLWdArsTtF2Fgs8ivWUChyI1pprFxvx8tyIUqrPFaL3ET148UIEuT6RAnmS/+x/gr4DnvWJTG6HSFxa1oKtz6XFCVWej4PeE4s390BnqN6+EXyZuKpGQTujv66WTcQN5d70qUSdDw6LrL3//S6BZv/CTMPJSVblwwWYYA2qYK983XN3ddfk3vhoJBnLuSogNVyS2NSIgK5c6GVNH3xCn7sZA0SwwoDFYln7bDC5Nd5dlrcX/PG1ndlotZpqrRf8rGz+HiepbBeasoITENRxZzZC1SImukbKc0w4FkGbNO+ysMJCvMOahYLKM74yvnR6gCPVnwgoLSn+CJIGy14fIoJiw+oHG+MGeBaGB2RX4AHNds1VHNhTpBrbnTo6MBY5yffwRqBtBaqCiGvet11P+kJPGXtTP7qrz/oyQP7fioMDtdUn8RxeS8ZNSgYw51mBGtqrCvfVtlNG7h9mlRfmvP4pCqMYwRQzdjJoPr0/arXhhV0iY3B5A5USNwP5AMj0NIl1jLec2O4vQG7Kf4rBdLPrRkWjQAOyADd2eI0A9V0J3T1Do7MV9s0lON1VQuLi7IvnsbPBZYBPnvFpznIpjFvdecY1X+6IZstosFoYMVLblXB5HRlgnxDn3FF4DZ23DSto9Iy1gH+V4QIZ8JquOov9HYqz5M72SjF/PNEOGOyefXy3huqcSK038Q1j0kJ/3V6jtlE+BnGtINxDkhmLgkXcXBGAVauFwKbYiUZbiHrzVvKExd8zLUukIwmUvQYG6+Aa6EHua10CJ0tVcLS7ZOmqcVWPCA0YHu7KHWekQRD+jycn5hn95RqSwPl1m5rXJf9ZE+qQvDjr4ZyDK2oImW90DAey7WCOAB5v6EufIlMSpvD+69j+rf8fA2LRzdeoI1CI2aTPyr0ijdUl7J+uLy2uTOflYSJnZ+BoW7LwAdeodS4ZAy8AyiytQudBN016XYT/DMJwpTfcHpnxHzaQ8W6yCiFKCHN4wsnLq4d8MSVZXpbazlsHemU82ompVS5YKCGrqC9vtHYhKJhPdpGObhIaGHeEl+Ouj79VADzZACa8vybX15GzYaX/gG+b5HRaWq2JbnxR402tlqNmQ9HLiv089MgF4RzwCIkRVzQ+Q0suWpOQqESyiczL17vF0xu46iHf5HUCijO6ogAuxmeV88OW9XmWQ4YeoyE7uw8IVRwH4X20tDL8lystAM6o9ZoIMoh6Di X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 309f1c85-c0ce-415c-ed96-08d971dbbde6 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Sep 2021 08:44:45.1273 (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: KamTGxEBUu54bJlJTL/N2amIUIWbicpWh56uCIOAyq83mwxvQhspg2L3lSsaIM1dK3l0Qr3VizJ2I2oQ1DeFlA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8949 Subject: [dpdk-dev] [PATCH v3 08/10] common/dpaax: fix IV value for shortMAC-I for SNOW algo 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: Gagandeep Singh The logic was incorecly doing conditional swap. It need to be bit swap always. Fixes: 73a24060cd70 ("crypto/dpaa2_sec: add sample PDCP descriptor APIs") Cc: stable@dpdk.org Signed-off-by: Gagandeep Singh --- drivers/common/dpaax/caamflib/desc/pdcp.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) -- 2.17.1 diff --git a/drivers/common/dpaax/caamflib/desc/pdcp.h b/drivers/common/dpaax/caamflib/desc/pdcp.h index 5b3d846099..8e8daf5ba8 100644 --- a/drivers/common/dpaax/caamflib/desc/pdcp.h +++ b/drivers/common/dpaax/caamflib/desc/pdcp.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: BSD-3-Clause or GPL-2.0+ * Copyright 2008-2013 Freescale Semiconductor, Inc. - * Copyright 2019-2020 NXP + * Copyright 2019-2021 NXP */ #ifndef __DESC_PDCP_H__ @@ -3715,9 +3715,10 @@ cnstr_shdsc_pdcp_short_mac(uint32_t *descbuf, break; case PDCP_AUTH_TYPE_SNOW: + /* IV calculation based on 3GPP specs. 36331, section:5.3.7.4 */ iv[0] = 0xFFFFFFFF; - iv[1] = swap ? swab32(0x04000000) : 0x04000000; - iv[2] = swap ? swab32(0xF8000000) : 0xF8000000; + iv[1] = swab32(0x04000000); + iv[2] = swab32(0xF8000000); KEY(p, KEY2, authdata->key_enc_flags, authdata->key, authdata->keylen, INLINE_KEY(authdata)); From patchwork Tue Sep 7 08:39:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 507526 Delivered-To: patch@linaro.org Received: by 2002:a02:8629:0:0:0:0:0 with SMTP id e38csp4033344jai; Tue, 7 Sep 2021 01:45:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx6QB4o4MDB+8gtMLWuqh17IUpwevfrRezSKyoJeoo65Qo55ooixCeiXYQ9ujOef/1kA0Hz X-Received: by 2002:aa7:c782:: with SMTP id n2mr17418192eds.77.1631004322997; Tue, 07 Sep 2021 01:45:22 -0700 (PDT) Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id b6si1734594edu.126.2021.09.07.01.45.22; Tue, 07 Sep 2021 01:45:22 -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=qg1bjuv2; 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 D3AAB4115F; Tue, 7 Sep 2021 10:44:49 +0200 (CEST) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70088.outbound.protection.outlook.com [40.107.7.88]) by mails.dpdk.org (Postfix) with ESMTP id 3EAFA41154 for ; Tue, 7 Sep 2021 10:44:48 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OE3j0KE0FwOKCW4geNXlTLeThfQ2Io2/zQCIuEEerXBM0kl7vjPGna4Y9Z0eS1eJZLVtBn5S7GZxxybJqzAX9uvRnMqPOv1Ct351/C9aOMc0U06SJBFrcx2migp0WwwByR2yDvUlidNwGtZ/9bxsKadrTUh8Ig2cGB4sx2OUkMrnQyaESDWBPFCyvJmf+jIP++eXeKS40LDbh13NL0Q9UA3tFWui2vEBI1z4Xrn2VKQ6nzwvzEmG19zn4iZ11DEHZU0sNip+TUjGRtieNbYFsW7H8PVN4kHVgaz7CTJ4rmwE7jV4FPSWLMQ1KUYfBWbco8VHxNPfmm3slZGpTzZhgA== 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=l1n4SkC6Enuk4hzJj677WJbXyl8DMU5LkldOtaRyyg8=; b=J/vuxZ712qTaE0XIHqZNlA60x8axRu+p/SD2u7M5F/FOnz52KPd20O5nj+85PXZxR06EWYa1qpoyEa//b2/2TYYd/Cq0SBlAzVKcNwXgwwvhvyNlw7lC15u2/9knBEkGRhdTcUBhfis+mb7Oo9Qb//4twrUU7GCDenpcZRVe8HyAcd+Kg2rurHv2I2i4PsV8mRIKBUEq6dIMi/NHMXnKt/Bu+TIYLmFQrF2d1prsDdwi57NhE51VTm2cPbji9gPdZ84DNMltLz+Z4ysROW87jSADPqzsTzBEqN4mlbI+MGXmp/ZeCKlEu6rMIIS23r3jOxQPKQHOFt2N2yckf3xMrg== 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=l1n4SkC6Enuk4hzJj677WJbXyl8DMU5LkldOtaRyyg8=; b=qg1bjuv29Eau0EKspXUWLWZnuLOzhUNLuz3uxCyG57nTUUuc6vOuuk2gW2puFAImb9Ya9joF/Isb7JYNmrlLTBrtfZSNfqR0bKKZpBkgKpWdRivQ7NXR1NnvXGgy5aGXWcTPAfQPMuMJd2T+ofYq09nmT0L6GtZUtRRXmXY+3f4= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=nxp.com; Received: from DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) by DU2PR04MB8949.eurprd04.prod.outlook.com (2603:10a6:10:2e0::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14; Tue, 7 Sep 2021 08:44:47 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::945d:e362:712d:1b80]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::945d:e362:712d:1b80%4]) with mapi id 15.20.4478.025; Tue, 7 Sep 2021 08:44:47 +0000 From: Hemant Agrawal To: dev@dpdk.org, gakhil@marvell.com Cc: Gagandeep Singh , Franck LENORMAND Date: Tue, 7 Sep 2021 14:09:52 +0530 Message-Id: <20210907083953.8948-9-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210907083953.8948-1-hemant.agrawal@nxp.com> References: <20210825081837.23830-1-hemant.agrawal@nxp.com> <20210907083953.8948-1-hemant.agrawal@nxp.com> X-ClientProxiedBy: SGBP274CA0024.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b0::36) To DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from dpdk-xeon.ap.freescale.net (92.120.0.67) by SGBP274CA0024.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b0::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.20 via Frontend Transport; Tue, 7 Sep 2021 08:44:45 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c81f185b-2f6d-4369-474e-08d971dbbf37 X-MS-TrafficTypeDiagnostic: DU2PR04MB8949: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1360; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KfVh5l0gLYdrp0ncg6mfuPREbURofRYBR/11fCS9EtKscLoC+v/kJELj3ML1hLhqYMpzBSkBJy8VVGmWM2jW0dFxwMxPaCcnC27JSF2C0VAXOc9tBVYw27mIWts8PByav+ow+EZJwEyNjDh4jeD/alqzx9PCDS8eKnkfDG0Nyhf1DAf5ra//XJqAxczdqMVIzSvYM/qdz11LwULdkY5gthkddBriKU0axLKDR28zS2YTXeswnh4H7J4MfeLSkD0karSGPkH1qY+48Cw8+r1bXhu4rqoxHefE/sx2AxVg+KUHoUjzbWf36DFhndAPbMT+/8Tz/htKAU7jxnYJRvqHVpiMdsbCofLBQ4jRkxGuxZdd/yIY41QexCMOUbDgsb+3QUgDUIoGHLOflmoM5X7mW6sem5wNwgY3RCTdKd15lLh0XNm8zOQvmkR4TRlqTLERJYFptr0SBwTdnum2vuGkKyuqWMkbm+wVmiRfQvHvsEkndKNgGIMCvXJL4rfJ0SJliMHd/UCewC0Nc4zbb8ucpVVQpVv1dvCx4LoycLNCBwF1fGvbQ+OhIDN8SKakHYMtsbKbjH4wfWCE99UTXtYDz8IFGPgVs7eLHz7eO/JPFFaETwxg9VRskJO1qQLRy3InPLxwXZ9IOBUihUm2uZwWoIpc/WAZa50K9Jeb5OlgnXlO3EsWiOFD68c2uyysR9uJYiWzGzjxE2Y4UKAJcg9ydQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DU2PR04MB8630.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(366004)(136003)(376002)(346002)(39860400002)(86362001)(36756003)(38100700002)(38350700002)(316002)(44832011)(52116002)(6506007)(6512007)(186003)(2906002)(956004)(6666004)(5660300002)(8936002)(8676002)(6486002)(2616005)(26005)(1076003)(83380400001)(4326008)(66946007)(478600001)(66556008)(66476007)(54906003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: XLiRqS57LLpZoZ3sBvGrVPTNvNUAFbq3wgruH9WU74I6ZgfRYBxBZF4U6tCGTU1UPTpklwNtGjnwN11pNzPx/5WQ/O0ec6QMLC030TvPCwEXl8h+KKhdaxXs5/PL+TzS85zhXLqn6LWqQBnFXZyB3fvwHYtBe18ML1/X5WKFJHvnqD9U92oGP4JxD6yZk+6n7Zpw2ob1Nc95pWm9X0RiP15SZoBS4917s//cLmNZafaeeKHN+KcWDvFo5TXThNNyEd7FYGTfBy12r1gl2LR2RLFcrSUXbXnCLLa6nBuq6Rtyewi6GO2ebEqRBvrytFwDTpXzpcmMhwGiQWB2SJvJJa0fgLDwb9q69ROnGBtffUwkFMo9Wth7/20uthCWiYU78gzLinux9wAdpEM9vSiyupQRNMtEm1LN1uU6WL6siAGQeCLrHPksq/x6I5P8BlEqaAaSqyYkR9beOmkTW59Dpk12U4pGImppMh+c12EAdzBnkwVPi5jApICwsOzoMpp6SapOkTQPjIEnagCEj9lNnSRp8vJDpqQlN5VNiMNG4jEj+/yGHFwnLtRLBsEr6v5F7rCUF8HpDBP47bxXEwsYFtK6X5kF0PDgOnqQs4CV+7n4kvRto60/15TU4lQs+Q926zGrQoqlLmUAElxB1E2f8aQSjkzYAULkf5VzKpXHDSUUmbw4civedCToRitJfmmBKtbFWKk0zb16jKSqUPyxLYyAr+tnVzj3KxLd1vVEWAbH2eioV0pDwBnprdR5aoKQXdIH4fTSyYle0so8tRgFh2yH16rR9JCVnLMksWSCENnEDt2f+dM8i4OTLuSK2cRYDkWQ1u97R7EQxKA/tltrYNw1NoINRxGMWfy43j16VFyG/5UO6ZtT2lH0MSa4l5MlON/mdE+3lcXBztz4gcQDl+UWw4Cs0rjS1bXzOp5z7iDkWeky5egktlIL0Ye6/FmHHTFjYAf3CM2SLCoZ1pWaPR+ehA0o5x5FjR+Oqm4/ue4WpfyNTuHFFLBI2X17AaM7P9Vm/qLBFXRUB8DaNkyH080R7gNJseSyVKMWJcWCYqjpvY36/Mm+oJB/0U+zh8Dd0L1yUAYksTStj+HKjzrRAkiZG3MzksBhI2Buu4G7h9cuwEWw+9VuxCHJPfdTSReBI3bIbblbb7ajDrkbuQIcoHzDFPsjw6GPggEYbh/KDHsw9bGNDAtlzlLKN/TFlVNzxq3uQHsTF5KmqCkoBHGfvBZqHiIwFe66jChJPaCHHM4UoGYz/lrsmNscaiD8VEq7hYZ/sLz4Fz5XeY88WWNgxs73oIrBkAnFW5mWBmIVBqkBOgS7LU4CMNJ4ytpr4DTK X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c81f185b-2f6d-4369-474e-08d971dbbf37 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Sep 2021 08:44:47.1325 (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: +JNvVzXIpf89h/awix3awdWRBcIMWT89QlG0OTXA14p6R6aG2C/ZgyyyX48VvZ0J3MHh8RUyEzsJZ3Q0cGNuQw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8949 Subject: [dpdk-dev] [PATCH v3 09/10] crypto/dpaa_sec: force inline of the keys to save space 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: Gagandeep Singh This patch improve storage and performance by force inline of the keys. Signed-off-by: Franck LENORMAND Signed-off-by: Gagandeep Singh --- drivers/crypto/dpaa_sec/dpaa_sec.c | 35 ++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 9 deletions(-) -- 2.17.1 diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c index 7d3f971f3c..74f30bc5a4 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: BSD-3-Clause * * Copyright (c) 2016 Freescale Semiconductor, Inc. All rights reserved. - * Copyright 2017-2019 NXP + * Copyright 2017-2021 NXP * */ @@ -260,14 +260,31 @@ dpaa_sec_prep_pdcp_cdb(dpaa_sec_session *ses) p_authdata = &authdata; } - if (rta_inline_pdcp_query(authdata.algtype, - cipherdata.algtype, - ses->pdcp.sn_size, - ses->pdcp.hfn_ovd)) { - cipherdata.key = - (size_t)rte_dpaa_mem_vtop((void *) - (size_t)cipherdata.key); - cipherdata.key_type = RTA_DATA_PTR; + if (ses->pdcp.sdap_enabled) { + int nb_keys_to_inline = + rta_inline_pdcp_sdap_query(authdata.algtype, + cipherdata.algtype, + ses->pdcp.sn_size, + ses->pdcp.hfn_ovd); + if (nb_keys_to_inline >= 1) { + cipherdata.key = (size_t)rte_dpaa_mem_vtop((void *) + (size_t)cipherdata.key); + cipherdata.key_type = RTA_DATA_PTR; + } + if (nb_keys_to_inline >= 2) { + authdata.key = (size_t)rte_dpaa_mem_vtop((void *) + (size_t)authdata.key); + authdata.key_type = RTA_DATA_PTR; + } + } else { + if (rta_inline_pdcp_query(authdata.algtype, + cipherdata.algtype, + ses->pdcp.sn_size, + ses->pdcp.hfn_ovd)) { + cipherdata.key = (size_t)rte_dpaa_mem_vtop((void *) + (size_t)cipherdata.key); + cipherdata.key_type = RTA_DATA_PTR; + } } if (ses->pdcp.domain == RTE_SECURITY_PDCP_MODE_CONTROL) { From patchwork Tue Sep 7 08:39:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 507527 Delivered-To: patch@linaro.org Received: by 2002:a02:8629:0:0:0:0:0 with SMTP id e38csp4033369jai; Tue, 7 Sep 2021 01:45:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyoIIjU+KxX9SIFKpjWqQryR3ztpi2V2tKfIL7N1/e885UxysAYI+BYdFT3ICQ4Y+efJTHy X-Received: by 2002:a05:6402:3190:: with SMTP id di16mr17058716edb.211.1631004328163; Tue, 07 Sep 2021 01:45:28 -0700 (PDT) Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id gb42si5217258ejc.690.2021.09.07.01.45.27; Tue, 07 Sep 2021 01:45:28 -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=D+8RavFF; 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 F042441164; Tue, 7 Sep 2021 10:44:50 +0200 (CEST) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70089.outbound.protection.outlook.com [40.107.7.89]) by mails.dpdk.org (Postfix) with ESMTP id 80DAF41161 for ; Tue, 7 Sep 2021 10:44:49 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Uph0Z7moFhxRvm4QNL3tk0hS84WDaKuAkaXMdx8J22ZZIgv18fV3Dng3lkx9uI5LxGVhs/JCLOyoekEsMuGqY2a/y+RsbZLUN8qgKEmzaabisFuc4RhIALFRzWnl/lkvgLCqTvT9qjyqathTo1ruCCFb62I27KxiEPScaFB0gQY5Ige3VHqg4mFA3l5Dye9+q24EAhh0betjXpMhoShqCxSAmyKpO8DsVM84mKkqnkLQ8b/7m+MGNn+lEn4HtoYvbbbCHfY56AM5PcMRUNsim3hT+fSkWTlYznOozlFdr6efq8UucYB7/+OPqP/ELm2OzGXNzjkx2LID4a2Q1Dv5sQ== 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=dr1+IT7BnNXfAi7f1b4vo0ie3GIoLiNXJoLUDx+Mmio=; b=fWbg5aH08VDOrKnu1FYU2X7AIZCTS2Xhawiuf3Llo68qB4ZjSyh0zUWC8D7tq+OhBVK9/zzE9o0Cy6H3eq2j0y+ubX0TPUzUPDfydgv+ISaZQbCievpeAhq4+EUddXlLMVt3q+kwnxAznPsfyL9OC5A5SQB7zrjGRUppMHQLJD7mdZnS+SI24C49jXNTIm4LerPNX4MLAqfSObI9mb71KJtmkJ91VdkncfoGRdnamOSDDZ/2rAS4ixFdZpVg1ShsiTBD/BBb+oqly13n5veAAEzGHS7tBWqTPKVUgs/XP5RvfbOadcmb3G0BBw4apAhBpTevbZAus0kUJtuJHYeTTg== 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=dr1+IT7BnNXfAi7f1b4vo0ie3GIoLiNXJoLUDx+Mmio=; b=D+8RavFFVqWXgDErGJd1gypXaJFxfhRynLsfBB5VR98o+K3GHKLoKYUAQZ7yvFlimvxNGhOq1k3X7ahpt1pr9VWNFC89F5fHNFoFr0ZFc0Vut2crQttqFM8MsjwKdosTbKoEL0SKi01qFDzPsIdoZAeSt9A71EtgM5HQWGOCshk= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=nxp.com; Received: from DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) by DU2PR04MB8949.eurprd04.prod.outlook.com (2603:10a6:10:2e0::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14; Tue, 7 Sep 2021 08:44:48 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::945d:e362:712d:1b80]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::945d:e362:712d:1b80%4]) with mapi id 15.20.4478.025; Tue, 7 Sep 2021 08:44:48 +0000 From: Hemant Agrawal To: dev@dpdk.org, gakhil@marvell.com Date: Tue, 7 Sep 2021 14:09:53 +0530 Message-Id: <20210907083953.8948-10-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210907083953.8948-1-hemant.agrawal@nxp.com> References: <20210825081837.23830-1-hemant.agrawal@nxp.com> <20210907083953.8948-1-hemant.agrawal@nxp.com> X-ClientProxiedBy: SGBP274CA0024.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b0::36) To DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from dpdk-xeon.ap.freescale.net (92.120.0.67) by SGBP274CA0024.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b0::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.20 via Frontend Transport; Tue, 7 Sep 2021 08:44:47 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f667eae2-7dfb-40fb-42a4-08d971dbc01f X-MS-TrafficTypeDiagnostic: DU2PR04MB8949: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1360; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: sdOQwpFbe3s9X406h96N+v3jG0yJxq7th+I44GAQUcgi5KAPEwqWkgsptQilrPoslQ8mRb8/x6h87hHEsRn63jWUo+yTrT3squqTssC/aUkFjuYXvb5cgqJTzzfEjff04o51X7bMPkdjcZx7VbxMrqj3vvYKpsGgTW+niDVruZjSmAJ9MQ4avVcAYx9Ziis1Z+lMJu/8PThSwZ6R2m71oXEv/9s1aGyEOx1U6v2BiPolQ7XcKjEmujIGkH0vNoShXgpIKh9z0LkZPoUO8m4apXc/uEe9hC94Gj/Rtw5sRv9mskWHTCR0diLsyTtFJxlCRGej2t06eao6FG4PkDsYMaC723SwI8VU8bj/ldiksFV+pHJinhDrEhmzWU0WZL6AJH+MCyJTe5OMoAh9I8QTVR6rggHOjOkcKSbpcS+lmodDwGZGFjudM1hQmNyJOHnMhVVIvGL0+sVNVo/1tCJBasMLlq+UFfMLi+bMPK3KYprqnwBBn2YrNa0f9ff+u4uwaaNUAPGpbTqUuGJD3qUBWiSOG9rf+4XiTRFf5qn3VqHkq3xLhIVQBlEKEwC0PeWYYO5o58Ua+03D5nFYUvyRDOvb8uQFoBnLUOSw7Nh22hZA8o5Khb4HdW+NpkLS6YrYgDHQrq3gYRSW4GZ65WoZzqCbisDoL7eb6V3IHohr+2GxXLh0A+zLqsAp+sO5rrx7g/nttY+3F69FZ12PVienxw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DU2PR04MB8630.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(366004)(136003)(376002)(346002)(39860400002)(86362001)(36756003)(38100700002)(38350700002)(316002)(44832011)(52116002)(6506007)(6512007)(186003)(2906002)(956004)(6666004)(5660300002)(8936002)(8676002)(6486002)(2616005)(26005)(1076003)(83380400001)(66946007)(478600001)(66556008)(66476007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: vjgS2J78Oe0GudWoBLe3rWiWrabrXb8My3AaQsJFLKTJqiv2hNxom/czRWCHE7JMVQDXpRrXCzy6RG9+jYySqBIux2XMuAnz6fhHE+wrzdMXN8grxGxMi0hS6Y6LfTAkulPRNhpL7SqAIwZfg1I+gWtZjjZATkTxf4C1uO0G8mn3aQ4bREpxBg+XDqqRVT5bKFni190zllJ5UcLuTkon6t1qpiA6jKSBDEOOD4Kgt0GrwrsHTZShSsAWU5fupYAqk/2GheDGPd+GagaJ+/vynd9G1BJCqpZCJckru7oov1NX0yfzywt3/ik01mhkSMN0H8xyu3adBFC1Q4BrvkE9nhQ0yKk63Hu8GfvxGjBatwmsTWSA92OcKUlV6G09HR80kJc8kxOkee69f4G2twNcgBM0s4FHy59PAE5AiyVrfdg6mWewkiacp4Sc2b8hTGuyVAnhebp+RAQHaTxpfvpCrgFI7R0rn3/QEzPykBKe2cZ1ZC4GX0fH/sYEQl5GwwhF1emJZyx31XepM2vuDhhmWTNtg18HnthEjrk6vajr2P1V+ygC+hOMUvPx09MLvIbGTNFRi5tpKrXhSpFnhFUu+2NOQgORPOtxx1uAAZ32R8BPG+4cQdibHZtihWhHkxB3y5rYC69Y61ba8Dm2Npts+dfKNv8dND1AUK+8qW+UCEhqW5bTIiY1NSzH5IK5MwcinBvbttlopro8/kBH6F3GNYUbar9A6Sm8VGsMJFPOBIEY31zArIj5pMRYcc5IGVLX1cjugU8lDhO/UA4e1UsQxG61lWMJqhtPtkE22hLnIZINmA7zrBMlrMVAmBw/OtvAdDX2EJoXAqAurcqx823XjIqwtUig9a5XG/HiWXGl3Rsc3VlNazucYOAeXZj6ZgLTTQf1v33vCB62mDyqPkw4p3svNZA6lESnQXhQhQ1jAvMG/iwyag1EPQmkZpZ5nxLX6IB/yOWTiuA+nrm0uuaUmMAYz7Ju/isgj1A5fax1rjNvFlscEVlLAUSmAOzjyj8BSkK0zIMhDbIpSm0bkp2SOWxRdJjpuD/zcV0GlLeGDC9xg4WX7rJ7JP7qwG0nM8Sbd953SqDAlcWopaJ1GuQvhlTLI7rm0O/QwR4E2yMoG1+SCMQfdqmga5x8FKlLzxrlITnGKay8r/DJXbmaW1Bkqqc1SBTo4ZHj2zwyNgGKeJAdVz0f+mTyKV2OjBuhFhz0aZ9VhHkhGNzbTZqbro6Z3hM5e6iS5H5mSsKH7krkBDHsn7+FcevZlYvxbjKUJ14mDnL18dGxsKvhsYi4iXAJoZR5q+eHTG4Ts9ZdXZVOYpeItuqKKBIIlZ87zNACqAZr X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: f667eae2-7dfb-40fb-42a4-08d971dbc01f X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Sep 2021 08:44:48.7982 (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: 0uog7VMALm92bzB8XaaKwsAcj/8uQIsQmBPposI1Do6wLLjaSpYW6AjHt+nC1RNC8f5uCFbO9h6dQy1Ru3I4Zg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8949 Subject: [dpdk-dev] [PATCH v3 10/10] crypto/dpaa2_sec: add error packet counters 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" This patch add support to also counter err pkt counter per queue. This also enhances few related debug prints. Signed-off-by: Hemant Agrawal --- drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c index cca1963da9..c000da18dc 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -1702,8 +1702,9 @@ dpaa2_sec_dequeue_burst(void *qp, struct rte_crypto_op **ops, if (unlikely(fd->simple.frc)) { /* TODO Parse SEC errors */ - DPAA2_SEC_ERR("SEC returned Error - %x", + DPAA2_SEC_DP_ERR("SEC returned Error - %x\n", fd->simple.frc); + dpaa2_qp->rx_vq.err_pkts += 1; ops[num_rx]->status = RTE_CRYPTO_OP_STATUS_ERROR; } else { ops[num_rx]->status = RTE_CRYPTO_OP_STATUS_SUCCESS; @@ -1715,7 +1716,8 @@ dpaa2_sec_dequeue_burst(void *qp, struct rte_crypto_op **ops, dpaa2_qp->rx_vq.rx_pkts += num_rx; - DPAA2_SEC_DP_DEBUG("SEC Received %d Packets\n", num_rx); + DPAA2_SEC_DP_DEBUG("SEC RX pkts %d err pkts %" PRIu64 "\n", num_rx, + dpaa2_qp->rx_vq.err_pkts); /*Return the total number of packets received to DPAA2 app*/ return num_rx; }