pcap: revert build patches
authorDavid Marchand <david.marchand@6wind.com>
Thu, 6 Mar 2014 10:11:56 +0000 (11:11 +0100)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Wed, 19 Mar 2014 13:33:52 +0000 (14:33 +0100)
This reverts commits
a0cdfcf9 (use pcap-config to guess compilation flags),
ef5b2363 (fix build with empty LIBPCAP_CFLAGS) and
60191b89 (fix build when pcap_sendpacket is unavailable).

These patches are creating more problems than solving the initial one
(which was a build error with too old pcap libraries).
Since old pcap libraries are not that common, just revert them.

Reported-by: Meir Tseitlin <mirots@gmail.com>
Reported-by: Mats Liljegren <mats.liljegren@enea.com>
Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
app/test-pmd/Makefile
doc/build-sdk-quick.txt
lib/librte_pmd_pcap/rte_eth_pcap.c
lib/librte_pmd_pcap/rte_eth_pcap.h
mk/rte.app.mk
mk/rte.sdkbuild.mk
mk/target/generic/rte.vars.mk

index f0d4b4d..bec83eb 100644 (file)
@@ -39,6 +39,10 @@ APP = testpmd
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 
+ifeq ($(CONFIG_RTE_LIBRTE_PMD_PCAP),y)
+LDFLAGS += -lpcap
+endif
+
 #
 # all source are stored in SRCS-y
 #
index bf7c350..8989a32 100644 (file)
@@ -11,8 +11,6 @@ Build variables
        EXTRA_CPPFLAGS   preprocessor options
        EXTRA_CFLAGS     compiler options
        EXTRA_LDFLAGS    linker options
-       LIBPCAP_CFLAGS   libpcap compiler options
-       LIBPCAP_LDFLAGS  libpcap linker options
        RTE_KERNELDIR    linux headers path
        CROSS     toolchain prefix
        V         verbose
index fbafd19..fe94a79 100644 (file)
@@ -217,7 +217,6 @@ eth_pcap_tx_dumper(void *queue,
        return num_tx;
 }
 
-#ifdef PCAP_CAN_SEND
 /*
  * Callback to handle sending packets through a real NIC.
  */
@@ -248,17 +247,6 @@ eth_pcap_tx(void *queue,
        tx_queue->err_pkts += nb_pkts - num_tx;
        return num_tx;
 }
-#else
-static uint16_t
-eth_pcap_tx(__rte_unused void *queue,
-               __rte_unused struct rte_mbuf **bufs,
-               __rte_unused uint16_t nb_pkts)
-{
-       RTE_LOG(ERR, PMD, "pcap library cannot send packets, please rebuild "
-                         "with a more up to date libpcap\n");
-       return -1;
-}
-#endif
 
 static int
 eth_dev_start(struct rte_eth_dev *dev)
index 344b78d..79373c0 100644 (file)
@@ -39,12 +39,6 @@ extern "C" {
 #endif
 #include <pcap.h>
 
-#ifdef pcap_sendpacket
-#define PCAP_CAN_SEND
-#else
-#undef PCAP_CAN_SEND
-#endif
-
 #define RTE_ETH_PCAP_PARAM_NAME "eth_pcap"
 
 /**
index d90a0b0..ec8e24e 100644 (file)
@@ -170,10 +170,7 @@ LDLIBS += -lrte_cmdline
 endif
 
 ifeq ($(CONFIG_RTE_LIBRTE_PMD_PCAP),y)
-LDLIBS += -lrte_pmd_pcap
-LIBPCAP_LDFLAGS ?= $(shell pcap-config --libs)
-$(if $(LIBPCAP_LDFLAGS),,$(error LIBPCAP_LDFLAGS is undefined))
-LDLIBS += $(LIBPCAP_LDFLAGS)
+LDLIBS += -lrte_pmd_pcap -lpcap
 endif
 
 LDLIBS += $(EXECENV_LDLIBS)
index 112c288..2975ee4 100644 (file)
@@ -40,13 +40,6 @@ else
   include $(RTE_SDK)/mk/rte.vars.mk
 endif
 
-ifeq ($(CONFIG_RTE_LIBRTE_PMD_PCAP),y)
-LIBPCAP_CFLAGS ?= $(shell pcap-config --cflags)
-EXTERNAL_LIB_CFLAGS += $(LIBPCAP_CFLAGS)
-endif
-
-export EXTERNAL_LIB_CFLAGS
-
 #
 # include .depdirs and define rules to order priorities between build
 # of directories.
index a163272..796cca7 100644 (file)
@@ -108,7 +108,7 @@ include $(RTE_SDK)/mk/rte.cpuflags.mk
 
 # merge all CFLAGS
 CFLAGS := $(CPU_CFLAGS) $(EXECENV_CFLAGS) $(TOOLCHAIN_CFLAGS) $(MACHINE_CFLAGS)
-CFLAGS += $(TARGET_CFLAGS) $(EXTERNAL_LIB_CFLAGS)
+CFLAGS += $(TARGET_CFLAGS)
 
 # merge all LDFLAGS
 LDFLAGS := $(CPU_LDFLAGS) $(EXECENV_LDFLAGS) $(TOOLCHAIN_LDFLAGS) $(MACHINE_LDFLAGS)