New upstream version 17.11.3
[deb_dpdk.git] / drivers / net / kni / rte_eth_kni.c
index f688d91..5c79501 100644 (file)
@@ -40,7 +40,7 @@
 #include <rte_kni.h>
 #include <rte_kvargs.h>
 #include <rte_malloc.h>
-#include <rte_vdev.h>
+#include <rte_bus_vdev.h>
 
 /* Only single queue supported */
 #define KNI_MAX_QUEUE_PER_PORT 1
@@ -90,7 +90,7 @@ static const 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_AUTONEG,
+               .link_autoneg = ETH_LINK_FIXED,
 };
 static int is_kni_initialized;
 
@@ -145,7 +145,7 @@ eth_kni_start(struct rte_eth_dev *dev)
        uint16_t port_id = dev->data->port_id;
        struct rte_mempool *mb_pool;
        struct rte_kni_conf conf;
-       const char *name = dev->data->name + 4; /* remove net_ */
+       const char *name = dev->device->name + 4; /* remove net_ */
 
        snprintf(conf.name, RTE_KNI_NAMESIZE, "%s", name);
        conf.force_bind = 0;
@@ -283,7 +283,7 @@ eth_kni_link_update(struct rte_eth_dev *dev __rte_unused,
        return 0;
 }
 
-static void
+static int
 eth_kni_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
 {
        unsigned long rx_packets_total = 0, rx_bytes_total = 0;
@@ -320,6 +320,8 @@ eth_kni_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
@@ -356,8 +358,6 @@ static const struct eth_dev_ops eth_kni_ops = {
        .stats_reset = eth_kni_stats_reset,
 };
 
-static struct rte_vdev_driver eth_kni_drv;
-
 static struct rte_eth_dev *
 eth_kni_create(struct rte_vdev_device *vdev,
                struct eth_kni_args *args,
@@ -395,8 +395,6 @@ eth_kni_create(struct rte_vdev_device *vdev,
        eth_dev->data = data;
        eth_dev->dev_ops = &eth_kni_ops;
 
-       data->dev_flags = RTE_ETH_DEV_DETACHABLE;
-
        internals->no_request_thread = args->no_request_thread;
 
        return eth_dev;