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 86D4EA0C41; Tue, 7 Sep 2021 10:05:54 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0516C41183; Tue, 7 Sep 2021 10:04:25 +0200 (CEST) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70057.outbound.protection.outlook.com [40.107.7.57]) by mails.dpdk.org (Postfix) with ESMTP id 4145A4117E for ; Tue, 7 Sep 2021 10:04:24 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i519eVhbQE+cV+tIDIBwi62vk0/Ujdt3gJoSXLTaXRa6m+z7HQy3s8M3ReLsnd0DhtZ4IyD3PRBEfRYR8bUmEusFi7RGV2n4HLJOLLsY3TPUgpRN+xGQdWlr+Zwmcgxj95SpjBdp6svu+gQ3Q6hoFab/oUFK+mUjuNWH+m4IK2BqW0bfR9D++ui/NYENqeP9sV3t8LcKzOo/Q9LJk8U/EiSBLATzw/q3AClGZ8XvC9EelxQguHPTKe0oks89rKWmotfxVJrw2K731olaFd2LCsvW8Qm7qDdZ7Syn8slvN39MtXxBW34uoXF6SkfITbu13MTbxezCVvau35Hkn3hmEw== 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=GrRFv6BeDEQhw8fLlNpaf/RkXhSzfTK4MIPX2fF7TY8=; b=jz3r4DvfaGr4zc0XELmzPlbrMXCduu7LysdzUtyiGHSjRZPFkWTxRZAUxjvKhJ8W/sz7BBqUaI7NC2VrBxA2yK9/skiebcYh6Vmbqx8JVBsTV+hN0zW5uDl+JcAH0Q67AjxJANdgpxCjgBxMkbTxTPMQGC/+SILvHySxzB+QBk44WZD1rCPGCj4SWYyjJgvqgWW0nRB4uxpUfesOk5la4RCMWoDX35ZtCaCffAKft3U5C5bICY+vFyoUIuBpVyjTDkDAlJ0ZtIN9DgEOXtIXnuPglTYNzhgSnmUDwEG0KWN0zKf43G3L7FrNitTTIgkG5JYOKbDsrMfu2zXhLdNAdw== 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=GrRFv6BeDEQhw8fLlNpaf/RkXhSzfTK4MIPX2fF7TY8=; b=HUwQsBov2/CEl1SasW01oVgkpS0PLGYYNIYDYlAkBlolec+pUgliDxrxY5cG08ZzV7eE9bXa8AJ7Wl3/mbDzfz1XBA0dBQjW6eq6mvCnPnmfr4l5fAfM9NaXA37nIFeM5EzS/xD2TCKBA/W7BO53yOEA1k3yrvrBsBv5+jolVj0= 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 DU2PR04MB8824.eurprd04.prod.outlook.com (2603:10a6:10:2e3::22) 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:04:22 +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:04:22 +0000 From: Hemant Agrawal To: dev@dpdk.org, gakhil@marvell.com Cc: konstantin.ananyev@intel.com, roy.fan.zhang@intel.com, Gagandeep Singh Date: Tue, 7 Sep 2021 13:29:57 +0530 Message-Id: <20210907075957.28848-16-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210907075957.28848-1-hemant.agrawal@nxp.com> References: <20210825071510.7913-1-hemant.agrawal@nxp.com> <20210907075957.28848-1-hemant.agrawal@nxp.com> Content-Type: text/plain X-ClientProxiedBy: SG2PR02CA0068.apcprd02.prod.outlook.com (2603:1096:4:54::32) 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 SG2PR02CA0068.apcprd02.prod.outlook.com (2603:1096:4:54::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.19 via Frontend Transport; Tue, 7 Sep 2021 08:04:20 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: efefd91d-ad5e-41db-0e70-08d971d61a1f X-MS-TrafficTypeDiagnostic: DU2PR04MB8824: 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: Y0tJ5HOoFpMkngFs0/5U7atFxmnnQTbA+xn/qbZPk6Zf6HGBOZeQOXl+c6GXb8ZJttzQriFGBIu1j7c16hyxWxd4/4WK5C94DrZtCVCwCoHiN6S9w2g8HIVzczbK5w1FxXR7FELuhEsSEsay/BrVjOioF14AyauftmJCo15zXUIOh9ar2tONt3pUc+8wLd1o7aVmX9OkhKPxU6iwN7WWkP0SqdJRnEwTF3Ssu3rmZhV05XB+f7PnqmwtuCrpuOKFF2MDH4k/pw5NUef9KzaVzlrphIPpkXJOGPTZOspFTzwVksLJEF1VLb+JWvI1AjeHF55nobsBPJHWa7umxFub7vRGAUIXb418A2qHRtOg8HSvk/7wiWvlZzcfQOLyqAkdHEozQLC02hCYKBTVn8leZNp4QHnS2jjaCDI6F0nHQZs8B9QcxOpN4Z4nCfjgkI0xshYUmzETvoxzBag9uZx2rDkjRwDqC7zdtDqQvn+s6VLP6MNXUPKNbjGL3DqZLNoSRroztgXMXfxY6M1hPhbxO/r0qt+n0tWLmR1OwyGGPZ/3hBWoCBiVuxNlKkgPJPCG2nHSHH/6ma9VHCYbtg+D8TfJ4i0UVP4q28GR+UShKJLc4UzKe2e8uAo8aY223bkXQt0xOa0agDW0YwQ/Ht20ayICfcUIFkUd5lIR88bIkhzQsyHfhHkfr5oYe63riBtnPE+RHWa/JCITMh/BFIljtQ== 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)(136003)(39860400002)(366004)(396003)(346002)(376002)(2906002)(956004)(2616005)(86362001)(83380400001)(478600001)(316002)(6512007)(4326008)(52116002)(1076003)(5660300002)(38100700002)(6666004)(38350700002)(36756003)(186003)(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: =?us-ascii?Q?GW9Lj0KIp7I5d2Ny/x3d4BzuqBs5W1DQIs/Miq37MyCJzvNEfbv9ohi212Wb?= =?us-ascii?Q?R42zpibW8RAMQOMPsA1uVVNDMcgRP/HTBi1MRwi/dxg14GZChXBnK0SqGQOH?= =?us-ascii?Q?EgOdPu97mIbaBJfyQrLqyhGMXUYgqjDYL25PXdTuIS/dqAQKdGx0vjAm2ydx?= =?us-ascii?Q?AGTiHjgC5C9iaozBluimKvgHem/tYjuLguIO8F5hp7eFrE0a8iOCBfpuNXXz?= =?us-ascii?Q?6cUtRsjgBQO6ol1r5w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BEMfZ1K?= =?us-ascii?Q?OA+V14L9LSKd2A9wjEuCQj+xFMF8ZcHp7LcDx+Fhe7yvjnDh3lla8+jY/U1O?= =?us-ascii?Q?ex08v0HmzI/B2Tdrwyvkh7ax0bY8XRr0anlmT/cveqdnuaNeqHQanexq5A2Q?= =?us-ascii?Q?pitBep/QTg44xvoFlym7otOMlfJJ8rEjRPFTqLt8Bq79Wv6fSfbxzcQv0OL2?= =?us-ascii?Q?3dSPX6M5jeYTE0zjBIhkDZZJ?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: efefd91d-ad5e-41db-0e70-08d971d61a1f 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:04:22.7248 (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: LrmejgaRpME9ZWSZBz/Ahq8GJBgAlk4bs0KDeLFzU55x1hVRXajr2ru6nWcQ9MtoCr2+YJUXTd6Tcjt2vcVbLQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8824 Subject: [dpdk-dev] [PATCH v2 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 de4fb0f3d1..0ee603b1b5 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 -- 2.17.1