From patchwork Thu Aug 12 07:12: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: 495970 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:396:0:0:0:0 with SMTP id y22csp84385jap; Thu, 12 Aug 2021 00:18:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwJ96nrxfdPtHNRjYfEG4s8jy0asCwwkU8hC0GkkdFOe3kxENpjTWBjxIPytJRG0RJGev0Z X-Received: by 2002:a50:ec0a:: with SMTP id g10mr3783250edr.125.1628752685948; Thu, 12 Aug 2021 00:18:05 -0700 (PDT) Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id 8si1817661ejx.341.2021.08.12.00.18.05; Thu, 12 Aug 2021 00:18: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=pEQJccR4; 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 B762941272; Thu, 12 Aug 2021 09:16:34 +0200 (CEST) Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20070.outbound.protection.outlook.com [40.107.2.70]) by mails.dpdk.org (Postfix) with ESMTP id 721444126A for ; Thu, 12 Aug 2021 09:16:33 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jAprVlF/DZyfSbj6T4vOleqePNpgGXYXnFNevqxgU1AkLssj2vg6uK0ql/tHJq1HXFmrHi7S5TIY/VSi9YV/vcylVlpKe4YLs4ByKdGLdWQwExu/WyHUuinOREHBoVBK4A0j8cD2In1y5RLGuodfOnzWkV7J0/lOFTEJR3M7Dy29avJ/Dz0pS9tBJHylp/oh6RwuF9K9dinyEWywaNa+pSxcIkuzm8ju5kDOTs+e4mkfe+86RMopWgEd+QXCq+Ol8S/+b41ihMIX5ruVNMcNZyEztA+/Rj9flny2T0gDQPsY4lpIsW/PANK4dWjez04NgmCIV8JmfXjM3tc+bYXQrQ== 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:X-MS-Exchange-SenderADCheck; bh=Ja32qw5ZGijgE/hddaC442uYcjv1gYi0TKk1x3fzxEA=; b=DCVVgi6Qe2Fp4Pcr6tyEiOs/VwbpfxhOubi6+TBYEJSdhq0jirtwEABW+EYQ3uQLMl9chNmj9BopsNs1y/LvpKJFdmPL6hRqWpgQcpfS6SHkMGG5Zz8xkild0Yq76oHbeJi60ik7cZhnJxi/0WyGb6E+i92JWzUJ8V/MtRIWlBC61lz8Na5TwfzCbLJmxNI7gVMGC77khV3P6Fy0+LPcK8rQ9L5kxe3vXTPImcmYxELyQj9ymHF2L371yuYGfOfodhsrJGS6mQVLQ+e7w7eMNzFslusyK+UcCfUQBmFLfkFQpEWsrcV8heb3vhBFigVEdDPu8XX8G0O2wjuque7+1w== 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=Ja32qw5ZGijgE/hddaC442uYcjv1gYi0TKk1x3fzxEA=; b=pEQJccR46Swv2qnSyOuiRBPP6QkQx4JS6VTOAiNHz3eAABMcQCvnoAMn/r7T14XRUng/oty1Qr8m7DTDJ4EDQ8+IUQ594+J+FQRs5fdrxujZYsLO7bP6nUziQs7FF6kPf7eV5CwrklxCse+3WndcIjfqDhZ3PvvBrBbwaDE8v2A= 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 DB9PR04MB8461.eurprd04.prod.outlook.com (2603:10a6:10:2bc::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.13; Thu, 12 Aug 2021 07:16:32 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::2590:514a:df1f:a793]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::2590:514a:df1f:a793%9]) with mapi id 15.20.4415.016; Thu, 12 Aug 2021 07:16:32 +0000 From: Hemant Agrawal To: dev@dpdk.org, gakhil@marvell.com Cc: Gagandeep Singh Date: Thu, 12 Aug 2021 12:42:44 +0530 Message-Id: <20210812071244.28799-17-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210812071244.28799-1-hemant.agrawal@nxp.com> References: <20210812071244.28799-1-hemant.agrawal@nxp.com> X-ClientProxiedBy: SG2PR02CA0105.apcprd02.prod.outlook.com (2603:1096:4:92::21) 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 SG2PR02CA0105.apcprd02.prod.outlook.com (2603:1096:4:92::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.14 via Frontend Transport; Thu, 12 Aug 2021 07:16:31 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f0f1ec0a-a633-4106-ddcd-08d95d611ccb X-MS-TrafficTypeDiagnostic: DB9PR04MB8461: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5516; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GIAYCxQ5XLInrA6Uc3Zr6cIaBpFsVX50E6nv1U/hSEEqf0wR9hkyszGppNlTVq+ZO7Heg8jx5wiPaE3ALBwShbPjpEzM4g5jhNZZw/xzV64z3iJukx/CpY6yncIbqPfykNvLwH/VdEyI/mcjM2Q9jkcZ9ClGb+eu+KlILItJWOLggk02FEuH/6xnjWUxD3PcwnnXIMiR0X7+HXJYtBKEVVRzPrPdDO1IZhGRfLWoe2NvUrTmT2+lfnKLWH1QI0M1tk8FxfHua9OcHbgykG9Odfmep2O2Tygfir3xvZtujtwF4ua67kxACY3tFcDPY+n/qz7/hOz1e5qAKKlC2hVfULDjLKDghtJfYPujxHe43lcEGk5e7/G3sDymzKKdTDmadZZUd6x2ctAReyEkS+zP3iQ4JfO37GEIXZ/TGcYSFDtZfRvu0iwVDljcr/kZxBHZDevzLjWi6d6wiSPyQlQ2TFvQG0zoP9Oq4wCh6sPku7NomHxa59+OG2sq6pjj7mfyOyu0mm08MZqrfGsqVvxOjKbhXW5Xt4gP7yh5qJyjchWmcmlyT2MNSrhiKADMxZJiiLqjCrosfANdn2RLSwsiJzdaeYRo9JmjIcQTt9q0vutf5eFLwf8VJatfByqPDJk6T/DSR3OABhRj3+LoBErGQGVc901MW5l+rzRzmfysgtk+ForPCV+GpgdRMc5to2xWJO3TsYuXRoNx0oM3qnFZTw== 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)(376002)(346002)(39860400002)(396003)(136003)(366004)(8936002)(956004)(6512007)(2616005)(2906002)(6666004)(36756003)(86362001)(4326008)(83380400001)(38350700002)(44832011)(478600001)(26005)(6506007)(66476007)(186003)(52116002)(5660300002)(1076003)(66556008)(6486002)(38100700002)(8676002)(66946007)(316002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: F6edhGcNhagRyXHKTy1M2dzflr8AAqgotoy5YmYI0hPeSyqdxgPVcoQQWGWSRAhLngHPmuaqE0xfZVXB3lpJOOiTVEeG4HOtY7zFJ+Q+xhslkR9YsFZ/4bL2oLbHdgoaGDKhDAJzJctrRcjvZU844ZNs5ZIrdWfEaQXBy8hrJfXNo9KdTPGEeXVKJgDnzhrkZQnWXsWy9TbqLdSuIUbxLPlaCUQdKmS5uXJEegvUhyqR+jvDbJtaLkApbBmFj6OzBG2mx1KErhbnBw07pxcSq7Q4ku29pJnHU7QDeBCr2FCuvT5MM9HbJKXGfAvkzNeMc4g87o2GLjR3JMmWgluh+Y0UEF4o6xUSHCppk29c5PNqJ+wIhRH4nmlueFKyNQ/Tu7tOqFJyQhI1yQZZGwnfplOxpJthaXGZlc3aGAOkeAwYPB4+w+JV2kUHnXLwC1PBM/o79TbD+2jA+sxqtAhgWVmq4yHgX5EgBnHv//SJU4PJxw7OJSyzDgFyN/giz2ELnutSI/js3cC1Ky9jnYlMD83yLcR/pFMVJSBHaoZ6UPzCjZ1Vdz1jRNIeB3Vq8+MjFNpWD8aTBYoe15i6pM6ugw/U97fUiLHqayYAmK47UBhe5bX3mnD35gYT5KNpCr5t3uQ41pd4vQsHyXSt5bBnGqB4T4aYP1IU6b+5aHhnkLzHz3GmzwpyokGrMpqJSAZrqRSP4AwpjT53fVXDWf/7/9NiSqKvEuSY9OSjLTPXfypDm+fhPzBkLRLmrMGC94oKD6R5MgywlcmvnQhirHvMuW9P/UzdAIAMqK6WPFjyiZOpanQDi5nmBXfe5/2FE4nfri6LlsUVOZuF8F7P5G9arww1UWBbDLFTf4b2Yz0rkBBCf6BOv6SwjNJo778wKXFp/kF2GEV5bnYBJ08UI6JUMJWyyqn7nWUrCEheJy8hzxd4/y9j60DyqI+N7qGvnPYRnWqWKlN0CJAZWTei9xEeHZmlFNfYGgBVHrGFdDVT8bk44cjuSxC2LWTskLDWBEvqMkVgsXbfDY4ubwIviXZOo4qYsjW50dLkOd6UTAk01wIUgRRUNmx7UNg2h9LDGWIaUyjo6Gns2VXJ01PyKEcQRp3bXPEbccVqRMHP/tmTlGkIQJqaBYRSPQH2+0tvPRo2sxBtLCOMWYTssnkb3OJINo1SSxU8cQXJHUb7nLCvhxA/1ad1p3zieg0zkUrykrpKeSrvYDkJ0yRDz9eLtUC17rNl3jm/a5E3MA9UJp4ITLbowhSd2+cMi17VLS7ody2ybrBlBc+Vur0Ki0bMkLPcrDVxeV3nRV9cxqQIVg/TvT4iMqGn+P09oPblcF64NKfP X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: f0f1ec0a-a633-4106-ddcd-08d95d611ccb X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Aug 2021 07:16:32.7771 (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: TfWdM2pD+HsvfoofvwneH/KflxhknODJG75idP0lR9fUx7HWd92bKN8a/X4Fr6Cl8X8f7h2Mg5shhLD+aC3+Aw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8461 Subject: [dpdk-dev] [RFC 16/16] test/crypto: enabling raw API support in 5G 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" This patch add support for RAW API testing with ZUC and SNOW test cases. Signed-off-by: Gagandeep Singh Signed-off-by: Hemant Agrawal --- app/test/test_cryptodev.c | 57 ++++++++++++++++++++++++++++++++++----- 1 file changed, 51 insertions(+), 6 deletions(-) -- 2.17.1 diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c index 59bed6e6d2..ab3394bb09 100644 --- a/app/test/test_cryptodev.c +++ b/app/test/test_cryptodev.c @@ -368,6 +368,7 @@ process_sym_raw_dp_op(uint8_t dev_id, uint16_t qp_id, } op->status = (count == MAX_RAW_DEQUEUE_COUNT + 1 || ret_op != op || + ret_op->status == RTE_CRYPTO_OP_STATUS_ERROR || n_success < 1) ? RTE_CRYPTO_OP_STATUS_ERROR : RTE_CRYPTO_OP_STATUS_SUCCESS; @@ -4152,6 +4153,16 @@ test_snow3g_encryption_oop(const struct snow3g_test_data *tdata) int retval; unsigned plaintext_pad_len; unsigned plaintext_len; + struct rte_cryptodev_info dev_info; + + rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info); + uint64_t feat_flags = dev_info.feature_flags; + + if ((global_api_test_type == CRYPTODEV_RAW_API_TEST) && + (!(feat_flags & RTE_CRYPTODEV_FF_SYM_RAW_DP))) { + printf("Device does not support RAW data-path APIs.\n"); + return -ENOTSUP; + } /* Verify the capabilities */ struct rte_cryptodev_sym_capability_idx cap_idx; @@ -4207,7 +4218,11 @@ test_snow3g_encryption_oop(const struct snow3g_test_data *tdata) if (retval < 0) return retval; - ut_params->op = process_crypto_request(ts_params->valid_devs[0], + if (global_api_test_type == CRYPTODEV_RAW_API_TEST) + process_sym_raw_dp_op(ts_params->valid_devs[0], 0, + ut_params->op, 1, 0, 1, tdata->cipher_iv.len); + else + ut_params->op = process_crypto_request(ts_params->valid_devs[0], ut_params->op); TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); @@ -4267,6 +4282,12 @@ test_snow3g_encryption_oop_sgl(const struct snow3g_test_data *tdata) return TEST_SKIPPED; } + if ((global_api_test_type == CRYPTODEV_RAW_API_TEST) && + (!(feat_flags & RTE_CRYPTODEV_FF_SYM_RAW_DP))) { + printf("Device does not support RAW data-path APIs.\n"); + return -ENOTSUP; + } + /* Create SNOW 3G session */ retval = create_wireless_algo_cipher_session(ts_params->valid_devs[0], RTE_CRYPTO_CIPHER_OP_ENCRYPT, @@ -4301,7 +4322,11 @@ test_snow3g_encryption_oop_sgl(const struct snow3g_test_data *tdata) if (retval < 0) return retval; - ut_params->op = process_crypto_request(ts_params->valid_devs[0], + if (global_api_test_type == CRYPTODEV_RAW_API_TEST) + process_sym_raw_dp_op(ts_params->valid_devs[0], 0, + ut_params->op, 1, 0, 1, tdata->cipher_iv.len); + else + ut_params->op = process_crypto_request(ts_params->valid_devs[0], ut_params->op); TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); @@ -4428,7 +4453,11 @@ test_snow3g_encryption_offset_oop(const struct snow3g_test_data *tdata) if (retval < 0) return retval; - ut_params->op = process_crypto_request(ts_params->valid_devs[0], + if (global_api_test_type == CRYPTODEV_RAW_API_TEST) + process_sym_raw_dp_op(ts_params->valid_devs[0], 0, + ut_params->op, 1, 0, 1, tdata->cipher_iv.len); + else + ut_params->op = process_crypto_request(ts_params->valid_devs[0], ut_params->op); TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); @@ -4559,7 +4588,16 @@ static int test_snow3g_decryption_oop(const struct snow3g_test_data *tdata) uint8_t *plaintext, *ciphertext; unsigned ciphertext_pad_len; unsigned ciphertext_len; + struct rte_cryptodev_info dev_info; + + rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info); + uint64_t feat_flags = dev_info.feature_flags; + if ((global_api_test_type == CRYPTODEV_RAW_API_TEST) && + (!(feat_flags & RTE_CRYPTODEV_FF_SYM_RAW_DP))) { + printf("Device does not support RAW data-path APIs.\n"); + return -ENOTSUP; + } /* Verify the capabilities */ struct rte_cryptodev_sym_capability_idx cap_idx; cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER; @@ -4617,7 +4655,11 @@ static int test_snow3g_decryption_oop(const struct snow3g_test_data *tdata) if (retval < 0) return retval; - ut_params->op = process_crypto_request(ts_params->valid_devs[0], + if (global_api_test_type == CRYPTODEV_RAW_API_TEST) + process_sym_raw_dp_op(ts_params->valid_devs[0], 0, + ut_params->op, 1, 0, 1, tdata->cipher_iv.len); + else + ut_params->op = process_crypto_request(ts_params->valid_devs[0], ut_params->op); TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); ut_params->obuf = ut_params->op->sym->m_dst; @@ -12653,10 +12695,13 @@ test_authenticated_decryption_fail_when_corruption( else { ut_params->op = process_crypto_request(ts_params->valid_devs[0], ut_params->op); - TEST_ASSERT_NULL(ut_params->op, "authentication not failed"); } + if (ut_params->op == NULL) + return 0; + else if (ut_params->op->status != RTE_CRYPTO_OP_STATUS_SUCCESS) + return 0; - return 0; + return -1; } static int