Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests: net: udpgso_bench_rx/tx: Stop when wrong CLI args are provided

Leaving unrecognized arguments buried in the output, can easily hide a
CLI/script typo. Avoid this by exiting when wrong arguments are provided to
the udpgso_bench test programs.

Fixes: 3a687bef148d ("selftests: udp gso benchmark")
Signed-off-by: Andrei Gherzan <andrei.gherzan@canonical.com>
Cc: Willem de Bruijn <willemb@google.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Link: https://lore.kernel.org/r/20230201001612.515730-2-andrei.gherzan@canonical.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>

authored by

Andrei Gherzan and committed by
Paolo Abeni
db9b47ee c03c80e3

+4
+2
tools/testing/selftests/net/udpgso_bench_rx.c
··· 336 336 cfg_verify = true; 337 337 cfg_read_all = true; 338 338 break; 339 + default: 340 + exit(1); 339 341 } 340 342 } 341 343
+2
tools/testing/selftests/net/udpgso_bench_tx.c
··· 490 490 case 'z': 491 491 cfg_zerocopy = true; 492 492 break; 493 + default: 494 + exit(1); 493 495 } 494 496 } 495 497