Convert the igb pmd driver to use the PMD_REGISTER_DRIVER macro.
This means that the test applications now have no reference to the igb library
when building DSO's and must specify its use on the command line with the -d
option. Static linking will still initalize the driver automatically.
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
return -1;
/* init driver */
-#ifdef RTE_LIBRTE_IGB_PMD
- if (rte_igb_pmd_init() < 0)
- rte_panic("Cannot init igb pmd\n");
-#endif
#ifdef RTE_LIBRTE_IXGBE_PMD
if (rte_ixgbe_pmd_init() < 0)
rte_panic("Cannot init ixgbe pmd\n");
*/
extern void rte_eth_driver_register(struct eth_driver *eth_drv);
-/**
- * The initialization function of the driver for
- * Intel(r) IGB Gigabit Ethernet Controller devices.
- * This function is invoked once at EAL start time.
- * @return
- * 0 on success
- */
-extern int rte_igb_pmd_init(void);
-
/**
* The initialization function of the driver for 1Gbps Intel IGB_VF
* Ethernet devices.
int ret = -ENODEV;
#ifdef RTE_LIBRTE_IGB_PMD
- if ((ret = rte_igb_pmd_init()) != 0) {
- RTE_LOG(ERR, PMD, "Cannot init igb PMD\n");
- return (ret);
- }
if ((ret = rte_igbvf_pmd_init()) != 0) {
RTE_LOG(ERR, PMD, "Cannot init igbvf PMD\n");
return (ret);
#include <rte_eal.h>
#include <rte_atomic.h>
#include <rte_malloc.h>
+#include <rte_dev.h>
#include "e1000_logs.h"
#include "e1000/e1000_api.h"
.dev_private_size = sizeof(struct e1000_adapter),
};
-int
-rte_igb_pmd_init(void)
+static int
+rte_igb_pmd_init(const char *name __rte_unused, const char *params __rte_unused)
{
rte_eth_driver_register(&rte_igb_pmd);
return 0;
return 0;
}
+
+static struct rte_driver pmd_igb_drv = {
+ .type = PMD_PDEV,
+ .init = rte_igb_pmd_init,
+};
+
+PMD_REGISTER_DRIVER(pmd_igb_drv);