Merge branch 'upstream-16.11-stable' into 16.11.x
[deb_dpdk.git] / drivers / net / pcap / rte_eth_pcap.c
index 57b0b31..27590d3 100644 (file)
@@ -124,7 +124,7 @@ static struct rte_eth_link pmd_link = {
                .link_speed = ETH_SPEED_NUM_10G,
                .link_duplex = ETH_LINK_FULL_DUPLEX,
                .link_status = ETH_LINK_DOWN,
-               .link_autoneg = ETH_LINK_SPEED_FIXED,
+               .link_autoneg = ETH_LINK_FIXED,
 };
 
 static int
@@ -294,9 +294,9 @@ eth_pcap_tx_dumper(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
                        }
                }
 
-               rte_pktmbuf_free(mbuf);
                num_tx++;
                tx_bytes += mbuf->pkt_len;
+               rte_pktmbuf_free(mbuf);
        }
 
        /*
@@ -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;
 }
 
@@ -799,7 +801,7 @@ pmd_init_internals(const char *name, const unsigned int nb_rx_queues,
        struct rte_eth_dev_data *data = NULL;
        unsigned int numa_node = rte_socket_id();
 
-       RTE_LOG(INFO, PMD, "Creating pcap-backed ethdev on numa socket %u\n",
+       RTE_LOG(INFO, PMD, "Creating pcap-backed ethdev on numa socket %d\n",
                numa_node);
 
        /* now do all data allocation - for eth_dev structure
@@ -1040,7 +1042,7 @@ pmd_pcap_remove(const char *name)
 {
        struct rte_eth_dev *eth_dev = NULL;
 
-       RTE_LOG(INFO, PMD, "Closing pcap ethdev on numa socket %u\n",
+       RTE_LOG(INFO, PMD, "Closing pcap ethdev on numa socket %d\n",
                        rte_socket_id());
 
        if (name == NULL)