X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=app%2Ftest-compress-perf%2Fcomp_perf_options_parse.c;h=12d0a6caf0e6bac9ff8d6b2930d0e6af4cb4ec4e;hb=94a24aaf6c5bd0a03c2828e7411d30a4fc0ac075;hp=3d820197a05a25382143b650ee10ace2ea8ef968;hpb=1a9b0f3504dedf3a3774db1f5c765171d9731dce;p=dpdk.git diff --git a/app/test-compress-perf/comp_perf_options_parse.c b/app/test-compress-perf/comp_perf_options_parse.c index 3d820197a0..12d0a6caf0 100644 --- a/app/test-compress-perf/comp_perf_options_parse.c +++ b/app/test-compress-perf/comp_perf_options_parse.c @@ -28,6 +28,7 @@ #define CPERF_HUFFMAN_ENC ("huffman-enc") #define CPERF_LEVEL ("compress-level") #define CPERF_WINDOW_SIZE ("window-sz") +#define CPERF_EXTERNAL_MBUFS ("external-mbufs") struct name_id_map { const char *name; @@ -58,6 +59,8 @@ usage(char *progname) " (default: range between 1 and 9)\n" " --window-sz N: base two log value of compression window size\n" " (e.g.: 15 => 32k, default: max supported by PMD)\n" + " --external-mbufs: use memzones as external buffers instead of\n" + " keeping the data directly in mbuf area\n" " -h: prints this help\n", progname); } @@ -82,11 +85,11 @@ parse_cperf_test_type(struct comp_test_data *test_data, const char *arg) { struct name_id_map cperftest_namemap[] = { { - cperf_test_type_strs[CPERF_TEST_TYPE_BENCHMARK], + comp_perf_test_type_strs[CPERF_TEST_TYPE_BENCHMARK], CPERF_TEST_TYPE_BENCHMARK }, { - cperf_test_type_strs[CPERF_TEST_TYPE_VERIFY], + comp_perf_test_type_strs[CPERF_TEST_TYPE_VERIFY], CPERF_TEST_TYPE_VERIFY } }; @@ -99,7 +102,7 @@ parse_cperf_test_type(struct comp_test_data *test_data, const char *arg) return -1; } - test_data->test = (enum cperf_perf_test_type)id; + test_data->test = (enum cperf_test_type)id; return 0; } @@ -520,6 +523,14 @@ parse_level(struct comp_test_data *test_data, const char *arg) return 0; } +static int +parse_external_mbufs(struct comp_test_data *test_data, + const char *arg __rte_unused) +{ + test_data->use_external_mbufs = 1; + return 0; +} + typedef int (*option_parser_t)(struct comp_test_data *test_data, const char *arg); @@ -544,8 +555,10 @@ static struct option lgopts[] = { { CPERF_HUFFMAN_ENC, required_argument, 0, 0 }, { CPERF_LEVEL, required_argument, 0, 0 }, { CPERF_WINDOW_SIZE, required_argument, 0, 0 }, + { CPERF_EXTERNAL_MBUFS, 0, 0, 0 }, { NULL, 0, 0, 0 } }; + static int comp_perf_opts_parse_long(int opt_idx, struct comp_test_data *test_data) { @@ -563,6 +576,7 @@ comp_perf_opts_parse_long(int opt_idx, struct comp_test_data *test_data) { CPERF_HUFFMAN_ENC, parse_huffman_enc }, { CPERF_LEVEL, parse_level }, { CPERF_WINDOW_SIZE, parse_window_sz }, + { CPERF_EXTERNAL_MBUFS, parse_external_mbufs }, }; unsigned int i; @@ -614,10 +628,11 @@ comp_perf_options_default(struct comp_test_data *test_data) test_data->huffman_enc = RTE_COMP_HUFFMAN_DYNAMIC; test_data->test_op = COMPRESS_DECOMPRESS; test_data->window_sz = -1; - test_data->level_lst.min = 1; - test_data->level_lst.max = 9; + test_data->level_lst.min = RTE_COMP_LEVEL_MIN; + test_data->level_lst.max = RTE_COMP_LEVEL_MAX; test_data->level_lst.inc = 1; test_data->test = CPERF_TEST_TYPE_BENCHMARK; + test_data->use_external_mbufs = 0; } int