diff options
author | Matias Elo <matias.elo@nokia.com> | 2018-06-28 15:59:34 +0300 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2018-07-05 14:20:28 +0300 |
commit | 7c72d611d8d568358d4a7849057e42708cbb10c3 (patch) | |
tree | 41bf4ebc3fb5064b998015144b6cdc17b54c1b1b /example/ipsec_api | |
parent | 9ccda90b1788836848ecc5977d9cd8a807ee20c9 (diff) |
example: use min number of workers by default
Use minimum worker count by default in all example applications.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Bogdan Pricope <bogdan.pricope@linaro.org>
Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'example/ipsec_api')
-rw-r--r-- | example/ipsec_api/odp_ipsec.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/example/ipsec_api/odp_ipsec.c b/example/ipsec_api/odp_ipsec.c index 6142011be..4e1d4b512 100644 --- a/example/ipsec_api/odp_ipsec.c +++ b/example/ipsec_api/odp_ipsec.c @@ -69,7 +69,7 @@ static int create_stream_db_entry(char *input ODP_UNUSED) * Parsed command line application arguments */ typedef struct { - int cpu_count; + unsigned int cpu_count; int if_count; /**< Number of interfaces to be used */ char **if_names; /**< Array of pointers to interface names */ odp_ipsec_op_mode_t mode; /**< IPsec operation mode */ @@ -945,9 +945,8 @@ main(int argc, char *argv[]) /* Print both system and application information */ print_info(NO_PATH(argv[0]), &args->appl); - /* Default to system CPU count unless user specified */ num_workers = MAX_WORKERS; - if (args->appl.cpu_count) + if (args->appl.cpu_count && args->appl.cpu_count < MAX_WORKERS) num_workers = args->appl.cpu_count; /* Get default worker cpumask */ @@ -1095,6 +1094,8 @@ static void parse_args(int argc, char *argv[], appl_args_t *appl_args) /* let helper collect its own arguments (e.g. --odph_proc) */ argc = odph_parse_options(argc, argv); + appl_args->cpu_count = 1; /* use one worker by default */ + printf("\nParsing command line options\n"); while (!rc) { @@ -1268,7 +1269,7 @@ static void usage(char *progname) " -a 192.168.111.2:192.168.222.2:md5:201:a731649644c5dee92cbd9c2e7e188ee6\n" "\n" "Optional OPTIONS\n" - " -c, --count <number> CPU count.\n" + " -c, --count <number> CPU count, 0=all available, default=1\n" " -h, --help Display help and exit.\n" " environment variables: ODP_IPSEC_USE_POLL_QUEUES\n" " to enable use of poll queues instead of scheduled (default)\n" |