X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fnull%2Frte_eth_null.c;h=d003b28392c1a8866b7dc18884e6c5dd10f6c61e;hb=c55a1667950f43be515c976269749a2a00c7268d;hp=2c9433938edae4924a5d115d9962df5a0eda7ec6;hpb=b46069d4b1d5dacade08ae3bd5fb426d25cf03d6;p=dpdk.git diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c index 2c9433938e..d003b28392 100644 --- a/drivers/net/null/rte_eth_null.c +++ b/drivers/net/null/rte_eth_null.c @@ -32,11 +32,11 @@ */ #include -#include +#include #include #include #include -#include +#include #include #include @@ -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]; @@ -92,7 +91,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_AUTONEG, + .link_autoneg = ETH_LINK_AUTONEG, }; static uint16_t @@ -279,6 +278,11 @@ eth_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id, return 0; } +static int +eth_mtu_set(struct rte_eth_dev *dev __rte_unused, uint16_t mtu __rte_unused) +{ + return 0; +} static void eth_dev_info(struct rte_eth_dev *dev, @@ -299,7 +303,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; @@ -307,7 +311,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, @@ -334,6 +338,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 @@ -455,6 +461,12 @@ eth_rss_hash_conf_get(struct rte_eth_dev *dev, return 0; } +static void +eth_mac_address_set(__rte_unused struct rte_eth_dev *dev, + __rte_unused struct ether_addr *addr) +{ +} + static const struct eth_dev_ops ops = { .dev_start = eth_dev_start, .dev_stop = eth_dev_stop, @@ -464,7 +476,9 @@ static const struct eth_dev_ops ops = { .tx_queue_setup = eth_tx_queue_setup, .rx_queue_release = eth_queue_release, .tx_queue_release = eth_queue_release, + .mtu_set = eth_mtu_set, .link_update = eth_link_update, + .mac_addr_set = eth_mac_address_set, .stats_get = eth_stats_get, .stats_reset = eth_stats_reset, .reta_update = eth_rss_reta_update, @@ -541,8 +555,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;