This is pretty handy for testing, for example to test classifier rules
using packets from a pcap;
odp_classifier -ipcap:in=test.pcap -p -m 0
"ODP_PMR_SIP_ADDR:192.168.111.2:FFFFFFFF:queue1" -t 5
Use the l2fwd app send packets from a pcap out over a real interface;
odp_l2fwd -ipcap:in=test.pcap:loops=10,eth0 -t 5
Check that l2fwd doesn't reorder packets;
odp_l2fwd -m 0 -i pcap:in=test.pcap,pcap:out=test_out.pcap
editcap -v -D 0 test.pcap /dev/null | awk '{print $7}' > test.txt
editcap -v -D 0 test_out.pcap /dev/null | awk '{print $7}' > test_out.txt
diff -q test.txt test_out.txt
(oops, it does when using > 2 workers)
Changes since v1;
- Increased the pktio name length
- Rebased
Stuart Haslam (4):
linux-generic: pktio: extend maximum devname length
example: classifier: fix potential buffer overflow
linux-generic: pktio: add pcap pktio type
linux-generic: pktio: add test for pcap pktio
example/classifier/odp_classifier.c | 18 +-
platform/linux-generic/Makefile.am | 4 +
.../linux-generic/include/odp_packet_io_internal.h | 25 +-
platform/linux-generic/m4/configure.m4 | 16 +
platform/linux-generic/odp_packet_io.c | 9 +-
platform/linux-generic/pktio/io_ops.c | 3 +
platform/linux-generic/pktio/pcap.c | 334 +++++++++++++++++++++
platform/linux-generic/test/Makefile.am | 5 +
platform/linux-generic/test/pktio/Makefile.am | 4 +
platform/linux-generic/test/pktio/pktio_run_pcap | 33 ++
10 files changed, 439 insertions(+), 12 deletions(-)
create mode 100644 platform/linux-generic/pktio/pcap.c
create mode 100755 platform/linux-generic/test/pktio/pktio_run_pcap
--
2.1.1
_______________________________________________
lng-odp mailing list
[email protected]
https://lists.linaro.org/mailman/listinfo/lng-odp