drivers: advertise kmod dependencies in pmdinfo
[dpdk.git] / drivers / net / mlx5 / mlx5.c
index 4eaabcd..206c9f9 100644 (file)
 /* Verbs header. */
 /* ISO C doesn't support unnamed structs/unions, disabling -pedantic. */
 #ifdef PEDANTIC
-#pragma GCC diagnostic ignored "-pedantic"
+#pragma GCC diagnostic ignored "-Wpedantic"
 #endif
 #include <infiniband/verbs.h>
 #ifdef PEDANTIC
-#pragma GCC diagnostic error "-pedantic"
+#pragma GCC diagnostic error "-Wpedantic"
 #endif
 
 /* DPDK headers don't like -pedantic. */
 #ifdef PEDANTIC
-#pragma GCC diagnostic ignored "-pedantic"
+#pragma GCC diagnostic ignored "-Wpedantic"
 #endif
 #include <rte_malloc.h>
 #include <rte_ethdev.h>
@@ -60,7 +60,7 @@
 #include <rte_common.h>
 #include <rte_kvargs.h>
 #ifdef PEDANTIC
-#pragma GCC diagnostic error "-pedantic"
+#pragma GCC diagnostic error "-Wpedantic"
 #endif
 
 #include "mlx5.h"
@@ -511,7 +511,7 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
                priv->mtu = ETHER_MTU;
                priv->mps = mps; /* Enable MPW by default if supported. */
                priv->cqe_comp = 1; /* Enable compression by default. */
-               err = mlx5_args(priv, pci_dev->devargs);
+               err = mlx5_args(priv, pci_dev->device.devargs);
                if (err) {
                        ERROR("failed to process device arguments: %s",
                              strerror(err));
@@ -617,7 +617,7 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
 
                        snprintf(name, sizeof(name), "%s port %u",
                                 ibv_get_device_name(ibv_dev), port);
-                       eth_dev = rte_eth_dev_allocate(name, RTE_ETH_DEV_PCI);
+                       eth_dev = rte_eth_dev_allocate(name);
                }
                if (eth_dev == NULL) {
                        ERROR("can not allocate rte ethdev");
@@ -668,6 +668,7 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
                /* Bring Ethernet device up. */
                DEBUG("forcing Ethernet interface up");
                priv_set_flags(priv, ~IFF_UP, IFF_UP);
+               mlx5_link_update_unlocked(priv->dev, 1);
                continue;
 
 port_error:
@@ -728,7 +729,9 @@ static const struct rte_pci_id mlx5_pci_id_map[] = {
 
 static struct eth_driver mlx5_driver = {
        .pci_drv = {
-               .name = MLX5_DRIVER_NAME,
+               .driver = {
+                       .name = MLX5_DRIVER_NAME
+               },
                .id_table = mlx5_pci_id_map,
                .probe = mlx5_pci_probe,
                .drv_flags = RTE_PCI_DRV_INTR_LSC,
@@ -754,5 +757,6 @@ rte_mlx5_pmd_init(void)
        rte_eal_pci_register(&mlx5_driver.pci_drv);
 }
 
-DRIVER_EXPORT_NAME(net_mlx5, __COUNTER__);
-DRIVER_REGISTER_PCI_TABLE(net_mlx5, mlx5_pci_id_map);
+RTE_PMD_EXPORT_NAME(net_mlx5, __COUNTER__);
+RTE_PMD_REGISTER_PCI_TABLE(net_mlx5, mlx5_pci_id_map);
+RTE_PMD_REGISTER_KMOD_DEP(net_mlx5, "* ib_uverbs & mlx5_core & mlx5_ib");