Message ID | 1433345458-20463-1-git-send-email-zoltan.kiss@linaro.org |
---|---|
State | New |
Headers | show |
that is a ugly fix. for 4 interfaces and 3 cpus it will unidirectional in one case and bidirectional in other case. I think it's better to add separate option to disable reverse direction threads. And add example print how to run in bi and single directions. Best regards, Maxim. On 06/03/15 18:30, Zoltan Kiss wrote: > If you want to test traffic going only in one direction, you might be better off > with one thread for the two interfaces. Removing this exit() call makes it > possible, while you still have the big error message which warns you that this > might be a bad idea. > In this case it's important to add the ingress interface first for the -i > parameter. > > Signed-off-by: Zoltan Kiss <zoltan.kiss@linaro.org> > --- > test/performance/odp_l2fwd.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/test/performance/odp_l2fwd.c b/test/performance/odp_l2fwd.c > index 5d4b833..e540e93 100644 > --- a/test/performance/odp_l2fwd.c > +++ b/test/performance/odp_l2fwd.c > @@ -397,11 +397,9 @@ int main(int argc, char *argv[]) > printf("first CPU: %i\n", odp_cpumask_first(&cpumask)); > printf("cpu mask: %s\n", cpumaskstr); > > - if (num_workers < gbl_args->appl.if_count) { > + if (num_workers < gbl_args->appl.if_count) > LOG_ERR("Error: CPU count %d less than interface count\n", > num_workers); > - exit(EXIT_FAILURE); > - } > if (gbl_args->appl.if_count % 2 != 0) { > LOG_ERR("Error: interface count %d is odd in fwd appl.\n", > gbl_args->appl.if_count); > @@ -667,6 +665,7 @@ static void usage(char *progname) > "\n" > "Mandatory OPTIONS:\n" > " -i, --interface Eth interfaces (comma-separated, no spaces)\n" > + " (unidirectional test: src must be first)\n" > " -m, --mode 0: Burst send&receive packets (no queues)\n" > " 1: Send&receive packets through ODP queues.\n" > "\n"
diff --git a/test/performance/odp_l2fwd.c b/test/performance/odp_l2fwd.c index 5d4b833..e540e93 100644 --- a/test/performance/odp_l2fwd.c +++ b/test/performance/odp_l2fwd.c @@ -397,11 +397,9 @@ int main(int argc, char *argv[]) printf("first CPU: %i\n", odp_cpumask_first(&cpumask)); printf("cpu mask: %s\n", cpumaskstr); - if (num_workers < gbl_args->appl.if_count) { + if (num_workers < gbl_args->appl.if_count) LOG_ERR("Error: CPU count %d less than interface count\n", num_workers); - exit(EXIT_FAILURE); - } if (gbl_args->appl.if_count % 2 != 0) { LOG_ERR("Error: interface count %d is odd in fwd appl.\n", gbl_args->appl.if_count); @@ -667,6 +665,7 @@ static void usage(char *progname) "\n" "Mandatory OPTIONS:\n" " -i, --interface Eth interfaces (comma-separated, no spaces)\n" + " (unidirectional test: src must be first)\n" " -m, --mode 0: Burst send&receive packets (no queues)\n" " 1: Send&receive packets through ODP queues.\n" "\n"
If you want to test traffic going only in one direction, you might be better off with one thread for the two interfaces. Removing this exit() call makes it possible, while you still have the big error message which warns you that this might be a bad idea. In this case it's important to add the ingress interface first for the -i parameter. Signed-off-by: Zoltan Kiss <zoltan.kiss@linaro.org> --- test/performance/odp_l2fwd.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)