aboutsummaryrefslogtreecommitdiff
path: root/example
diff options
context:
space:
mode:
authorBogdan Pricope <bogdan.pricope@linaro.org>2018-01-08 10:59:18 +0200
committerMaxim Uvarov <maxim.uvarov@linaro.org>2018-01-14 18:29:34 +0300
commit8bd76909bea5d4d3a7917d00269a493628c96d5e (patch)
treeeb235757d608a12443da761a2fdab4b8448ec7fb /example
parent4c23114ed39db175beaa317f63b782fad02b2c6f (diff)
example: generator: add configuration option for scheduler RX
Add CLI option to enable/disable packet receive with scheduler API. Default: use direct mode API. Signed-off-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')
-rw-r--r--example/generator/odp_generator.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c
index b516ebf73..e7a4315a2 100644
--- a/example/generator/odp_generator.c
+++ b/example/generator/odp_generator.c
@@ -84,6 +84,7 @@ typedef struct {
int rx_burst; /**< number of packets to receive with one
API call */
odp_bool_t csum; /**< use platform csum support if available */
+ odp_bool_t sched; /**< use scheduler API to receive packets */
} appl_args_t;
/**
@@ -1394,10 +1395,11 @@ static void parse_args(int argc, char *argv[], appl_args_t *appl_args)
{"udp_tx_burst", required_argument, NULL, 'x'},
{"rx_burst", required_argument, NULL, 'r'},
{"csum", no_argument, NULL, 'y'},
+ {"sched", no_argument, NULL, 'z'},
{NULL, 0, NULL, 0}
};
- static const char *shortopts = "+I:a:b:s:d:p:i:m:n:t:w:c:x:he:f:yr:";
+ static const char *shortopts = "+I:a:b:s:d:p:i:m:n:t:w:c:x:he:f:yr:z";
/* let helper collect its own arguments (e.g. --odph_proc) */
odph_parse_options(argc, argv, shortopts, longopts);
@@ -1412,6 +1414,7 @@ static void parse_args(int argc, char *argv[], appl_args_t *appl_args)
appl_args->srcport = 0;
appl_args->dstport = 0;
appl_args->csum = 0;
+ appl_args->sched = 0;
opterr = 0; /* do not issue errors on helper options */
@@ -1563,6 +1566,9 @@ static void parse_args(int argc, char *argv[], appl_args_t *appl_args)
case 'y':
appl_args->csum = 1;
break;
+ case 'z':
+ appl_args->sched = 1;
+ break;
case 'h':
usage(argv[0]);
exit(EXIT_SUCCESS);
@@ -1652,6 +1658,8 @@ static void usage(char *progname)
" -r, --rx_burst size of RX burst\n"
" -y, --csum use platform checksum support if available\n"
" default is disabled\n"
+ " -z, --sched use scheduler API to receive packets\n"
+ " default is direct mode API\n"
"\n", NO_PATH(progname), NO_PATH(progname)
);
}