From patchwork Wed Jul 31 11:54:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akhil Goyal X-Patchwork-Id: 142788 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 192B545701; Wed, 31 Jul 2024 14:03:26 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 039FA40A87; Wed, 31 Jul 2024 14:03:26 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 9C65A40696 for ; Wed, 31 Jul 2024 13:55:02 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 46V3DQMW001745; Wed, 31 Jul 2024 04:54:56 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= cc:content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to; s=pfpt0220; bh=xFBrrxUdLq+InpFcgM4e4Gt Fag9MOGk0XJdOAN/Hq30=; b=JxfcsSmiRXs/mDc6nHZpLR9L4Waz+qpRmoj3Y1R 6xlw7mjeq89sHEVbVlwUq5BgOFOVYfUEBgoNhzJ0oUCX6OxSxeSze6AfWekpeKfN F7Vn3WBh7pskHaHyP8UeUvTucEx2TO8V10/iKXohXXuQYZ2YQ/LHsHacbXn6q2hu HtFaFw9r6B453bAWzkXDVjETEyT/pkPp6oY5q3sJvlm53kfColCSNq7gPMwj22fe mNUhn/oSBkryGtlIkrGr6uSYXh22KMTCd339ANYMBj12wPKhrx3fOxb/sBzox0Yu NJMIpK+sb7WKsqwkmQzcXLa+oHFOE3+7gMd7TTJaYsvLi4A== Received: from dc6wp-exch02.marvell.com ([4.21.29.225]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 40qd64sxs1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 31 Jul 2024 04:54:55 -0700 (PDT) Received: from DC6WP-EXCH02.marvell.com (10.76.176.209) by DC6WP-EXCH02.marvell.com (10.76.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Wed, 31 Jul 2024 04:54:54 -0700 Received: from maili.marvell.com (10.69.176.80) by DC6WP-EXCH02.marvell.com (10.76.176.209) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Wed, 31 Jul 2024 04:54:54 -0700 Received: from localhost.localdomain (unknown [10.28.36.102]) by maili.marvell.com (Postfix) with ESMTP id 5AE505C68E1; Wed, 31 Jul 2024 04:54:49 -0700 (PDT) From: Akhil Goyal To: CC: , , , , , , , , , , , , , , , , Akhil Goyal Subject: [PATCH 1/2] cryptodev: add queue pair priority Date: Wed, 31 Jul 2024 17:24:44 +0530 Message-ID: <20240731115445.1771803-1-gakhil@marvell.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: gAnS9c14tJmy-GYGEQy8kTEEUlLcP7qJ X-Proofpoint-GUID: gAnS9c14tJmy-GYGEQy8kTEEUlLcP7qJ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-07-31_08,2024-07-30_01,2024-05-17_01 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 Added a new field priority in `rte_cryptodev_qp_conf`, to set the queue pair priority while setting up. The priorities can be set between `RTE_CRYPTODEV_QP_PRIORITY_HIGHEST` and `RTE_CRYPTODEV_QP_PRIORITY_LOWEST`. The underlying implementation may normalize the value as per the supported priority levels. If the implementation does not support setting up priority, all queue pairs will be on same priority level and this field will be ignored. Signed-off-by: Akhil Goyal Change-Id: Ida87d0f354901013f3321cfa9ada443f39b00e0f --- lib/cryptodev/rte_cryptodev.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/lib/cryptodev/rte_cryptodev.h b/lib/cryptodev/rte_cryptodev.h index bec947f6d5..0a9cd718ea 100644 --- a/lib/cryptodev/rte_cryptodev.h +++ b/lib/cryptodev/rte_cryptodev.h @@ -608,12 +608,34 @@ enum rte_cryptodev_event_type { RTE_CRYPTODEV_EVENT_MAX /**< max value of this enum */ }; +/* Crypto queue pair priority levels */ +#define RTE_CRYPTODEV_QP_PRIORITY_HIGHEST 0 +/**< Highest priority of a cryptodev queue pair + * @see rte_cryptodev_queue_pair_setup(), rte_cryptodev_enqueue_burst() + */ +#define RTE_CRYPTODEV_QP_PRIORITY_NORMAL 128 +/**< Normal priority of a cryptodev queue pair + * @see rte_cryptodev_queue_pair_setup(), rte_cryptodev_enqueue_burst() + */ +#define RTE_CRYPTODEV_QP_PRIORITY_LOWEST 255 +/**< Lowest priority of a cryptodev queue pair + * @see rte_cryptodev_queue_pair_setup(), rte_cryptodev_enqueue_burst() + */ + /** Crypto device queue pair configuration structure. */ /* Structure rte_cryptodev_qp_conf 8<*/ struct rte_cryptodev_qp_conf { uint32_t nb_descriptors; /**< Number of descriptors per queue pair */ struct rte_mempool *mp_session; /**< The mempool for creating session in sessionless mode */ + uint8_t priority; + /**< Priority for this queue pair relative to other queue pairs. + * + * The requested priority should in the range of + * [@ref RTE_CRYPTODEV_QP_PRIORITY_HIGHEST, @ref RTE_CRYPTODEV_QP_PRIORITY_LOWEST]. + * The implementation may normalize the requested priority to + * device supported priority value. + */ }; /* >8 End of structure rte_cryptodev_qp_conf. */ From patchwork Wed Jul 31 11:54:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akhil Goyal X-Patchwork-Id: 142789 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 A04BA45701; Wed, 31 Jul 2024 14:03:31 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 56DF840E5E; Wed, 31 Jul 2024 14:03:27 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 3A91540696 for ; Wed, 31 Jul 2024 13:55:06 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 46V4ePAj025531; Wed, 31 Jul 2024 04:55:01 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfpt0220; bh=B QoLDcY0bEC11kZHBA9+8soTIDpGpqDxCt7ieixm7XQ=; b=lNZW5W0AVnWUuOs4Y WtOgfwxoT8/dTM9Z2miNVllQ518WdSzSAuvtGhQmSBfSDlqLgwPIwQPiTgL8Z28/ BOzQXxHkscpjOTvQRVGJjQ3po4UT8tISHIVV9tFa8sIbdJsD+wLgGFm4Tdzj7rMm kfAJSulPAGgdcEaeb7DHNxZNjPtYYs7wNnIb8AFXQjUA4hlpIsARsRG8rbQXass6 aAf54XL6cpsUDmG01z9P+ngt7V8kwmyPbS3ZEwtgkqoNn0zrxQyFtysGUi9sf96w ibmsug/A5mf11mIyx2mgKFa28Hp3Jg63udiGVko+q2Xo3O8gguYHTqoyZCcDFa8f 278nw== Received: from dc5-exch05.marvell.com ([199.233.59.128]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 40qeeusnfv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 31 Jul 2024 04:55:01 -0700 (PDT) Received: from DC5-EXCH05.marvell.com (10.69.176.209) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Wed, 31 Jul 2024 04:54:59 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Wed, 31 Jul 2024 04:54:59 -0700 Received: from localhost.localdomain (unknown [10.28.36.102]) by maili.marvell.com (Postfix) with ESMTP id D3C715C68E1; Wed, 31 Jul 2024 04:54:54 -0700 (PDT) From: Akhil Goyal To: CC: , , , , , , , , , , , , , , , , Akhil Goyal Subject: [PATCH 2/2] app/crypto-perf: test queue pair priority Date: Wed, 31 Jul 2024 17:24:45 +0530 Message-ID: <20240731115445.1771803-2-gakhil@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240731115445.1771803-1-gakhil@marvell.com> References: <20240731115445.1771803-1-gakhil@marvell.com> MIME-Version: 1.0 X-Proofpoint-GUID: DO4YfIwxYRTDvYe6vVETSKdvOebkunmo X-Proofpoint-ORIG-GUID: DO4YfIwxYRTDvYe6vVETSKdvOebkunmo X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-07-31_08,2024-07-30_01,2024-05-17_01 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 Updated the application to test variable queue pair priority. A mask `--low-prio-qp-mask mask` can be set to lower the priority of queues which are set in the mask. This would result in lower performance for those queues. By default the priority is set as highest. This option is added just to verify the performance drop of queues which have lower priority set. Signed-off-by: Akhil Goyal Change-Id: I88c3877f86e92a18bdb49c4421957b1c85dd10c8 --- app/test-crypto-perf/cperf_options.h | 3 +++ app/test-crypto-perf/cperf_options_parsing.c | 20 ++++++++++++++++++++ app/test-crypto-perf/main.c | 6 +++++- doc/guides/tools/cryptoperf.rst | 5 +++++ 4 files changed, 33 insertions(+), 1 deletion(-) diff --git a/app/test-crypto-perf/cperf_options.h b/app/test-crypto-perf/cperf_options.h index 131ecfdffb..48f409c3ba 100644 --- a/app/test-crypto-perf/cperf_options.h +++ b/app/test-crypto-perf/cperf_options.h @@ -32,6 +32,8 @@ #define CPERF_TEST_FILE ("test-file") #define CPERF_TEST_NAME ("test-name") +#define CPERF_LOW_PRIO_QP_MASK ("low-prio-qp-mask") + #define CPERF_CIPHER_ALGO ("cipher-algo") #define CPERF_CIPHER_OP ("cipher-op") #define CPERF_CIPHER_KEY_SZ ("cipher-key-sz") @@ -107,6 +109,7 @@ struct cperf_options { uint32_t *imix_buffer_sizes; uint32_t nb_descriptors; uint16_t nb_qps; + uint64_t low_prio_qp_mask; uint32_t sessionless:1; uint32_t shared_session:1; diff --git a/app/test-crypto-perf/cperf_options_parsing.c b/app/test-crypto-perf/cperf_options_parsing.c index c91fcf0479..8c15cd813f 100644 --- a/app/test-crypto-perf/cperf_options_parsing.c +++ b/app/test-crypto-perf/cperf_options_parsing.c @@ -37,6 +37,7 @@ usage(char *progname) " --segment-sz N: set the size of the segment to use\n" " --desc-nb N: set number of descriptors for each crypto device\n" " --devtype TYPE: set crypto device type to use\n" + " --low-prio-qp-mask mask: set low priority for queues set in mask(hex)\n" " --optype cipher-only / auth-only / cipher-then-auth / auth-then-cipher /\n" " aead / pdcp / docsis / ipsec / modex / secp256r1 / sm2 / tls-record : set operation type\n" " --sessionless: enable session-less crypto operations\n" @@ -941,6 +942,22 @@ parse_pmd_cyclecount_delay_ms(struct cperf_options *opts, return 0; } +static int +parse_low_prio_qp_mask(struct cperf_options *opts, const char *arg) +{ + char *end = NULL; + unsigned long n; + + /* parse hexadecimal string */ + n = strtoul(arg, &end, 16); + if ((optarg[0] == '\0') || (end == NULL) || (*end != '\0')) + return -1; + + opts->low_prio_qp_mask = n; + + return 0; +} + typedef int (*option_parser_t)(struct cperf_options *opts, const char *arg); @@ -962,6 +979,8 @@ static struct option lgopts[] = { { CPERF_SEGMENT_SIZE, required_argument, 0, 0 }, { CPERF_DESC_NB, required_argument, 0, 0 }, + { CPERF_LOW_PRIO_QP_MASK, required_argument, 0, 0 }, + { CPERF_IMIX, required_argument, 0, 0 }, { CPERF_DEVTYPE, required_argument, 0, 0 }, { CPERF_OPTYPE, required_argument, 0, 0 }, @@ -1097,6 +1116,7 @@ cperf_opts_parse_long(int opt_idx, struct cperf_options *opts) { CPERF_BUFFER_SIZE, parse_buffer_sz }, { CPERF_SEGMENT_SIZE, parse_segment_sz }, { CPERF_DESC_NB, parse_desc_nb }, + { CPERF_LOW_PRIO_QP_MASK, parse_low_prio_qp_mask }, { CPERF_DEVTYPE, parse_device_type }, { CPERF_OPTYPE, parse_op_type }, { CPERF_SESSIONLESS, parse_sessionless }, diff --git a/app/test-crypto-perf/main.c b/app/test-crypto-perf/main.c index 75810dbf0b..eac87091a1 100644 --- a/app/test-crypto-perf/main.c +++ b/app/test-crypto-perf/main.c @@ -249,7 +249,8 @@ cperf_initialize_cryptodev(struct cperf_options *opts, uint8_t *enabled_cdevs) } struct rte_cryptodev_qp_conf qp_conf = { - .nb_descriptors = opts->nb_descriptors + .nb_descriptors = opts->nb_descriptors, + .priority = RTE_CRYPTODEV_QP_PRIORITY_HIGHEST }; /** @@ -315,6 +316,9 @@ cperf_initialize_cryptodev(struct cperf_options *opts, uint8_t *enabled_cdevs) } for (j = 0; j < opts->nb_qps; j++) { + if ((1 << j) & opts->low_prio_qp_mask) + qp_conf.priority = RTE_CRYPTODEV_QP_PRIORITY_LOWEST; + ret = rte_cryptodev_queue_pair_setup(cdev_id, j, &qp_conf, socket_id); if (ret < 0) { diff --git a/doc/guides/tools/cryptoperf.rst b/doc/guides/tools/cryptoperf.rst index 0510a3bb89..3a16b3a4a6 100644 --- a/doc/guides/tools/cryptoperf.rst +++ b/doc/guides/tools/cryptoperf.rst @@ -361,6 +361,11 @@ The following are the application command-line options: Set TLS/DTLS protocol version for perf test (default is TLS1.2). +* ``--low-prio-qp-mask `` + + Set low priority for queue pairs set in the hexadecimal mask. + This is an optional parameter, if not set all queue pairs will be on same high priority. + Test Vector File ~~~~~~~~~~~~~~~~