From patchwork Tue Mar 19 11:46:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suanming Mou X-Patchwork-Id: 138482 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7D83D43CFA; Tue, 19 Mar 2024 12:47:03 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0590E402D1; Tue, 19 Mar 2024 12:47:03 +0100 (CET) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2062.outbound.protection.outlook.com [40.107.220.62]) by mails.dpdk.org (Postfix) with ESMTP id E4E4440298 for ; Tue, 19 Mar 2024 12:47:00 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kj2L+YEs9fDzNjZuqeNPku608ggSmU2s5Ts2glPcTHv0m6gkMSKtweC1nyEfBGoRnUYpsDq80xRZkZNPlVzFBmDtnzctGYGG8JrW7fpIP4/Z73iEphoM7plP+Jw4lZWzA8VKTUutNTer3lr74BFO88S6ekBPjj1GBM2LWaf0hmqxuidW3Yy2i4Be04uMQPVkyaKF72MxGwTY7uWDVI95fJewFJGHay7sMHyxcIjAvvOp51Ok34N7gG32HBUXzQ3qlllVG6LSt0FVzC++d6+BA+q7J9UenJ9kHWzmmkntfopfdk5KfjCT3/ePNkw1GjT1cynKHXYJeih56i004lBaFg== 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=yMy5RtL/ZFh92MFniXm25Bn9ck8JEpl4yB2cbirJDaU=; b=BpARffP9GbRwlsicGVCGq1fIW2HwWoMVuNIeFiaw3Wbzf6bBAQuNbN/7bsdW3kJLrL/UYj+MfBgXj7L9DlHRopvwG3vix6weOlD4PMiS9P9X8J53K/zJ0sW5GolXw+fSNSR/W0VcPOAMmdA28FL/dDCeteqiQOtmzuh6zy4SDUA+d5EK7bWMQzfSZL+OtgEcj4jWI1hIZlw2KAStk92WA02MJdxNqNVeaWlJYXo6/U/SDuSA7nKhM48c92B5NkYpyVkrHkehFp0ipo489Ozy1k2PLToa2ImQXOlHYgOuLzMd+BWyXDtQe86DVMEiZ8Q72//NLKM4/MCt4SgacqLjeA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=marvell.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yMy5RtL/ZFh92MFniXm25Bn9ck8JEpl4yB2cbirJDaU=; b=OZvwKAXxBhcCLxNodPGpB4MiWSZLgre3PrxHUByxC2Fv2kPKPYdLy1GQC6eS8KeTkrF6SAhokm/WCCYJCScJdV+gKGxICKw8iHlNme0GCuzHXmvbAi8BIuBLmHP3sIN1KqAcI6VvjaZOJCmE5b1E7FkMjPso8GOK5wNY2MyLy7JEReH1x0Bso/gAUK6WhOJg/yO4cwXARd55FWgDl2pShuELGAYTAt+Ux47Z014xdSYlGTg+QhKaLPDry98aa96aL+2Ch5qX+AHMSf6mty/lkoyOwXbwxVZQeXkelHaCsgEyX3pnRXtQWOkrpbFsUtLtnGo1AC6vPUMz4riazimGPg== Received: from BN9PR03CA0113.namprd03.prod.outlook.com (2603:10b6:408:fd::28) by BY5PR12MB4324.namprd12.prod.outlook.com (2603:10b6:a03:209::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.28; Tue, 19 Mar 2024 11:46:57 +0000 Received: from BN3PEPF0000B36F.namprd21.prod.outlook.com (2603:10b6:408:fd:cafe::31) by BN9PR03CA0113.outlook.office365.com (2603:10b6:408:fd::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.36 via Frontend Transport; Tue, 19 Mar 2024 11:46:57 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by BN3PEPF0000B36F.mail.protection.outlook.com (10.167.243.166) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7430.0 via Frontend Transport; Tue, 19 Mar 2024 11:46:56 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Tue, 19 Mar 2024 04:46:40 -0700 Received: from nvidia.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.12; Tue, 19 Mar 2024 04:46:38 -0700 From: Suanming Mou To: , Ciara Power CC: Subject: [PATCH v2] app/test-crypto-perf: add throughput OOP decryption Date: Tue, 19 Mar 2024 19:46:23 +0800 Message-ID: <20240319114623.1137757-1-suanmingm@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240105100104.908543-1-suanmingm@nvidia.com> References: <20240105100104.908543-1-suanmingm@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN3PEPF0000B36F:EE_|BY5PR12MB4324:EE_ X-MS-Office365-Filtering-Correlation-Id: 4131c2f8-5fdc-4412-1c5b-08dc480a47ce X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZQB7yzHZe8vHyAAFu3w3QkBTTboM3mJQJAQ+ut2Qj9sTTf6rddr2yLg9mrTMeqLOLYEDzSC5Gh24aP/5rLXFjJ8TOYvfrfHD0vjFoRYh7qGSE9I9quQv7bLS2qJ/mtFCQy17TqoLAqormRT2UOMLJo0hZCVjwPiyyp8Vg1LgBPZ6eM1onTbRrllvC1C78SyRtn6orAdigEn7A+t3RA/hKBCINfO1eSOBWw/0vSoYPl/OYpr1D7KRFrjNGgEf2NuKuoHFf/+RK2A4aDva224cQdKHxZPy+Bnd4DiB9EzfhCtepWS+6ZxM4HM5ufvxr8beVIV8CdtROK1QAuDiFzcPB8uEAk3yubnaqrZO5iV2i61UAPIKruMLZLw4fwmZlKPlgcmszAIkYXBWvFlSX44FEX0EUaRavQ+YPA49ROAE8DtGDLXNa0G/sDJAY1fbJzauzo1EJ0frQOjyrKS7L0YfXTHBh+JVwDkGZSIX8X6bPwG2j/EsjMb5XJXqjmdgGZNnFmGsPP0KVRcCWMBe5+F8kt3vzRbb/Lndl3klVPjeqfSyq+edytARiPp4YoxGAlr4asRuP2xP00Ijijv4lDkvuVXptOf+nOWn3/oj1QiJaC/26HUpXjphEfoF9jrf94zUuTpStJ87UgyoJtkfZBJF/NLIr63n+EFm2NU+ZhMRauKhg/4ohkt+o7Thie55IdZkls8gqeUkTcQn2uIWXnFgx53QnxAFB/2t7HztzDLkAHOVyL3lBcSD5xWjz351uojd X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230031)(1800799015)(82310400014)(36860700004)(376005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2024 11:46:56.9299 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4131c2f8-5fdc-4412-1c5b-08dc480a47ce X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN3PEPF0000B36F.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4324 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 During throughput running, re-filling the test data will impact the performance test result. So for now, to run decrypt throughput testing is not supported since the test data is not filled. But if user requires OOP(out-of-place) mode, the test data from source mbuf will never be modified, and if the test data can be prepared out of the running loop, the decryption test should be fine. This commit adds the support of out-of-place decryption testing for throughput. [1]: http://mails.dpdk.org/archives/dev/2023-July/273328.html Signed-off-by: Suanming Mou --- app/test-crypto-perf/cperf_ops.c | 5 ++- app/test-crypto-perf/cperf_options_parsing.c | 8 +++++ app/test-crypto-perf/cperf_test_throughput.c | 34 +++++++++++++++++--- 3 files changed, 41 insertions(+), 6 deletions(-) diff --git a/app/test-crypto-perf/cperf_ops.c b/app/test-crypto-perf/cperf_ops.c index d3fd115bc0..714616c697 100644 --- a/app/test-crypto-perf/cperf_ops.c +++ b/app/test-crypto-perf/cperf_ops.c @@ -644,7 +644,10 @@ cperf_set_ops_aead(struct rte_crypto_op **ops, } if ((options->test == CPERF_TEST_TYPE_VERIFY) || - (options->test == CPERF_TEST_TYPE_LATENCY)) { + (options->test == CPERF_TEST_TYPE_LATENCY) || + (options->test == CPERF_TEST_TYPE_THROUGHPUT && + (options->aead_op == RTE_CRYPTO_AEAD_OP_DECRYPT || + options->cipher_op == RTE_CRYPTO_CIPHER_OP_DECRYPT))) { for (i = 0; i < nb_ops; i++) { uint8_t *iv_ptr = rte_crypto_op_ctod_offset(ops[i], uint8_t *, iv_offset); diff --git a/app/test-crypto-perf/cperf_options_parsing.c b/app/test-crypto-perf/cperf_options_parsing.c index 8c20974273..90526e676f 100644 --- a/app/test-crypto-perf/cperf_options_parsing.c +++ b/app/test-crypto-perf/cperf_options_parsing.c @@ -1341,6 +1341,14 @@ cperf_options_check(struct cperf_options *options) } } + if (options->test == CPERF_TEST_TYPE_THROUGHPUT && + (options->aead_op == RTE_CRYPTO_AEAD_OP_DECRYPT || + options->auth_op == RTE_CRYPTO_AUTH_OP_VERIFY) && + !options->out_of_place) { + RTE_LOG(ERR, USER1, "Only out-of-place is allowed in throughput decryption.\n"); + return -EINVAL; + } + if (options->op_type == CPERF_CIPHER_ONLY || options->op_type == CPERF_CIPHER_THEN_AUTH || options->op_type == CPERF_AUTH_THEN_CIPHER) { diff --git a/app/test-crypto-perf/cperf_test_throughput.c b/app/test-crypto-perf/cperf_test_throughput.c index e3d266d7a4..b347baa913 100644 --- a/app/test-crypto-perf/cperf_test_throughput.c +++ b/app/test-crypto-perf/cperf_test_throughput.c @@ -99,6 +99,26 @@ cperf_throughput_test_constructor(struct rte_mempool *sess_mp, return NULL; } +static void +cperf_verify_init_ops(struct rte_mempool *mp __rte_unused, + void *opaque_arg, + void *obj, + __rte_unused unsigned int i) +{ + uint16_t iv_offset = sizeof(struct rte_crypto_op) + + sizeof(struct rte_crypto_sym_op); + uint32_t imix_idx = 0; + struct cperf_throughput_ctx *ctx = opaque_arg; + struct rte_crypto_op *op = obj; + + (ctx->populate_ops)(&op, ctx->src_buf_offset, + ctx->dst_buf_offset, + 1, ctx->sess, ctx->options, + ctx->test_vector, iv_offset, &imix_idx, NULL); + + cperf_mbuf_set(op->sym->m_src, ctx->options, ctx->test_vector); +} + int cperf_throughput_test_runner(void *test_ctx) { @@ -144,6 +164,9 @@ cperf_throughput_test_runner(void *test_ctx) uint16_t iv_offset = sizeof(struct rte_crypto_op) + sizeof(struct rte_crypto_sym_op); + if (ctx->options->out_of_place) + rte_mempool_obj_iter(ctx->pool, cperf_verify_init_ops, (void *)ctx); + while (test_burst_size <= ctx->options->max_burst_size) { uint64_t ops_enqd = 0, ops_enqd_total = 0, ops_enqd_failed = 0; uint64_t ops_deqd = 0, ops_deqd_total = 0, ops_deqd_failed = 0; @@ -176,11 +199,12 @@ cperf_throughput_test_runner(void *test_ctx) } /* Setup crypto op, attach mbuf etc */ - (ctx->populate_ops)(ops, ctx->src_buf_offset, - ctx->dst_buf_offset, - ops_needed, ctx->sess, - ctx->options, ctx->test_vector, - iv_offset, &imix_idx, &tsc_start); + if (!ctx->options->out_of_place) + (ctx->populate_ops)(ops, ctx->src_buf_offset, + ctx->dst_buf_offset, + ops_needed, ctx->sess, + ctx->options, ctx->test_vector, + iv_offset, &imix_idx, &tsc_start); /** * When ops_needed is smaller than ops_enqd, the