From 055c52583a2794da8ba1e85a48cce3832372b12f Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Wed, 8 Nov 2017 14:15:11 +0000 Subject: New upstream version 17.11-rc3 Change-Id: I6a5baa40612fe0c20f30b5fa773a6cbbac63a685 Signed-off-by: Luca Boccassi --- drivers/net/pcap/Makefile | 3 +++ drivers/net/pcap/rte_eth_pcap.c | 11 +++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'drivers/net/pcap') 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 #include #include -#include +#include #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; } -- cgit 1.2.3-korg