From: Neil Horman Date: Mon, 21 Apr 2014 14:59:33 +0000 (-0400) Subject: igbvf: convert to use of PMD_REGISTER_DRIVER and fix linking X-Git-Tag: spdx-start~10809 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=4ac16f77f02e43f4ec018dbaa89c085faa4f3ed0;p=dpdk.git igbvf: convert to use of PMD_REGISTER_DRIVER and fix linking Convert the igbvf pmd driver to use the PMD_REGISTER_DRIVER macro. This means that the test applications now have no reference to the igbvf 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 Acked-by: Thomas Monjalon --- diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h index a6dd769631..9e32f5612c 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -1315,15 +1315,6 @@ struct eth_driver { */ extern void rte_eth_driver_register(struct eth_driver *eth_drv); -/** - * The initialization function of the driver for 1Gbps Intel IGB_VF - * Ethernet devices. - * Invoked once at EAL start time. - * @return - * 0 on success - */ -extern int rte_igbvf_pmd_init(void); - /** * The initialization function of the driver for 10Gbps Intel IXGBE * Ethernet devices. @@ -1383,13 +1374,6 @@ int rte_pmd_init_all(void) { int ret = -ENODEV; -#ifdef RTE_LIBRTE_IGB_PMD - if ((ret = rte_igbvf_pmd_init()) != 0) { - RTE_LOG(ERR, PMD, "Cannot init igbvf PMD\n"); - return (ret); - } -#endif /* RTE_LIBRTE_IGB_PMD */ - #ifdef RTE_LIBRTE_IXGBE_PMD if ((ret = rte_ixgbe_pmd_init()) != 0) { RTE_LOG(ERR, PMD, "Cannot init ixgbe PMD\n"); diff --git a/lib/librte_pmd_e1000/igb_ethdev.c b/lib/librte_pmd_e1000/igb_ethdev.c index a19ea03c71..751e448f99 100644 --- a/lib/librte_pmd_e1000/igb_ethdev.c +++ b/lib/librte_pmd_e1000/igb_ethdev.c @@ -643,8 +643,8 @@ igb_vmdq_vlan_hw_filter_enable(struct rte_eth_dev *dev) * Invoked one at EAL init time. * Register itself as the [Virtual Poll Mode] Driver of PCI IGB devices. */ -int -rte_igbvf_pmd_init(void) +static int +rte_igbvf_pmd_init(const char *name __rte_unused, const char *params __rte_unused) { DEBUGFUNC("rte_igbvf_pmd_init"); @@ -2189,4 +2189,10 @@ static struct rte_driver pmd_igb_drv = { .init = rte_igb_pmd_init, }; +static struct rte_driver pmd_igbvf_drv = { + .type = PMD_PDEV, + .init = rte_igbvf_pmd_init, +}; + PMD_REGISTER_DRIVER(pmd_igb_drv); +PMD_REGISTER_DRIVER(pmd_igbvf_drv);