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 3090CA0C55; Wed, 13 Oct 2021 21:06:48 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AD9E841272; Wed, 13 Oct 2021 21:05:37 +0200 (CEST) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80078.outbound.protection.outlook.com [40.107.8.78]) by mails.dpdk.org (Postfix) with ESMTP id 9385E412AD for ; Wed, 13 Oct 2021 21:05:34 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UniB2RjW54iD24fGY3JR8AXmnP7LpJThu339jRprlFbgwrAErVhFz6hX9nQVcaaHcYmIvijO0xwi+JPVHOw4MqtupCRMX0OnaRF1yJX5nf6SteJc8H9R8LgDjq1pgMoH4D0Yev5iiiSCzYfZhJg6ZbZq0J0ZxQkK5BE5LV/KVXiq1QSjM3KD1A2/jfWDtqAPIQG9kC3EFSx8KjVz6lQeKowGSmZcWCZwDggxfBPXanp8oJ0E/xYBOu8JRmdy4INJ+azqR2jHuu9PLghlN632iHaKxL4AXT9QtyjIK+U/4sBLjYFIAWbhwGg7vJ+jJIgwniBohdSDubwGMgEy/AeWXA== 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=SDs1/PN1gvNXipuI5xAEaI5JK8mNNOh+l2NcqmhQ1TF6cLVZe+OIgvmBge18o8OKWyWHHP0apWkcHuENNO0G9jaKVHWi2HFc5kmHEiUYTK+tFmGQu0Ldu7F8RkKmOkYWsPACtRhP4ax/CQGn5KTt7glbeH1yLzJgIHCCBINO47cuaixvJnKjlrV+IxpReFnxEqWzZ1NkR3l1b+aoQwUc9KT6EfCPXyXf/cl70lyRvadR8wV4V4dz/RnfGq/urhDzgzRGCgdvF7MskYJ+Otc4HYN6eD/ifETiB/zg7mtH1/H5Uz3YqbpgmY2lg8DhAKcQ9SNtPnjNqcVodLUAC44OoQ== 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=D5ca/FM0F201rghFLOAUKXfsRmoKPpUmpcBvTQhr03/M3kLx0vssF0Hp7+oSu9q0hT5/sWH1KZEZv0MvA3Jyv/tHuVLFtlRSFBuvzf969/YpLVy8lowQqyuMndeH3X+a+e1JbgWXHw+23MVnXDjhe0Y5u1F5POX+RqbxhzKQv2E= 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.4608.15; Wed, 13 Oct 2021 19:05: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%3]) with mapi id 15.20.4587.026; Wed, 13 Oct 2021 19:05:33 +0000 From: Hemant Agrawal To: dev@dpdk.org, gakhil@marvell.com Cc: konstantin.ananyev@intel.com, roy.fan.zhang@intel.com, Gagandeep Singh Date: Thu, 14 Oct 2021 00:30:32 +0530 Message-Id: <20211013190032.2308-16-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211013190032.2308-1-hemant.agrawal@nxp.com> References: <20210907075957.28848-1-hemant.agrawal@nxp.com> <20211013190032.2308-1-hemant.agrawal@nxp.com> Content-Type: text/plain X-ClientProxiedBy: SG2PR0302CA0011.apcprd03.prod.outlook.com (2603:1096:3:2::21) 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 SG2PR0302CA0011.apcprd03.prod.outlook.com (2603:1096:3:2::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.4 via Frontend Transport; Wed, 13 Oct 2021 19:05:31 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 97db0189-6070-45cf-1bc0-08d98e7c6ec2 X-MS-TrafficTypeDiagnostic: DU2PR04MB8949: 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: Yr2Zbqn5I0fQ6HQBg2/44h6MU8ufuw8+PTKN2K/wFFZWmLNOnESOQXKwreHHhAiLBYJbMnbe+fLDej86Bco4CKp/+ziO5W3PFscA1mm+PfmR1loe0KNXWUBxRG+zrwLYhvEbhikBRW/kNBLWtDYnCyptC3RzfVb1Gpu83QhyCLsAxebZUZw5Q8wJ9X5TiykzwCqVvFRs9TzEONtVqpvwcJXq7TZiA5BxJgvbO6TDCL5Et5A/igj7911DD6jmYEAE7LM85tvby0qR5rEAnqEsBtjBJHKdXOflYFv2K/6/bhc3lFAIyDyuQhs6g4oJF3DGMUOeNqtz7KZhD3bu6dw9sTohU/WjE3pP/87DtRD72UmxQfkH5iu5XkPKdKsctoPZaNcUSrPGKDlVpi711YwzfElc1eSaQu4k3SSuc1MNpElu2bCA46YgEKaWSjD0kauB5K3Wck503b1bYMRY3jpx38tTRIQmyfNuoyfOOFavKzwvrSvATqE06xigHBuG5lJnhI5cZfrG8e95oKzP4fJfFBWFiJ76T48+QYxLNjxkXLQy2vij4vuZf4sb4EhzWzGZwxGmbykDkTIaJqel5zod0xe0BQk72Gbc+6b7J5k+7el7wtUfepC/Ir6TVTbZYbJVuK6yS+NgwaT/gyNYaEPpxJv6A++XORIRAiHiplPntaLTJL9MstjHpRzdrWJdxLcCO+GbBlmXYcI9bAPMWpajbg== 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)(38350700002)(38100700002)(86362001)(316002)(186003)(8676002)(1076003)(26005)(6486002)(508600001)(36756003)(2616005)(956004)(83380400001)(5660300002)(6506007)(66946007)(4326008)(66476007)(6512007)(44832011)(8936002)(52116002)(66556008)(2906002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?D1OkJ5HkqWE3tyFAS5B1mBnRCtQwizTF2L1XJkxCvM3MgJ/yL6Pu5HjMkB/7?= =?us-ascii?Q?UAAk6Fl0MDwLsO/V4J4JXeFIKMgqhcxZSnNpVMGf8Yy8yvTaAiUz0kmn6ou6?= =?us-ascii?Q?C60nl2vYm7jkxKnDVwAgAhpZ/XtRfASjvWtASkeD10pLzuvkl1uzawdIEbBt?= =?us-ascii?Q?MCM5Nq0KLtYm+xF3TWH/sKsseyfx0oA82pS98zZKyEv10wEKLWUDj4QX7h9/?= =?us-ascii?Q?Eoi/TBVmD/j1yhyph1swQJ2oz9y7UJi8AmR2cvEmJmfKcqnKwB5/KfuB5pIx?= =?us-ascii?Q?tMb6LScqf4OESRvZPf9TMxYLMMlW27gI/5jqPpHhGniU+69x22r1ztZAcUG5?= =?us-ascii?Q?nXAy5mLkZ9txvAMlw2j7fJXRdWglgdeJeHKaJ4jYcVPHxigFtTp49AldVXji?= =?us-ascii?Q?DcrfVDi8xjh/NGBL5UAcSgZhj34eW0/ko/paST2Pk3oEezehI21n9h9vsNc9?= =?us-ascii?Q?jQT16oU538N3lO1zfxoVaDtzu8HWzm2d8b2feGXnsFLzPos8fP1Si+8JhmhC?= =?us-ascii?Q?Wi6/FPOnO7+kTkHFJaI+QrQnW8y6WgYKLgye+cG/FXLSQKI9D6ABcfleH0F5?= =?us-ascii?Q?mI+CCFgTAZtf3WSPLdSyffrzgC/4S4BW2CY9IjCkbNdSEl60J+rLPdkpkNyM?= =?us-ascii?Q?FncCQQuQVswiOfU9KubhfQrr/DALJKKtLWvr83PTC6XVVmjV+9ImFzhKUFvG?= =?us-ascii?Q?GcDbTfdj64ThFafPVJgSBvgwwcd608mLeE0+AEV6A5k7K0MddlN+8VB4y9Tq?= =?us-ascii?Q?e53DNV+wmHLDF9MFZAEqzuDBrM4shbOz/IJv5sFe0hg8PgDnQRDeGY2TSm/B?= =?us-ascii?Q?txzNk6NW4YiVJweWJPsX20XNMALJF2mGMcDoRgyz2H9hjO+/N3KhYhiayX3D?= =?us-ascii?Q?4yad2okKG5FSyLGfM2Yg3tQOO5fRaCdAB96nmPPihwfhiT1XzBJGJ4CQMRNh?= =?us-ascii?Q?G5AhggaEpH89tWcx5OeZWHt+ym83rO9gVgGxB3Lk5psPHWcgAOxihKukuc3y?= =?us-ascii?Q?u3HVf/YugZPA8hTc/t2FXUm15q+HvvhTqUa23ElbmzLeNKcpOPvqEw2fQCge?= =?us-ascii?Q?+0vxg+tz2edh6O46gtyOYMuadUSxodAck4So416fUSqXAWk2ZliuKzGLTss3?= =?us-ascii?Q?Uzti9Q2KRPXmYjEUoXIGJgVaI7sYjLNDq/sa/rcTRup1ys0prJMVnW34DIlu?= =?us-ascii?Q?Wv99woqoYGpPOiWHtPixKejAZ/IS9Bt9t1NH4R/UT36UrAmS0HO32N3DXcHg?= =?us-ascii?Q?WN7Bf87PstG9N9fb+kbGLZ1KWkBMWkKwk/WFxYUWJPhxA9n2SsZMOEB0itNB?= =?us-ascii?Q?dFGNJSP2LdSTni8A6jz5WdsM?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 97db0189-6070-45cf-1bc0-08d98e7c6ec2 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Oct 2021 19:05:33.7189 (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: jJjK92G3yeYsl3KyeSjBpvS9jzRxd1Pqv5JZ5HqQlDSWtX5+OQIjfJ9RhSRyI+R378bJqv60weu/bkO4l999wg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8949 Subject: [dpdk-dev] [PATCH v4 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