examples/ip_pipeline: add pcap file dump
authorFan Zhang <roy.fan.zhang@intel.com>
Fri, 11 Mar 2016 17:08:10 +0000 (17:08 +0000)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Sun, 13 Mar 2016 15:04:16 +0000 (16:04 +0100)
commitfe5d04621303f98bdb5983c62e07861cd0289e8f
treec908e4a873e29d868bfde854b51130a2436d69b7
parenteb5f4119b2bccbf8867879ada63ba5f5130d2edd
examples/ip_pipeline: add pcap file dump

This patch add packet dumping feature to ip_pipeline. Output port type
SINK now supports dumping packets to PCAP file before releasing mbuf back
to mempool. This feature can be applied by specifying parameters in
configuration file as shown below:

[PIPELINE1]
type = PASS-THROUGH
core = 1
pktq_in = SOURCE0 SOURCE1
pktq_out = SINK0 SINK1
pcap_file_wr = /path/to/eth1.pcap /path/to/eth2.pcap
pcap_n_pkt_wr = 80 0

The configuration section "pcap_file_wr" contains full path and name of
the PCAP file which the packets will be dumped to. If multiple SINKs
exists, each shall have its own PCAP file path listed in this section,
separated by spaces. Multiple SINK ports shall NOT share same PCAP file to
be dumped.

The configuration section "pcap_n_pkt_wr" contains integer value(s)
and indicates the maximum number of packets to be dumped to the PCAP file.
If this value is "0", the "infinite" dumping mode will be used. If this
value is N (N > 0), the dumping will be finished when the number of
packets dumped to the file reaches N.

To enable PCAP dumping support to IP pipeline, the compiler option
CONFIG_RTE_PORT_PCAP must be set to 'y'. It is possible to disable this
feature by removing "pcap_file_wr" and "pcap_n_pkt_wr" lines from the
configuration file.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
examples/ip_pipeline/app.h
examples/ip_pipeline/config_parse.c
examples/ip_pipeline/init.c
examples/ip_pipeline/pipeline_be.h