From patchwork Wed Aug 25 07:15:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 502246 Delivered-To: patch@linaro.org Received: by 2002:a02:6f15:0:0:0:0:0 with SMTP id x21csp346220jab; Wed, 25 Aug 2021 00:20:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxK4TbBYYgXKB5Vdupfa3SNg/0ksbplHeQ9A7OlOdI8KzxV/SylxH5eH+fLOOMaMwD8d9eK X-Received: by 2002:a17:906:840f:: with SMTP id n15mr3954588ejx.460.1629876026433; Wed, 25 Aug 2021 00:20:26 -0700 (PDT) Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id n26si19665134ejd.436.2021.08.25.00.20.26; Wed, 25 Aug 2021 00:20:26 -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=JZM196kA; 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 31A65411D4; Wed, 25 Aug 2021 09:19:25 +0200 (CEST) Received: from EUR03-VE1-obe.outbound.protection.outlook.com (unknown [40.107.5.74]) by mails.dpdk.org (Postfix) with ESMTP id 5EE764120F for ; Wed, 25 Aug 2021 09:19:20 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Qtpug9u1GQ27p2OnA8ejpSTscFpXVBx0q4G1J4gO7cTIrJ7n6+8Lz2GQaObRiYbLhsmNTkfQYkbaLp7YG/npJr2R/q87pbUyf4QDDR59KjzMprji6Px+w27clBLeMn9YLIltxY+Q62CdaeRTVQANCBakQrYLDc02q26a0pkdsNVIAKe8t2n61ldG/xseT6f0rVAnfd7GZoaG+dc3EFJ//gQFh7PyT3BXLpHWUBVAgRXquH52Z+SPQKjbuvURIeyEcIxBOjUnHKl0v5w9OUbuBHAI5GuHa5LRv6KVYUwXMiSIWHwpiGxcXNAHfhFFwkF3y6Dp8h1xHB3wrF0fLR7QVQ== 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=RuLcyTSPUZNMY2rFJofW3X4wUqiL6TG+sSjjCHJxxZu6PCmelahcvDZIHLRYThRT8JhzMhJqaRqAhEMKgNTjYu/4IiXml6pFbGfyfaT8dVi+5tdaJQO+UgHzY3539AStBN2RWueF1uIp/up+ZYX/p612Gt7sn7A69zmM9R3OLXmm2S9VwEAAlAAMM3p7mYgw3Z28naqzZ2hDR5ow0eHNzTc8YJ006I+iqvsC+qqXVWDj/2Ua3E+0qD672LUzab7ylNeaghxuzClRcdrYbZaT7tUyfLDaMh1ddbYj/hFYxMcOYHL40MQ8+/h5MslzLl7FbOqTYtnJexcZSKoPYAKNEg== 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=JZM196kADHJCQe+cegCNuqIxZU1wmsi8EugOFetl97hICWPuJbL0w/wh2oTS1BkTtFvUABpxNZ09ccDpj0k3LVSbALhsuUnBAtKSoXjz3CSoIpzWisulfScJ7ikD8kEbo66bvYy5TJFjq6uZa1SUAuPGHoxjj5PVnU6+j3HK5Nk= 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 DU2PR04MB8872.eurprd04.prod.outlook.com (2603:10a6:10:2e3::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19; Wed, 25 Aug 2021 07:19:19 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::2590:514a:df1f:a793]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::2590:514a:df1f:a793%8]) with mapi id 15.20.4436.025; Wed, 25 Aug 2021 07:19:19 +0000 From: Hemant Agrawal To: dev@dpdk.org, gakhil@marvell.com Cc: konstantin.ananyev@intel.com, roy.fan.zhang@intel.com, Gagandeep Singh Date: Wed, 25 Aug 2021 12:45:10 +0530 Message-Id: <20210825071510.7913-16-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210825071510.7913-1-hemant.agrawal@nxp.com> References: <20210812071244.28799-1-hemant.agrawal@nxp.com> <20210825071510.7913-1-hemant.agrawal@nxp.com> X-ClientProxiedBy: SG2PR01CA0126.apcprd01.prod.exchangelabs.com (2603:1096:4:40::30) 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 SG2PR01CA0126.apcprd01.prod.exchangelabs.com (2603:1096:4:40::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19 via Frontend Transport; Wed, 25 Aug 2021 07:19:17 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 40e9f647-239e-4988-f26e-08d96798a781 X-MS-TrafficTypeDiagnostic: DU2PR04MB8872: 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: 382/rVCyO6IJfFiiQI4TdiaTZ+0DC1bXKAii/2XcqCG5d1fApnqAhFhBxXSI5CWdFLmo6K7k4OLKSDo/U3ug3uSgguG1DqwkIvN7MH5uD8PvCNQVN8N7rUPbdNWq1kvTcM71hO7kHblvEVL8yUynmXOhywYRdrY/t/URdDNXsy/dtZmsUl3YqpX7i0b25a8PJi+fte77lNMXOZZeQ49/uIDp+kPkwxGouqPm3zVXcja0D+yBnI7bfk53KNyZOKlAoeM1d7BW6u/sbhRD2JD/PNjFpras96dB5QzzOibalVvyyfqOImknCG2IzZXsKCSm0c7SSewsiWoJZLFiRVVYc8i6s4Pjz9C6hg+pUbERRnzWSSOUBoVRM1GkGyRd7Bunm6ZMt1mOiXNyZTQXW64HVzD9lPwbXfs1MLDXuAEp52I6GJCVi0Qa4Fi+OU2aLh+5eMg8Lzc/qgMOr3BgqYAP2RPUr1ScwSu2VE3f4dyWywYXYFW8qAkFP0Xhyji24irteGuJo4/sN1T7Yge1TtIPqLneI9BQ6o3qlJ8uTmamiEfhWW21AVwZTskf3Pw4xRqzHuBPlHZnx1v/pDvG3jmGhJPz1vc/Jifb0WpoWSKY23ueBk3Is0Q+7Bmke6KFaFh5YJ3NjR2/4QC+IYuIDkhec5S5GUlTFhOUPdm9qUqMRQnLNJHf+4FsSxamndxyVicz+atfWtkUoH+m4s+aqGlusA== 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)(366004)(39860400002)(376002)(396003)(26005)(1076003)(478600001)(8936002)(38350700002)(38100700002)(5660300002)(316002)(8676002)(6666004)(2906002)(6486002)(956004)(83380400001)(186003)(52116002)(2616005)(86362001)(6512007)(4326008)(36756003)(6506007)(66946007)(44832011)(66476007)(66556008); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: L7fIaLwzY29SLj9A/TqkJoA4OtzOr5nEr47a55dgZwjdtzgAJRdGPUhXEPQhjU9eDFQBszb8hcVjt8BF5JIGwU6NII7Z0opeBVsDkXdfxpPJh4nIoW+lAxPzfUDTcJSOdGTGBK0dn17MD0DeCqWOUNWDcMXQABQZdVOaiwQYXUQ9cedJuFa9bgKNhOATnwyLYOT27z/wxUElZt/BPERLxAMAKWD7PPjfmCS9yM8JbuOlh5jOZkcNdf2D6Ok1sA38jh0JS9GgdLjGpvUkCE/ISi5sy6qc3MbMwEumtuD64MD8hIsbtyEgvEZBzu2IQtvxsK6FoHmkemYfUrWnH66GToT1Gl70pwx/MmaELN29bYn2cpzHbz4uaIOVrEmQ6ehZQttIQ0DQLRKk9wj0c+zApdg8yhFptfK0ClvThWUb9V0REdpEqInx3d2aUGtFj+ZLK9faxPbCamTa2clNM5FuaEWKAD30zAcivEEJ26JxOcxVwR6zdXCjRVXkCb+P4J+sWb0nWNNaIYFNzSUEgsn5C5Ju08f/V83tMM/7E2OsOPi1mE8sHYEB7ztpoRq/8zKJMXHKtyvrp2CgaFfn3GnREDC+52Lstzf6Ljm6AdAZylv8wgmBDlSdqgMeYtAcZ0UcK7kAmWxEzzXwJNZJE1EAYtkduQiEYn5kfcZWZw0xPk+IcmFFQVE32z24A00F/OstDVlIuJyZGYxkgMNVTVVD/up3PtdrXUeFuuEsAUzDdMpRoO8tiE5nb3645ZIS520qaBM8VxdDoEtI53AdRAgeVsjiGZH4T6BLY4XX1rMx62W6YtkIxPm/Zr7lx20cr96lIk9cH81RVwkjpyG6N4ADLV9cxREiOOoDfHrptTrEoz+/tyJbwHfCjHM3kcu4o5vFwm9PdrH5bPkiB9kAqZJhsAtG62f8oY2SjHnaa24x0N+SGsRwHnQPImhhNHEksX9Pzb3dw2Y92EsgPMZBLoam83jMBJL4cA9tlhEkQC48Jb9zIvM/poFDW6Tqf2koHu9CfqQ8yiHhmW4n/HS+omeKgWBqaTDm21u39WNp8jwa6APAvQPh2GljLUKHeTzCQPfTt9DZZb5FndFIwk+1O7uT5A08+GdTA1RCk4FBSTYDqa1NLxMKe2UTMN2rlUGUpXEcscwkgPCOZrsqvQNwrkkt89FTJFYrDB+AkN5f77pkdoM9lmpdyA6mciq2KarR1N54WJfvja5/T/Rpdr+ZSJEacsadan6c/8zu8hLDQKEfBhpsywXpiGufnEp6j53GzJhbvVIc4djN7lFdCxe2wBWhuCD7ZMo8yORDMGRTGY+wKvv85YxixNwWK6y4rUJTzq/a X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 40e9f647-239e-4988-f26e-08d96798a781 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2021 07:19:19.4508 (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: mgg1ru8xRSJ20YBLnVNZl6PGHRvtxUMQZroks6r+7vppz67p67uRYAagsaI3PGL8oZSbcRg/yciKpZtJNPDWbw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8872 Subject: [dpdk-dev] [PATCH 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(-) -- 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