test/crypto-perf: test asymmetric crypto throughput
[dpdk.git] / app / test-crypto-perf / cperf_options_parsing.c
index 03ed6f5..2a7acb0 100644 (file)
@@ -24,7 +24,7 @@ usage(char *progname)
 {
        printf("%s [EAL options] --\n"
                " --silent: disable options dump\n"
-               " --ptest throughput / latency / verify / pmd-cycleount :"
+               " --ptest throughput / latency / verify / pmd-cyclecount :"
                " set test type\n"
                " --pool_sz N: set the number of crypto ops/mbufs allocated\n"
                " --total-ops N: set the number of total operations performed\n"
@@ -457,6 +457,10 @@ parse_op_type(struct cperf_options *opts, const char *arg)
                {
                        cperf_op_type_strs[CPERF_DOCSIS],
                        CPERF_DOCSIS
+               },
+               {
+                       cperf_op_type_strs[CPERF_ASYM_MODEX],
+                       CPERF_ASYM_MODEX
                }
        };
 
@@ -506,6 +510,12 @@ parse_test_name(struct cperf_options *opts,
 {
        char *test_name = (char *) rte_zmalloc(NULL,
                sizeof(char) * (strlen(arg) + 3), 0);
+       if (test_name == NULL) {
+               RTE_LOG(ERR, USER1, "Failed to rte zmalloc with size: %zu\n",
+                       strlen(arg) + 3);
+               return -1;
+       }
+
        snprintf(test_name, strlen(arg) + 3, "[%s]", arg);
        opts->test_name = test_name;
 
@@ -656,7 +666,8 @@ parse_pdcp_sn_sz(struct cperf_options *opts, const char *arg)
 
 const char *cperf_pdcp_domain_strs[] = {
        [RTE_SECURITY_PDCP_MODE_CONTROL] = "control",
-       [RTE_SECURITY_PDCP_MODE_DATA] = "data"
+       [RTE_SECURITY_PDCP_MODE_DATA] = "data",
+       [RTE_SECURITY_PDCP_MODE_SHORT_MAC] = "short_mac"
 };
 
 static int
@@ -671,6 +682,11 @@ parse_pdcp_domain(struct cperf_options *opts, const char *arg)
                        cperf_pdcp_domain_strs
                        [RTE_SECURITY_PDCP_MODE_DATA],
                        RTE_SECURITY_PDCP_MODE_DATA
+               },
+               {
+                       cperf_pdcp_domain_strs
+                       [RTE_SECURITY_PDCP_MODE_SHORT_MAC],
+                       RTE_SECURITY_PDCP_MODE_SHORT_MAC
                }
        };
 
@@ -983,7 +999,7 @@ cperf_options_parse(struct cperf_options *options, int argc, char **argv)
                switch (opt) {
                case 'h':
                        usage(argv[0]);
-                       rte_exit(EXIT_SUCCESS, "Displayed help\n");
+                       exit(EXIT_SUCCESS);
                        break;
                /* long options */
                case 0: