@@ -135,6 +135,7 @@ rte_qat_pmd_init(const char *name __rte_unused, const char *params __rte_unused)
static struct rte_driver pmd_qat_drv = {
.type = PMD_PDEV,
.init = rte_qat_pmd_init,
+ .pci_table = pci_id_qat_map,
};
PMD_REGISTER_DRIVER(pmd_qat_drv);
@@ -543,11 +543,13 @@ static int rte_bnx2xvf_pmd_init(const char *name __rte_unused, const char *param
static struct rte_driver rte_bnx2x_driver = {
.type = PMD_PDEV,
.init = rte_bnx2x_pmd_init,
+ .pci_table = pci_id_bnx2x_map,
};
static struct rte_driver rte_bnx2xvf_driver = {
.type = PMD_PDEV,
.init = rte_bnx2xvf_pmd_init,
+ .pci_table = pci_id_bnx2xvf_map,
};
PMD_REGISTER_DRIVER(rte_bnx2x_driver);
@@ -892,6 +892,7 @@ static struct rte_driver rte_cxgbe_driver = {
.name = "cxgbe_driver",
.type = PMD_PDEV,
.init = rte_cxgbe_pmd_init,
+ .pci_table = cxgb4_pci_tbl,
};
PMD_REGISTER_DRIVER(rte_cxgbe_driver);
@@ -93,6 +93,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_IGB_PMD) += igb_rxtx.c
SRCS-$(CONFIG_RTE_LIBRTE_IGB_PMD) += igb_pf.c
SRCS-$(CONFIG_RTE_LIBRTE_EM_PMD) += em_ethdev.c
SRCS-$(CONFIG_RTE_LIBRTE_EM_PMD) += em_rxtx.c
+SRCS-y += pmds.c
# this lib depends upon:
DEPDIRS-$(CONFIG_RTE_LIBRTE_E1000_PMD) += lib/librte_eal lib/librte_ether
@@ -60,7 +60,8 @@
#define PMD_ROUNDUP(x,y) (((x) + (y) - 1)/(y) * (y))
-
+int
+rte_em_pmd_init(const char *name __rte_unused, const char *params __rte_unused);
static int eth_em_configure(struct rte_eth_dev *dev);
static int eth_em_start(struct rte_eth_dev *dev);
static void eth_em_stop(struct rte_eth_dev *dev);
@@ -136,7 +137,7 @@ static enum e1000_fc_mode em_fc_setting = e1000_fc_full;
/*
* The set of PCI devices this driver supports
*/
-static const struct rte_pci_id pci_id_em_map[] = {
+const struct rte_pci_id pci_id_em_map[] = {
#define RTE_PCI_DEV_ID_DECL_EM(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
#include "rte_pci_dev_ids.h"
@@ -374,7 +375,7 @@ static struct eth_driver rte_em_pmd = {
.dev_private_size = sizeof(struct e1000_adapter),
};
-static int
+int
rte_em_pmd_init(const char *name __rte_unused, const char *params __rte_unused)
{
rte_eth_driver_register(&rte_em_pmd);
@@ -1772,9 +1773,3 @@ eth_em_set_mc_addr_list(struct rte_eth_dev *dev,
return 0;
}
-struct rte_driver em_pmd_drv = {
- .type = PMD_PDEV,
- .init = rte_em_pmd_init,
-};
-
-PMD_REGISTER_DRIVER(em_pmd_drv);
@@ -86,6 +86,10 @@
#define E1000_INCVALUE_82576 (16 << IGB_82576_TSYNC_SHIFT)
#define E1000_TSAUXC_DISABLE_SYSTIME 0x80000000
+int
+rte_igb_pmd_init(const char *name __rte_unused, const char *params __rte_unused);
+int
+rte_igbvf_pmd_init(const char *name __rte_unused, const char *params __rte_unused);
static int eth_igb_configure(struct rte_eth_dev *dev);
static int eth_igb_start(struct rte_eth_dev *dev);
static void eth_igb_stop(struct rte_eth_dev *dev);
@@ -281,7 +285,7 @@ static enum e1000_fc_mode igb_fc_setting = e1000_fc_full;
/*
* The set of PCI devices this driver supports
*/
-static const struct rte_pci_id pci_id_igb_map[] = {
+const struct rte_pci_id pci_id_igb_map[] = {
#define RTE_PCI_DEV_ID_DECL_IGB(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
#include "rte_pci_dev_ids.h"
@@ -292,7 +296,7 @@ static const struct rte_pci_id pci_id_igb_map[] = {
/*
* The set of PCI devices this driver supports (for 82576&I350 VF)
*/
-static const struct rte_pci_id pci_id_igbvf_map[] = {
+const struct rte_pci_id pci_id_igbvf_map[] = {
#define RTE_PCI_DEV_ID_DECL_IGBVF(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
#include "rte_pci_dev_ids.h"
@@ -995,7 +999,7 @@ static struct eth_driver rte_igbvf_pmd = {
.dev_private_size = sizeof(struct e1000_adapter),
};
-static int
+int
rte_igb_pmd_init(const char *name __rte_unused, const char *params __rte_unused)
{
rte_eth_driver_register(&rte_igb_pmd);
@@ -1018,7 +1022,7 @@ 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.
*/
-static int
+int
rte_igbvf_pmd_init(const char *name __rte_unused, const char *params __rte_unused)
{
PMD_INIT_FUNC_TRACE();
@@ -4802,16 +4806,6 @@ eth_igb_set_eeprom(struct rte_eth_dev *dev,
return nvm->ops.write(hw, first, length, data);
}
-static struct rte_driver pmd_igb_drv = {
- .type = PMD_PDEV,
- .init = rte_igb_pmd_init,
-};
-
-static struct rte_driver pmd_igbvf_drv = {
- .type = PMD_PDEV,
- .init = rte_igbvf_pmd_init,
-};
-
static int
eth_igb_rx_queue_intr_disable(struct rte_eth_dev *dev, uint16_t queue_id)
{
@@ -4973,5 +4967,3 @@ eth_igb_configure_msix_intr(struct rte_eth_dev *dev)
E1000_WRITE_FLUSH(hw);
}
-PMD_REGISTER_DRIVER(pmd_igb_drv);
-PMD_REGISTER_DRIVER(pmd_igbvf_drv);
new file mode 100644
@@ -0,0 +1,48 @@
+#include <rte_dev.h>
+#include <rte_config.h>
+
+#if RTE_LIBRTE_IGB_PMD
+extern int
+rte_igb_pmd_init(const char *name __rte_unused, const char *params __rte_unused);
+extern int
+rte_igbvf_pmd_init(const char *name __rte_unused, const char *params __rte_unused);
+
+extern const struct rte_pci_id pci_id_igb_map[];
+extern const struct rte_pci_id pci_id_igbvf_map[];
+
+struct rte_driver __attribute__((used)) pmd_igb_drv = {
+ .type = PMD_PDEV,
+ .name = "igb_pmd",
+ .init = rte_igb_pmd_init,
+ .pci_table = pci_id_igb_map,
+};
+
+struct rte_driver __attribute__((used)) pmd_igbvf_drv = {
+ .type = PMD_PDEV,
+ .name = "igbvf_pmd",
+ .init = rte_igbvf_pmd_init,
+ .pci_table = pci_id_igbvf_map,
+};
+
+PMD_REGISTER_DRIVER(pmd_igb_drv);
+PMD_REGISTER_DRIVER(pmd_igbvf_drv);
+#endif
+
+#if RTE_LIBRTE_EM_PMD
+extern int
+rte_em_pmd_init(const char *name __rte_unused, const char *params __rte_unused);
+
+/*
+ * * The set of PCI devices this driver supports
+ * */
+extern const struct rte_pci_id pci_id_em_map[];
+
+static struct rte_driver __attribute__((used)) em_pmd_drv = {
+ .type = PMD_PDEV,
+ .name = "em_pmd",
+ .init = rte_em_pmd_init,
+ .pci_table = pci_id_em_map,
+};
+
+PMD_REGISTER_DRIVER(em_pmd_drv);
+#endif
@@ -1448,6 +1448,7 @@ struct rte_driver ena_pmd_drv = {
.name = "ena_driver",
.type = PMD_PDEV,
.init = rte_ena_pmd_init,
+ .pci_table = pci_id_ena_map,
};
PMD_REGISTER_DRIVER(ena_pmd_drv);
@@ -682,6 +682,7 @@ rte_enic_pmd_init(__rte_unused const char *name,
static struct rte_driver rte_enic_driver = {
.type = PMD_PDEV,
.init = rte_enic_pmd_init,
+ .pci_table = pci_id_enic_map,
};
PMD_REGISTER_DRIVER(rte_enic_driver);
@@ -3053,6 +3053,7 @@ rte_pmd_fm10k_init(__rte_unused const char *name,
static struct rte_driver rte_fm10k_driver = {
.type = PMD_PDEV,
.init = rte_pmd_fm10k_init,
+ .pci_table = pci_id_fm10k_map,
};
PMD_REGISTER_DRIVER(rte_fm10k_driver);
@@ -693,9 +693,23 @@ rte_i40e_pmd_init(const char *name __rte_unused,
static struct rte_driver rte_i40e_driver = {
.type = PMD_PDEV,
.init = rte_i40e_pmd_init,
+ .pci_table = pci_id_i40e_map,
+};
+
+extern int
+rte_i40evf_pmd_init(const char *name __rte_unused,
+ const char *params __rte_unused);
+
+extern const struct rte_pci_id pci_id_i40evf_map[];
+
+struct rte_driver rte_i40evf_driver = {
+ .type = PMD_PDEV,
+ .init = rte_i40evf_pmd_init,
+ .pci_table = pci_id_i40evf_map,
};
PMD_REGISTER_DRIVER(rte_i40e_driver);
+PMD_REGISTER_DRIVER(rte_i40evf_driver);
/*
* Initialize registers for flexible payload, which should be set by NVM.
@@ -101,6 +101,9 @@ enum i40evf_aq_result {
I40EVF_MSG_CMD, /* Read async command result */
};
+int
+rte_i40evf_pmd_init(const char *name __rte_unused,
+ const char *params __rte_unused);
static int i40evf_dev_configure(struct rte_eth_dev *dev);
static int i40evf_dev_start(struct rte_eth_dev *dev);
static void i40evf_dev_stop(struct rte_eth_dev *dev);
@@ -1088,7 +1091,7 @@ i40evf_get_link_status(struct rte_eth_dev *dev, struct rte_eth_link *link)
return 0;
}
-static const struct rte_pci_id pci_id_i40evf_map[] = {
+const struct rte_pci_id pci_id_i40evf_map[] = {
#define RTE_PCI_DEV_ID_DECL_I40EVF(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
#include "rte_pci_dev_ids.h"
{ .vendor_id = 0, /* sentinel */ },
@@ -1544,7 +1547,7 @@ static struct eth_driver rte_i40evf_pmd = {
* Invoked one at EAL init time.
* Register itself as the [Virtual Poll Mode] Driver of PCI Fortville devices.
*/
-static int
+int
rte_i40evf_pmd_init(const char *name __rte_unused,
const char *params __rte_unused)
{
@@ -1555,13 +1558,6 @@ rte_i40evf_pmd_init(const char *name __rte_unused,
return 0;
}
-static struct rte_driver rte_i40evf_driver = {
- .type = PMD_PDEV,
- .init = rte_i40evf_pmd_init,
-};
-
-PMD_REGISTER_DRIVER(rte_i40evf_driver);
-
static int
i40evf_dev_configure(struct rte_eth_dev *dev)
{
@@ -7134,11 +7134,13 @@ ixgbevf_dev_allmulticast_disable(struct rte_eth_dev *dev)
static struct rte_driver rte_ixgbe_driver = {
.type = PMD_PDEV,
.init = rte_ixgbe_pmd_init,
+ .pci_table = pci_id_ixgbe_map,
};
static struct rte_driver rte_ixgbevf_driver = {
.type = PMD_PDEV,
.init = rte_ixgbevf_pmd_init,
+ .pci_table = pci_id_ixgbevf_map,
};
PMD_REGISTER_DRIVER(rte_ixgbe_driver);
@@ -5815,6 +5815,7 @@ static struct rte_driver rte_mlx4_driver = {
.type = PMD_PDEV,
.name = MLX4_DRIVER_NAME,
.init = rte_mlx4_pmd_init,
+ .pci_table = mlx4_pci_id_map,
};
PMD_REGISTER_DRIVER(rte_mlx4_driver)
@@ -670,6 +670,7 @@ static struct rte_driver rte_mlx5_driver = {
.type = PMD_PDEV,
.name = MLX5_DRIVER_NAME,
.init = rte_mlx5_pmd_init,
+ .pci_table = mlx5_pci_id_map,
};
PMD_REGISTER_DRIVER(rte_mlx5_driver)
@@ -2480,6 +2480,7 @@ nfp_net_pmd_init(const char *name __rte_unused,
static struct rte_driver rte_nfp_net_driver = {
.type = PMD_PDEV,
.init = nfp_net_pmd_init,
+ .pci_table = pci_id_nfp_net_map,
};
PMD_REGISTER_DRIVER(rte_nfp_net_driver);
@@ -1599,6 +1599,7 @@ static struct rte_driver rte_szedata2_driver = {
.name = RTE_SZEDATA2_DRIVER_NAME,
.init = rte_szedata2_init,
.uninit = rte_szedata2_uninit,
+ .pci_table = rte_szedata2_pci_id_table,
};
PMD_REGISTER_DRIVER(rte_szedata2_driver);
@@ -1456,6 +1456,7 @@ __rte_unused uint8_t is_rx)
static struct rte_driver rte_virtio_driver = {
.type = PMD_PDEV,
.init = rte_virtio_pmd_init,
+ .pci_table = pci_id_virtio_map,
};
PMD_REGISTER_DRIVER(rte_virtio_driver);
@@ -952,6 +952,7 @@ vmxnet3_process_events(struct vmxnet3_hw *hw)
static struct rte_driver rte_vmxnet3_driver = {
.type = PMD_PDEV,
.init = rte_vmxnet3_pmd_init,
+ .pci_table = pci_id_vmxnet3_map,
};
PMD_REGISTER_DRIVER(rte_vmxnet3_driver);