net: remove dead driver names
authorDavid Marchand <david.marchand@6wind.com>
Mon, 21 Nov 2016 18:06:13 +0000 (19:06 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 17 Jan 2017 18:24:51 +0000 (19:24 +0100)
Since commit b1fb53a39d88 ("ethdev: remove some PCI specific handling"),
rte_eth_dev_info_get() relies on dev->data->drv_name to report the driver
name to caller.

Having the pmds set driver_info->driver_name in the pmds is useless,
since ethdev overwrites it right after.
The only thing the pmd must do is:
- for pci drivers, call rte_eth_copy_pci_info() which then sets
  data->drv_name
- for vdev drivers, manually set data->drv_name

At this stage, virtio-user does not properly report a driver name (fixed in
next commit).

Signed-off-by: David Marchand <david.marchand@6wind.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: Jan Blunck <jblunck@infradead.org>
drivers/net/af_packet/rte_eth_af_packet.c
drivers/net/nfp/nfp_net.c
drivers/net/null/rte_eth_null.c
drivers/net/pcap/rte_eth_pcap.c
drivers/net/qede/qede_ethdev.c
drivers/net/ring/rte_eth_ring.c
drivers/net/vhost/rte_eth_vhost.c
drivers/net/xenvirt/rte_eth_xenvirt.c

index 2951f86..4c317c4 100644 (file)
@@ -115,8 +115,6 @@ static const char *valid_arguments[] = {
        NULL
 };
 
-static const char *drivername = "AF_PACKET PMD";
-
 static struct rte_eth_link pmd_link = {
        .link_speed = ETH_SPEED_NUM_10G,
        .link_duplex = ETH_LINK_FULL_DUPLEX,
@@ -280,7 +278,6 @@ eth_dev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 {
        struct pmd_internals *internals = dev->data->dev_private;
 
-       dev_info->driver_name = drivername;
        dev_info->if_index = internals->if_index;
        dev_info->max_mac_addrs = 1;
        dev_info->max_rx_pktlen = (uint32_t)ETH_FRAME_LEN;
@@ -692,7 +689,7 @@ rte_pmd_init_internals(const char *name,
        (*eth_dev)->dev_ops = &ops;
        (*eth_dev)->driver = NULL;
        (*eth_dev)->data->dev_flags = RTE_ETH_DEV_DETACHABLE;
-       (*eth_dev)->data->drv_name = drivername;
+       (*eth_dev)->data->drv_name = "AF_PACKET PMD";
        (*eth_dev)->data->kdrv = RTE_KDRV_NONE;
        (*eth_dev)->data->numa_node = numa_node;
 
index 88169a7..d08660b 100644 (file)
@@ -1009,7 +1009,6 @@ nfp_net_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
        hw = NFP_NET_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 
        dev_info->pci_dev = RTE_DEV_TO_PCI(dev->device);
-       dev_info->driver_name = dev->driver->pci_drv.driver.name;
        dev_info->max_rx_queues = (uint16_t)hw->max_rx_queues;
        dev_info->max_tx_queues = (uint16_t)hw->max_tx_queues;
        dev_info->min_rx_bufsize = ETHER_MIN_MTU;
index 0b6715e..725dff3 100644 (file)
@@ -88,7 +88,6 @@ struct pmd_internals {
 
 
 static struct ether_addr eth_addr = { .addr_bytes = {0} };
-static const char *drivername = "Null PMD";
 static struct rte_eth_link pmd_link = {
        .link_speed = ETH_SPEED_NUM_10G,
        .link_duplex = ETH_LINK_FULL_DUPLEX,
@@ -295,7 +294,6 @@ eth_dev_info(struct rte_eth_dev *dev,
                return;
 
        internals = dev->data->dev_private;
-       dev_info->driver_name = drivername;
        dev_info->max_mac_addrs = 1;
        dev_info->max_rx_pktlen = (uint32_t)-1;
        dev_info->max_rx_queues = RTE_DIM(internals->rx_null_queues);
@@ -552,7 +550,7 @@ eth_dev_null_create(const char *name,
        eth_dev->driver = NULL;
        data->dev_flags = RTE_ETH_DEV_DETACHABLE;
        data->kdrv = RTE_KDRV_NONE;
-       data->drv_name = drivername;
+       data->drv_name = "Null PMD";
        data->numa_node = numa_node;
 
        /* finally assign rx and tx ops */
index 7253b9a..69c6960 100644 (file)
@@ -119,7 +119,6 @@ static struct ether_addr eth_addr = {
        .addr_bytes = { 0, 0, 0, 0x1, 0x2, 0x3 }
 };
 
-static const char *drivername = "Pcap PMD";
 static struct rte_eth_link pmd_link = {
                .link_speed = ETH_SPEED_NUM_10G,
                .link_duplex = ETH_LINK_FULL_DUPLEX,
@@ -552,7 +551,6 @@ eth_dev_info(struct rte_eth_dev *dev,
 {
        struct pmd_internals *internals = dev->data->dev_private;
 
-       dev_info->driver_name = drivername;
        dev_info->if_index = internals->if_index;
        dev_info->max_mac_addrs = 1;
        dev_info->max_rx_pktlen = (uint32_t) -1;
@@ -841,7 +839,7 @@ pmd_init_internals(const char *name, const unsigned int nb_rx_queues,
        (*eth_dev)->driver = NULL;
        data->dev_flags = RTE_ETH_DEV_DETACHABLE;
        data->kdrv = RTE_KDRV_NONE;
-       data->drv_name = drivername;
+       data->drv_name = "Pcap PMD";
        data->numa_node = numa_node;
 
        return 0;
index edc5b43..2a00238 100644 (file)
@@ -12,7 +12,6 @@
 
 /* Globals */
 static const struct qed_eth_ops *qed_ops;
-static const char *drivername = "qede pmd";
 static int64_t timer_period = 1;
 
 struct rte_qede_xstats_name_off {
@@ -664,7 +663,6 @@ qede_dev_info_get(struct rte_eth_dev *eth_dev,
                dev_info->max_vfs = 0;
        else
                dev_info->max_vfs = (uint16_t)NUM_OF_VFS(&qdev->edev);
-       dev_info->driver_name = qdev->drv_ver;
        dev_info->reta_size = ECORE_RSS_IND_TABLE_SIZE;
        dev_info->flow_type_rss_offloads = (uint64_t)QEDE_RSS_OFFLOAD_ALL;
 
index 975956a..efc2b75 100644 (file)
@@ -75,7 +75,6 @@ struct pmd_internals {
 };
 
 
-static const char *drivername = "Rings PMD";
 static struct rte_eth_link pmd_link = {
                .link_speed = ETH_SPEED_NUM_10G,
                .link_duplex = ETH_LINK_FULL_DUPLEX,
@@ -173,7 +172,6 @@ eth_dev_info(struct rte_eth_dev *dev,
                struct rte_eth_dev_info *dev_info)
 {
        struct pmd_internals *internals = dev->data->dev_private;
-       dev_info->driver_name = drivername;
        dev_info->max_mac_addrs = 1;
        dev_info->max_rx_pktlen = (uint32_t)-1;
        dev_info->max_rx_queues = (uint16_t)internals->max_rx_queues;
@@ -342,7 +340,7 @@ do_eth_dev_ring_create(const char *name,
        eth_dev->dev_ops = &ops;
        data->dev_flags = RTE_ETH_DEV_DETACHABLE;
        data->kdrv = RTE_KDRV_NONE;
-       data->drv_name = drivername;
+       data->drv_name = "Rings PMD";
        data->numa_node = numa_node;
 
        /* finally assign rx and tx ops */
index 410bfd8..98a4735 100644 (file)
@@ -53,8 +53,6 @@
 #define ETH_VHOST_CLIENT_ARG           "client"
 #define ETH_VHOST_DEQUEUE_ZERO_COPY    "dequeue-zero-copy"
 
-static const char *drivername = "VHOST PMD";
-
 static const char *valid_arguments[] = {
        ETH_VHOST_IFACE_ARG,
        ETH_VHOST_QUEUES_ARG,
@@ -859,7 +857,6 @@ eth_dev_info(struct rte_eth_dev *dev,
                return;
        }
 
-       dev_info->driver_name = drivername;
        dev_info->max_mac_addrs = 1;
        dev_info->max_rx_pktlen = (uint32_t)-1;
        dev_info->max_rx_queues = internal->max_queues;
index e7640ab..1cc2ce1 100644 (file)
@@ -70,8 +70,6 @@
 /* virtio_idx is increased after new device is created.*/
 static int virtio_idx = 0;
 
-static const char *drivername = "xen virtio PMD";
-
 static struct rte_eth_link pmd_link = {
                .link_speed = ETH_SPEED_NUM_10G,
                .link_duplex = ETH_LINK_FULL_DUPLEX,
@@ -331,7 +329,6 @@ eth_dev_info(struct rte_eth_dev *dev,
        struct pmd_internals *internals = dev->data->dev_private;
 
        RTE_SET_USED(internals);
-       dev_info->driver_name = drivername;
        dev_info->max_mac_addrs = 1;
        dev_info->max_rx_pktlen = (uint32_t)2048;
        dev_info->max_rx_queues = (uint16_t)1;
@@ -674,7 +671,7 @@ eth_dev_xenvirt_create(const char *name, const char *params,
 
        eth_dev->data->dev_flags = RTE_ETH_DEV_DETACHABLE;
        eth_dev->data->kdrv = RTE_KDRV_NONE;
-       eth_dev->data->drv_name = drivername;
+       eth_dev->data->drv_name = "xen virtio PMD";
        eth_dev->driver = NULL;
        eth_dev->data->numa_node = numa_node;