net/pcap: capture only ingress packets from Rx iface
authorIdo Goshen <ido@cgstowernetworks.com>
Sun, 1 Jul 2018 11:05:34 +0000 (14:05 +0300)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 4 Jul 2018 18:54:05 +0000 (20:54 +0200)
commit53bf48403409929d844e36e7a5e0eccb274cf8be
tree8bea20507f42cc10a44d480415ab42097fdadb46
parent8028142107a858a146bfdbaa010b7e77ff987342
net/pcap: capture only ingress packets from Rx iface

Support rx of in direction packets only
Useful for apps that also tx to eth_pcap ports in order to not see them
echoed back in as rx when out direction is also captured

Example:
In case using rx_iface and sending *single* packet to eth1
it will loop forever as the when it is sent to tx_iface=eth1
it will be captured again on the rx_iface=eth1 and so on
  $RTE_TARGET/app/testpmd l 0-3 -n 4 \
--vdev 'net_pcap0,rx_iface=eth1,tx_iface=eth1'
  …
  ---------------------- Forward statistics for port 0  ------------
  RX-packets: 758            RX-dropped: 0             RX-total: 758
  TX-packets: 758            TX-dropped: 0             TX-total: 758
  ------------------------------------------------------------------
While if using rx_iface_in it will not be captured on the way out and
be forwarded only once
  $RTE_TARGET/app/testpmd l 0-3 -n 4 \
--vdev 'net_pcap0,rx_iface_in=eth1,tx_iface=eth1'
  …
  ---------------------- Forward statistics for port 0  ------------
  RX-packets: 1              RX-dropped: 0             RX-total: 1
  TX-packets: 1              TX-dropped: 0             TX-total: 1
  ------------------------------------------------------------------

Signed-off-by: Ido Goshen <ido@cgstowernetworks.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
doc/guides/nics/pcap_ring.rst
drivers/net/pcap/rte_eth_pcap.c