From: Jan Blunck <jblu...@infradead.org>

The eth_driver concept is unused in the mlx drivers so don't reference it.

Signed-off-by: Jan Blunck <jblu...@infradead.org>
---
 drivers/net/mlx4/mlx4.c | 24 +++++++++++-------------
 drivers/net/mlx5/mlx5.c | 24 +++++++++++-------------
 2 files changed, 22 insertions(+), 26 deletions(-)

diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
index aff9155..a1363c8 100644
--- a/drivers/net/mlx4/mlx4.c
+++ b/drivers/net/mlx4/mlx4.c
@@ -60,6 +60,7 @@
 
 #include <rte_ether.h>
 #include <rte_ethdev.h>
+#include <rte_ethdev_pci.h>
 #include <rte_dev.h>
 #include <rte_mbuf.h>
 #include <rte_errno.h>
@@ -5477,7 +5478,7 @@ mlx4_args(struct rte_devargs *devargs, struct mlx4_conf 
*conf)
        return ret;
 }
 
-static struct eth_driver mlx4_driver;
+static struct rte_pci_driver mlx4_driver;
 
 /**
  * DPDK callback to register a PCI device.
@@ -5509,7 +5510,7 @@ mlx4_pci_probe(struct rte_pci_driver *pci_drv, struct 
rte_pci_device *pci_dev)
        int i;
 
        (void)pci_drv;
-       assert(pci_drv == &mlx4_driver.pci_drv);
+       assert(pci_drv == &mlx4_driver);
        /* Get mlx4_dev[] index. */
        idx = mlx4_dev_idx(&pci_dev->addr);
        if (idx == -1) {
@@ -5808,7 +5809,7 @@ mlx4_pci_probe(struct rte_pci_driver *pci_drv, struct 
rte_pci_device *pci_dev)
 
                rte_eth_copy_pci_info(eth_dev, pci_dev);
 
-               eth_dev->driver = &mlx4_driver;
+               eth_dev->device->driver = &mlx4_driver.driver;
 
                priv->dev = eth_dev;
                eth_dev->dev_ops = &mlx4_dev_ops;
@@ -5872,16 +5873,13 @@ static const struct rte_pci_id mlx4_pci_id_map[] = {
        }
 };
 
-static struct eth_driver mlx4_driver = {
-       .pci_drv = {
-               .driver = {
-                       .name = MLX4_DRIVER_NAME
-               },
-               .id_table = mlx4_pci_id_map,
-               .probe = mlx4_pci_probe,
-               .drv_flags = RTE_PCI_DRV_INTR_LSC,
+static struct rte_pci_driver mlx4_driver = {
+       .driver = {
+               .name = MLX4_DRIVER_NAME
        },
-       .dev_private_size = sizeof(struct priv)
+       .id_table = mlx4_pci_id_map,
+       .probe = mlx4_pci_probe,
+       .drv_flags = RTE_PCI_DRV_INTR_LSC,
 };
 
 /**
@@ -5900,7 +5898,7 @@ rte_mlx4_pmd_init(void)
         */
        setenv("RDMAV_HUGEPAGES_SAFE", "1", 1);
        ibv_fork_init();
-       rte_eal_pci_register(&mlx4_driver.pci_drv);
+       rte_eal_pci_register(&mlx4_driver);
 }
 
 RTE_PMD_EXPORT_NAME(net_mlx4, __COUNTER__);
diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index b7eb9b5..6de4e4c 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -56,6 +56,7 @@
 #endif
 #include <rte_malloc.h>
 #include <rte_ethdev.h>
+#include <rte_ethdev_pci.h>
 #include <rte_pci.h>
 #include <rte_common.h>
 #include <rte_kvargs.h>
@@ -365,7 +366,7 @@ mlx5_args(struct priv *priv, struct rte_devargs *devargs)
        return 0;
 }
 
-static struct eth_driver mlx5_driver;
+static struct rte_pci_driver mlx5_driver;
 
 /**
  * DPDK callback to register a PCI device.
@@ -396,7 +397,7 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv, struct 
rte_pci_device *pci_dev)
        int i;
 
        (void)pci_drv;
-       assert(pci_drv == &mlx5_driver.pci_drv);
+       assert(pci_drv == &mlx5_driver);
        /* Get mlx5_dev[] index. */
        idx = mlx5_dev_idx(&pci_dev->addr);
        if (idx == -1) {
@@ -731,7 +732,7 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv, struct 
rte_pci_device *pci_dev)
 
                eth_dev->device = &pci_dev->device;
                rte_eth_copy_pci_info(eth_dev, pci_dev);
-               eth_dev->driver = &mlx5_driver;
+               eth_dev->device->driver = &mlx5_driver.driver;
                priv->dev = eth_dev;
                eth_dev->dev_ops = &mlx5_dev_ops;
 
@@ -813,16 +814,13 @@ static const struct rte_pci_id mlx5_pci_id_map[] = {
        }
 };
 
-static struct eth_driver mlx5_driver = {
-       .pci_drv = {
-               .driver = {
-                       .name = MLX5_DRIVER_NAME
-               },
-               .id_table = mlx5_pci_id_map,
-               .probe = mlx5_pci_probe,
-               .drv_flags = RTE_PCI_DRV_INTR_LSC,
+static struct rte_pci_driver mlx5_driver = {
+       .driver = {
+               .name = MLX5_DRIVER_NAME
        },
-       .dev_private_size = sizeof(struct priv)
+       .id_table = mlx5_pci_id_map,
+       .probe = mlx5_pci_probe,
+       .drv_flags = RTE_PCI_DRV_INTR_LSC,
 };
 
 /**
@@ -840,7 +838,7 @@ rte_mlx5_pmd_init(void)
         */
        setenv("RDMAV_HUGEPAGES_SAFE", "1", 1);
        ibv_fork_init();
-       rte_eal_pci_register(&mlx5_driver.pci_drv);
+       rte_eal_pci_register(&mlx5_driver);
 }
 
 RTE_PMD_EXPORT_NAME(net_mlx5, __COUNTER__);
-- 
2.1.4

Reply via email to