From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5A3F3A0547; Sun, 17 Oct 2021 18:23:11 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 97C754116A; Sun, 17 Oct 2021 18:21:59 +0200 (CEST) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60089.outbound.protection.outlook.com [40.107.6.89]) by mails.dpdk.org (Postfix) with ESMTP id 7A2D5410F4 for ; Sun, 17 Oct 2021 18:21:57 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AvhlQtl47dDhq9Of2E0Pf8vM1Z45+QvzXe3oLNuFBzi6z3ICNLmHtgktWkb7+HRRBeFu67fW2XQ17edMJYXhfkSudywUCZLYDi5MJZL6kYymrE+Ufm5W+aeQnYG1XpckjU+4oxQ3sGXVr9HNkSS4mMiSWYF5amoEtro3KB/H/OKwEOFG3usWgni/S/Vi3/IbLajyF1cM564gN9Ro82dfcROAQboTtRmcz3XJjZpBy6SARKLskk9w4OuKdt0R8A2tkJA62vl1ro4XLXoBtvwPfzcAqbqnaYdZt3ufTxdQBUnxTLEHUchuyu+6qFPgP21wQgcorpwZm1Pj6/UAgzs4Tg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Bsb7RaSB12hNW/Nu1/Mp+ovEPD3tQ09Ew74CnTYOyz0=; b=MyB9YGsIOn/6SZALx+iwYBt2zSkbtUqP40PK4OVVJ+XXnZcarmcQevdRE3ulvnhUi7SH8MMkA0xzuz9KnaMcNmuUz/tasBkUj6R0Ur08qPopqgpUD7sg5N7i953R6naHTEimynnHPD45mTMWyDy3vEygUWco4o5XQU7csBl7z2p5MiEEqLvuML/zgxvZLf1FhWt/tnl4AKZ4XFlIGDuApkyHezl3p2QTOwdkgTd4G8ZN0ei8+gvSjpfGuBM5p39vzAsjGbhYpKEKlZaAbveMiqns+6WFVR7YsrmlbTF9YX8tLD5e+51KVr61UNiN1nH4Pah5+79DLzk3aKb0vPuHfQ== 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=Bsb7RaSB12hNW/Nu1/Mp+ovEPD3tQ09Ew74CnTYOyz0=; b=G9jACop6wjEFPvhVoVcPLBOElvrFfS2r1asFlju+mSoXVVScKHOzQxx3E8d5YZ73R9P3pkN1WTOGNvhnZ4tdMpJmtcQbq/cajot5KdUk0jEDHE8amvAJPTHAFpB3ymIjScF3UMIUM6Rw6DTq5ZwombdLZn5rqE/QrZuGxTWfvh4= 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 DU2PR04MB8615.eurprd04.prod.outlook.com (2603:10a6:10:2da::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.15; Sun, 17 Oct 2021 16:21:56 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::945d:e362:712d:1b80]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::945d:e362:712d:1b80%3]) with mapi id 15.20.4608.018; Sun, 17 Oct 2021 16:21:56 +0000 From: Hemant Agrawal To: dev@dpdk.org, gakhil@marvell.com Cc: konstantin.ananyev@intel.com, roy.fan.zhang@intel.com, Gagandeep Singh Date: Sun, 17 Oct 2021 21:46:51 +0530 Message-Id: <20211017161651.9220-16-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211017161651.9220-1-hemant.agrawal@nxp.com> References: <20211013190032.2308-1-hemant.agrawal@nxp.com> <20211017161651.9220-1-hemant.agrawal@nxp.com> Content-Type: text/plain X-ClientProxiedBy: SI2PR01CA0053.apcprd01.prod.exchangelabs.com (2603:1096:4:193::7) To DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) MIME-Version: 1.0 Received: from dpdk-xeon.ap.freescale.net (92.120.0.67) by SI2PR01CA0053.apcprd01.prod.exchangelabs.com (2603:1096:4:193::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.15 via Frontend Transport; Sun, 17 Oct 2021 16:21:54 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c213077b-2a87-4201-dbbd-08d9918a3d15 X-MS-TrafficTypeDiagnostic: DU2PR04MB8615: 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: oiiWQPS7kVAl2LHHhWQ1oXRvmMFq6VY/hlM+VDSn6u25QFlVtJ8ylocsoMqj7esYiEyoInKy+yPjSTndx58GATXn7sNYCzxg/EUzvrlkDBHI1jCohcKKiEH8ypbzAhA2v1Yu6fLvxI5JYYTqlqoC9J62GeyqirRxgUR7YV+g0GftqOk9SaVivvURAu9c/PB5EjEG5t0Wg7iBpf2BvNhgNW7sSdwdCI25n9LVLNjgbpv9TuB4iwxUYh/h+zBBlXiP2ydFN/ELa1y7vimeuxbszA3o1g8t/MStIBgF5pWZXK/zHBf+wOvjd4pnw2mtVarJPLPOGQJIdXVOExEE/LiKA0BvNDpG834beP3BVgBeV2UeP9eby33jn37sr2MrGJFTVMaegACK0ynmEMdzS5gnhSmX+yS1WOW2bdumy12fQS2Ogwey2jGhlwgTdIRiXAiSjUxHMtLOqfOlAu9OVKPCGTmVDV0m2qYsK6wPLFKgALt1WP4nuWbtK6tsdJmgrfyNkhMeU3SDkEuCENr5iMYsTfBu6kZTSgap4BeBalqpCpXvQHbAzzUBIrw5qT6FgwUchXhx2eEDl23faYQT3+tXxUD5233stnELYY5C+Q5RxZK5kwx08IDlsFxt0xc0E22Pl6I7BytMf1/4m7PFHDBV4aMmF42o8fAKLizGT2RQb6p9g6PSF7/Z12hgbw+FGkFH/n6lCFz6o3Jy3Rvial9UNw== 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)(366004)(6486002)(66476007)(8936002)(66556008)(66946007)(86362001)(52116002)(36756003)(5660300002)(38350700002)(8676002)(38100700002)(508600001)(6506007)(26005)(44832011)(4326008)(6512007)(2616005)(83380400001)(6666004)(1076003)(2906002)(316002)(186003)(956004); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?C2qZcBjbe38rt5BDlOuzlbh+glRIOEqtP3dQNwEvScYbL0w0Ej20Uelgiv1E?= =?us-ascii?Q?9YUQgJSX1W9yFA1/ZDtXF5KXepW7iJeOm5wmcko3vFOTEIyLEe4s1nonOINq?= =?us-ascii?Q?d2BW03v9ZdEzGE4hM1l4FWKq2+2ueIxl8FJNA6emexrVCEw9/127duN2yDHB?= =?us-ascii?Q?NgJDp1HcYtRvtmwi8Jo03BMsR55ChAONM0wNqBG25VggBm/hlnI6ZSDEgxpc?= =?us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5/0ocoxsOOXe45Apy6?= =?us-ascii?Q?k7IZRPGOD6pS5ENqYIn/VSl4b14556wK0MNQvYhFFGdyQQ0nTTcsfB8pIvll?= =?us-ascii?Q?O4Wc1jQB/WkJuoALWO+njnrZB9eDOwelWywwgpE+smG1HYovTaGzXBUliEcD?= =?us-ascii?Q?pJn4j0JWrVKJrTSrYAq1grmaXhWSBa1cHDhpb5avzjDRkQP12aJ/eLzQHoKh?= =?us-ascii?Q?OlTuW9zXuQTX6iOCT+RxPIix?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c213077b-2a87-4201-dbbd-08d9918a3d15 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Oct 2021 16:21:56.8282 (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: K5tLh0QSItakE7AoYNQbgtjZnOsUMEe6GK6rC4Je9F5ymYsVUTfQzv3iIyOAesZNfNbFATPeWqEoCdc25gz1jg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8615 Subject: [dpdk-dev] [PATCH v5 15/15] test/crypto: add 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(-) diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c index 73c64301f7..01af4cfbd2 100644 --- a/app/test/test_cryptodev.c +++ b/app/test/test_cryptodev.c @@ -379,6 +379,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; @@ -4210,6 +4211,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; @@ -4265,7 +4276,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"); @@ -4325,6 +4340,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, @@ -4359,7 +4380,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"); @@ -4486,7 +4511,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"); @@ -4617,7 +4646,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; @@ -4675,7 +4713,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; @@ -12997,10 +13039,13 @@ test_authentication_verify_fail_when_data_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 -- 2.17.1