ethdev: remove detachable device flag
[dpdk.git] / drivers / net / null / rte_eth_null.c
index abf3ec7..3433c9c 100644 (file)
@@ -49,7 +49,6 @@ static unsigned default_packet_copy;
 static const char *valid_arguments[] = {
        ETH_NULL_PACKET_SIZE_ARG,
        ETH_NULL_PACKET_COPY_ARG,
-       "driver",
        NULL
 };
 
@@ -69,7 +68,7 @@ struct null_queue {
 struct pmd_internals {
        unsigned packet_size;
        unsigned packet_copy;
-       uint8_t port_id;
+       uint16_t port_id;
 
        struct null_queue rx_null_queues[RTE_MAX_QUEUES_PER_PORT];
        struct null_queue tx_null_queues[RTE_MAX_QUEUES_PER_PORT];
@@ -139,8 +138,6 @@ eth_null_copy_rx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)
                                        packet_size);
                bufs[i]->data_len = (uint16_t)packet_size;
                bufs[i]->pkt_len = packet_size;
-               bufs[i]->nb_segs = 1;
-               bufs[i]->next = NULL;
                bufs[i]->port = h->internals->port_id;
        }
 
@@ -301,7 +298,7 @@ eth_dev_info(struct rte_eth_dev *dev,
        dev_info->flow_type_rss_offloads = internals->flow_type_rss_offloads;
 }
 
-static void
+static int
 eth_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *igb_stats)
 {
        unsigned i, num_stats;
@@ -309,7 +306,7 @@ eth_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *igb_stats)
        const struct pmd_internals *internal;
 
        if ((dev == NULL) || (igb_stats == NULL))
-               return;
+               return -EINVAL;
 
        internal = dev->data->dev_private;
        num_stats = RTE_MIN((unsigned)RTE_ETHDEV_QUEUE_STAT_CNTRS,
@@ -336,6 +333,8 @@ eth_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *igb_stats)
        igb_stats->ipackets = rx_total;
        igb_stats->opackets = tx_total;
        igb_stats->oerrors = tx_err_total;
+
+       return 0;
 }
 
 static void
@@ -543,8 +542,6 @@ eth_dev_null_create(struct rte_vdev_device *dev,
        eth_dev->data = data;
        eth_dev->dev_ops = &ops;
 
-       data->dev_flags = RTE_ETH_DEV_DETACHABLE;
-
        /* finally assign rx and tx ops */
        if (packet_copy) {
                eth_dev->rx_pkt_burst = eth_null_copy_rx;