8fad2e5ab2
We currently do not check that a non option string has been passed to
testpmd.
Example:
$ ./master/app/testpmd --no-huge -m 512 --vdev net_null0 \
--vdev net_null1 -- -i nb-cores=2 --total-num-mbuf 2048
[...]
testpmd> show config fwd
io packet forwarding - ports=2 - cores=1 - streams=2 - NUMA support
enabled, MP allocation mode: native
Logical Core 1 (socket 0) forwards packets on 2 streams:
RX P=0/Q=0 (socket 0) -> TX P=1/Q=0 (socket 0) peer=02:00:00:00:00:01
RX P=1/Q=0 (socket 0) -> TX P=0/Q=0 (socket 0) peer=02:00:00:00:00:00
Here nb-cores=2 is just ignored, while the (probably sleepy) user did not
notice this.
Validate that all strings passed to testpmd are part of a known option.
After this patch:
$ ./master/app/testpmd --no-huge -m 512 --vdev net_null0 \
--vdev net_null1 -- -i nb-cores=2 --total-num-mbuf 2048
[...]
Invalid parameter: nb-cores=2
EAL: Error - exiting with code: 1
Cause: Command line incorrect
While at it, when passing an unknown option, print the string that gets
refused by getopt_long to help the user.
Fixes:
|
||
---|---|---|
.. | ||
bpf_cmd.c | ||
bpf_cmd.h | ||
cmdline_flow.c | ||
cmdline_mtr.c | ||
cmdline_mtr.h | ||
cmdline_tm.c | ||
cmdline_tm.h | ||
cmdline.c | ||
config.c | ||
csumonly.c | ||
flowgen.c | ||
icmpecho.c | ||
ieee1588fwd.c | ||
iofwd.c | ||
macfwd.c | ||
macswap_common.h | ||
macswap_neon.h | ||
macswap_sse.h | ||
macswap.c | ||
macswap.h | ||
Makefile | ||
meson.build | ||
noisy_vnf.c | ||
parameters.c | ||
rxonly.c | ||
softnicfwd.c | ||
testpmd.c | ||
testpmd.h | ||
txonly.c | ||
util.c |