aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/pcap
diff options
context:
space:
mode:
authorLuca Boccassi <luca.boccassi@gmail.com>2017-11-08 14:15:11 +0000
committerLuca Boccassi <luca.boccassi@gmail.com>2017-11-08 14:45:54 +0000
commit055c52583a2794da8ba1e85a48cce3832372b12f (patch)
tree8ceb1cb78fbb46a0f341f8ee24feb3c6b5540013 /drivers/net/pcap
parentf239aed5e674965691846e8ce3f187dd47523689 (diff)
New upstream version 17.11-rc3
Change-Id: I6a5baa40612fe0c20f30b5fa773a6cbbac63a685 Signed-off-by: Luca Boccassi <luca.boccassi@gmail.com>
Diffstat (limited to 'drivers/net/pcap')
-rw-r--r--drivers/net/pcap/Makefile3
-rw-r--r--drivers/net/pcap/rte_eth_pcap.c11
2 files changed, 10 insertions, 4 deletions
diff --git a/drivers/net/pcap/Makefile b/drivers/net/pcap/Makefile
index 7ebd0bef..b6487d42 100644
--- a/drivers/net/pcap/Makefile
+++ b/drivers/net/pcap/Makefile
@@ -40,6 +40,9 @@ LIB = librte_pmd_pcap.a
CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS)
LDLIBS += -lpcap
+LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring
+LDLIBS += -lrte_ethdev -lrte_net -lrte_kvargs
+LDLIBS += -lrte_bus_vdev
EXPORT_MAP := rte_pmd_pcap_version.map
diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c
index defb3b41..5a86752f 100644
--- a/drivers/net/pcap/rte_eth_pcap.c
+++ b/drivers/net/pcap/rte_eth_pcap.c
@@ -44,7 +44,7 @@
#include <rte_kvargs.h>
#include <rte_malloc.h>
#include <rte_mbuf.h>
-#include <rte_vdev.h>
+#include <rte_bus_vdev.h>
#define RTE_ETH_PCAP_SNAPSHOT_LEN 65535
#define RTE_ETH_PCAP_SNAPLEN ETHER_MAX_JUMBO_FRAME_LEN
@@ -75,7 +75,7 @@ struct queue_stat {
struct pcap_rx_queue {
pcap_t *pcap;
- uint8_t in_port;
+ uint16_t in_port;
struct rte_mempool *mb_pool;
struct queue_stat rx_stat;
char name[PATH_MAX];
@@ -411,11 +411,13 @@ open_single_tx_pcap(const char *pcap_filename, pcap_dumper_t **dumper)
/* The dumper is created using the previous pcap_t reference */
*dumper = pcap_dump_open(tx_pcap, pcap_filename);
if (*dumper == NULL) {
+ pcap_close(tx_pcap);
RTE_LOG(ERR, PMD, "Couldn't open %s for writing.\n",
pcap_filename);
return -1;
}
+ pcap_close(tx_pcap);
return 0;
}
@@ -560,7 +562,7 @@ eth_dev_info(struct rte_eth_dev *dev,
dev_info->min_rx_bufsize = 0;
}
-static void
+static int
eth_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
{
unsigned int i;
@@ -592,6 +594,8 @@ eth_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
stats->opackets = tx_packets_total;
stats->obytes = tx_bytes_total;
stats->oerrors = tx_packets_err_total;
+
+ return 0;
}
static void
@@ -838,7 +842,6 @@ pmd_init_internals(struct rte_vdev_device *vdev,
*/
(*eth_dev)->data = data;
(*eth_dev)->dev_ops = &ops;
- data->dev_flags = RTE_ETH_DEV_DETACHABLE;
return 0;
}