* [PATCH v2 1/2] cryptodev: add queue pair priority
2024-09-24 16:37 ` [PATCH v2 0/2] cryptodev: add " Akhil Goyal
@ 2024-09-24 16:38 ` Akhil Goyal
2024-09-24 16:38 ` [PATCH v2 2/2] app/crypto-perf: test " Akhil Goyal
2024-10-09 14:03 ` [PATCH v2 0/2] cryptodev: add " Akhil Goyal
2 siblings, 0 replies; 6+ messages in thread
From: Akhil Goyal @ 2024-09-24 16:38 UTC (permalink / raw)
To: dev
Cc: thomas, david.marchand, hemant.agrawal, anoobj,
pablo.de.lara.guarch, fiona.trahe, declan.doherty, matan,
g.singh, fanzhang.oss, jianjay.zhou, asomalap, ruifeng.wang,
konstantin.v.ananyev, radu.nicolau, ajit.khaparde, rnagadheeraj,
Akhil Goyal
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 <gakhil@marvell.com>
---
doc/guides/rel_notes/deprecation.rst | 3 ---
doc/guides/rel_notes/release_24_11.rst | 3 +++
lib/cryptodev/rte_cryptodev.h | 22 ++++++++++++++++++++++
3 files changed, 25 insertions(+), 3 deletions(-)
diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 211f59fdc9..3605e9cddc 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -174,9 +174,6 @@ Deprecation Notices
which got error interrupt to the application,
so that application can reset that particular queue pair.
-* cryptodev: The structure ``rte_cryptodev_qp_conf`` will be updated
- to have a new parameter to set priority of that particular queue pair.
-
* cryptodev: The enum ``rte_crypto_asym_xform_type`` and struct ``rte_crypto_asym_op``
will be extended to include new values to support EDDSA.
This will break ABI compatibility with existing applications that use these data types.
diff --git a/doc/guides/rel_notes/release_24_11.rst b/doc/guides/rel_notes/release_24_11.rst
index 0ff70d9057..fcdc738cf6 100644
--- a/doc/guides/rel_notes/release_24_11.rst
+++ b/doc/guides/rel_notes/release_24_11.rst
@@ -100,6 +100,9 @@ ABI Changes
Also, make sure to start the actual text at the margin.
=======================================================
+* cryptodev: The queue pair configuration structure ``rte_cryptodev_qp_conf``
+ is updated to have a new parameter to set priority of that particular queue pair.
+
Known Issues
------------
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. */
--
2.25.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2 2/2] app/crypto-perf: test queue pair priority
2024-09-24 16:37 ` [PATCH v2 0/2] cryptodev: add " Akhil Goyal
2024-09-24 16:38 ` [PATCH v2 1/2] " Akhil Goyal
@ 2024-09-24 16:38 ` Akhil Goyal
2024-10-09 14:03 ` [PATCH v2 0/2] cryptodev: add " Akhil Goyal
2 siblings, 0 replies; 6+ messages in thread
From: Akhil Goyal @ 2024-09-24 16:38 UTC (permalink / raw)
To: dev
Cc: thomas, david.marchand, hemant.agrawal, anoobj,
pablo.de.lara.guarch, fiona.trahe, declan.doherty, matan,
g.singh, fanzhang.oss, jianjay.zhou, asomalap, ruifeng.wang,
konstantin.v.ananyev, radu.nicolau, ajit.khaparde, rnagadheeraj,
Akhil Goyal
Updated the application to test variable queue pair priority.
A mask using `--low-prio-qp-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 <gakhil@marvell.com>
---
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 <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
~~~~~~~~~~~~~~~~
--
2.25.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH v2 0/2] cryptodev: add queue pair priority
2024-09-24 16:37 ` [PATCH v2 0/2] cryptodev: add " Akhil Goyal
2024-09-24 16:38 ` [PATCH v2 1/2] " Akhil Goyal
2024-09-24 16:38 ` [PATCH v2 2/2] app/crypto-perf: test " Akhil Goyal
@ 2024-10-09 14:03 ` Akhil Goyal
2 siblings, 0 replies; 6+ messages in thread
From: Akhil Goyal @ 2024-10-09 14:03 UTC (permalink / raw)
To: Akhil Goyal, dev
Cc: thomas, david.marchand, hemant.agrawal, Anoob Joseph,
pablo.de.lara.guarch, fiona.trahe, declan.doherty, matan,
g.singh, fanzhang.oss, jianjay.zhou, asomalap, ruifeng.wang,
konstantin.v.ananyev, radu.nicolau, ajit.khaparde,
Nagadheeraj Rottela
> Subject: [PATCH v2 0/2] cryptodev: add queue pair priority
>
> Changes in v2:
> - added release notes and removed deprecation notice.
> - removed gerrit-id
>
> Akhil Goyal (2):
> cryptodev: add queue pair priority
> app/crypto-perf: test queue pair priority
>
> 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/rel_notes/deprecation.rst | 3 ---
> doc/guides/rel_notes/release_24_11.rst | 3 +++
> doc/guides/tools/cryptoperf.rst | 5 +++++
> lib/cryptodev/rte_cryptodev.h | 22 ++++++++++++++++++++
> 7 files changed, 58 insertions(+), 4 deletions(-)
>
Series applied to dpdk-next-crypto
^ permalink raw reply [flat|nested] 6+ messages in thread