Merged.

it will be good to skip other pktio init if prefix for that was pcap:
Something like open() can return 0, -1 , and error/skip next.

Maxim.

On 10/14/2015 15:06, Stuart Haslam wrote:
Add a pcap pktio type as a convenient method of providing test traffic to
an application. This is intended for functional testing rather than
performance testing (i.e. it's not particularly fast).

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

Changes since v1
  - Increased the pktio name length
  - Rebased

Changes since v2
  - Allocate odp_packet_t before reading packet from pcap to avoid
    dropping packets when the pktio pool is full (which tends to always
    happen when using an atomic input queue)
  - Moved m4 stuff into separate file odp_pcap.m4
  - Implemented non-promiscuous mode

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             |   1 +
  platform/linux-generic/m4/odp_pcap.m4              |  15 +
  platform/linux-generic/odp_packet_io.c             |   9 +-
  platform/linux-generic/pktio/io_ops.c              |   3 +
  platform/linux-generic/pktio/pcap.c                | 378 +++++++++++++++++++++
  platform/linux-generic/test/Makefile.am            |   5 +
  platform/linux-generic/test/pktio/Makefile.am      |   4 +
  platform/linux-generic/test/pktio/pktio_run_pcap   |  33 ++
  test/validation/pktio/pktio.c                      |  22 +-
  12 files changed, 497 insertions(+), 20 deletions(-)
  create mode 100644 platform/linux-generic/m4/odp_pcap.m4
  create mode 100644 platform/linux-generic/pktio/pcap.c
  create mode 100755 platform/linux-generic/test/pktio/pktio_run_pcap


_______________________________________________
lng-odp mailing list
[email protected]
https://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to