[ovs-dev] [PATCH] acinclude: Check RTE_LIBRTE_PMD_PCAP and libpcap.

William Tu u9012063 at gmail.com
Fri Apr 17 13:14:43 UTC 2020


When enabling RTE_LIBRTE_PMD_PCAP in DPDK, we need to link the libpcap
library, otherwise 'make' will fail.  I'm using this for creating a
pcap-based device which read pcap file infinitely to rx queue, acting
like a traffic generator.  Example:
  $ ovs-vsctl add-port br0 tg0 -- set int tg0 type=dpdk \
    options:dpdk-devargs=vdev:net_pcap0,rx_pcap=p0.pcap,infinite_rx=1

The p0.pcap is replayed into the rx queue of tg0, generating
traffic rate around 8Mpps into OVS when OVS is doing drop.
For more info, see https://doc.dpdk.org/guides/nics/pcap_ring.html

Cc: Michal Orsák <michal.orsak at gmail.com>
Signed-off-by: William Tu <u9012063 at gmail.com>
---
 acinclude.m4 | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/acinclude.m4 b/acinclude.m4
index 0901f2870239..fd139ec9ea36 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -359,6 +359,10 @@ AC_DEFUN([OVS_CHECK_DPDK], [
       AC_DEFINE([VHOST_NUMA], [1], [NUMA Aware vHost support detected in DPDK.])
     ], [], [[#include <rte_config.h>]])
 
+    AC_CHECK_DECL([RTE_LIBRTE_PMD_PCAP], [
+      OVS_FIND_DEPENDENCY([pcap_dump], [pcap], [libpcap])
+    ], [], [[#include <rte_config.h>]])
+
     AC_CHECK_DECL([RTE_LIBRTE_MLX5_PMD], [dnl found
       OVS_FIND_DEPENDENCY([mnl_attr_put], [mnl], [libmnl])
       AC_CHECK_DECL([RTE_IBVERBS_LINK_DLOPEN], [], [dnl not found
-- 
2.7.4



More information about the dev mailing list