@@ -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;
@@ -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 },
@@ -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) {
@@ -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
~~~~~~~~~~~~~~~~