[dpdk-dev] [PATCH 2/9] pci: register all pdev as pci drivers

David Marchand david.marchand at 6wind.com
Fri Jan 29 15:08:29 CET 2016


pdev drivers are actually pci drivers.
Wrappers for ethdev and crypto pci drivers, that assume a 1 to 1
association between pci device and upper device, have been added so that
current drivers are not impacted.

Signed-off-by: David Marchand <david.marchand at 6wind.com>
---
 drivers/crypto/qat/rte_qat_cryptodev.c         |  7 +++++--
 drivers/net/bnx2x/bnx2x_ethdev.c               | 16 ++++++++++------
 drivers/net/cxgbe/cxgbe_ethdev.c               |  5 +++--
 drivers/net/e1000/em_ethdev.c                  |  4 +++-
 drivers/net/e1000/igb_ethdev.c                 | 14 +++++++++-----
 drivers/net/enic/enic_ethdev.c                 |  5 +++--
 drivers/net/fm10k/fm10k_ethdev.c               |  4 +++-
 drivers/net/i40e/i40e_ethdev.c                 |  5 +++--
 drivers/net/i40e/i40e_ethdev_vf.c              |  6 +++---
 drivers/net/ixgbe/ixgbe_ethdev.c               | 10 ++++++----
 drivers/net/nfp/nfp_net.c                      |  7 ++++---
 drivers/net/virtio/virtio_ethdev.c             |  4 +++-
 drivers/net/vmxnet3/vmxnet3_ethdev.c           |  5 +++--
 lib/librte_cryptodev/rte_cryptodev.c           | 18 ++++++++++--------
 lib/librte_cryptodev/rte_cryptodev_pmd.h       | 14 ++++++++++++++
 lib/librte_cryptodev/rte_cryptodev_version.map | 10 +++++++++-
 lib/librte_ether/rte_ethdev.c                  | 16 +++++++++-------
 lib/librte_ether/rte_ethdev.h                  | 15 +++++++++++++++
 lib/librte_ether/rte_ether_version.map         |  8 ++++++++
 19 files changed, 123 insertions(+), 50 deletions(-)

diff --git a/drivers/crypto/qat/rte_qat_cryptodev.c b/drivers/crypto/qat/rte_qat_cryptodev.c
index e500c1e..6853aee 100644
--- a/drivers/crypto/qat/rte_qat_cryptodev.c
+++ b/drivers/crypto/qat/rte_qat_cryptodev.c
@@ -113,10 +113,12 @@ crypto_qat_dev_init(__attribute__((unused)) struct rte_cryptodev_driver *crypto_
 }
 
 static struct rte_cryptodev_driver rte_qat_pmd = {
-	{
+	.pci_drv = {
 		.name = "rte_qat_pmd",
 		.id_table = pci_id_qat_map,
 		.drv_flags = RTE_PCI_DRV_NEED_MAPPING,
+		.devinit = rte_cryptodev_pci_probe,
+		.devuninit = rte_cryptodev_pci_remove,
 	},
 	.cryptodev_init = crypto_qat_dev_init,
 	.dev_private_size = sizeof(struct qat_pmd_private),
@@ -126,7 +128,8 @@ static int
 rte_qat_pmd_init(const char *name __rte_unused, const char *params __rte_unused)
 {
 	PMD_INIT_FUNC_TRACE();
-	return rte_cryptodev_pmd_driver_register(&rte_qat_pmd, PMD_PDEV);
+	rte_eal_pci_register(&rte_qat_pmd.pci_drv);
+	return 0;
 }
 
 static struct rte_driver pmd_qat_drv = {
diff --git a/drivers/net/bnx2x/bnx2x_ethdev.c b/drivers/net/bnx2x/bnx2x_ethdev.c
index 69df02e..916b9da 100644
--- a/drivers/net/bnx2x/bnx2x_ethdev.c
+++ b/drivers/net/bnx2x/bnx2x_ethdev.c
@@ -501,6 +501,8 @@ static struct eth_driver rte_bnx2x_pmd = {
 		.name = "rte_bnx2x_pmd",
 		.id_table = pci_id_bnx2x_map,
 		.drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC,
+		.devinit = rte_eth_dev_pci_probe,
+		.devuninit = rte_eth_dev_pci_remove,
 	},
 	.eth_dev_init = eth_bnx2x_dev_init,
 	.dev_private_size = sizeof(struct bnx2x_softc),
@@ -514,24 +516,26 @@ static struct eth_driver rte_bnx2xvf_pmd = {
 		.name = "rte_bnx2xvf_pmd",
 		.id_table = pci_id_bnx2xvf_map,
 		.drv_flags = RTE_PCI_DRV_NEED_MAPPING,
+		.devinit = rte_eth_dev_pci_probe,
+		.devuninit = rte_eth_dev_pci_remove,
 	},
 	.eth_dev_init = eth_bnx2xvf_dev_init,
 	.dev_private_size = sizeof(struct bnx2x_softc),
 };
 
-static int rte_bnx2x_pmd_init(const char *name __rte_unused, const char *params __rte_unused)
+static int rte_bnx2x_pmd_init(const char *name __rte_unused,
+			      const char *params __rte_unused)
 {
 	PMD_INIT_FUNC_TRACE();
-	rte_eth_driver_register(&rte_bnx2x_pmd);
-
+	rte_eal_pci_register(&rte_bnx2x_pmd.pci_drv);
 	return 0;
 }
 
-static int rte_bnx2xvf_pmd_init(const char *name __rte_unused, const char *params __rte_unused)
+static int rte_bnx2xvf_pmd_init(const char *name __rte_unused,
+				const char *params __rte_unused)
 {
 	PMD_INIT_FUNC_TRACE();
-	rte_eth_driver_register(&rte_bnx2xvf_pmd);
-
+	rte_eal_pci_register(&rte_bnx2xvf_pmd.pci_drv);
 	return 0;
 }
 
diff --git a/drivers/net/cxgbe/cxgbe_ethdev.c b/drivers/net/cxgbe/cxgbe_ethdev.c
index 97ef152..e425ef2 100644
--- a/drivers/net/cxgbe/cxgbe_ethdev.c
+++ b/drivers/net/cxgbe/cxgbe_ethdev.c
@@ -851,6 +851,8 @@ static struct eth_driver rte_cxgbe_pmd = {
 		.name = "rte_cxgbe_pmd",
 		.id_table = cxgb4_pci_tbl,
 		.drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC,
+		.devinit = rte_eth_dev_pci_probe,
+		.devuninit = rte_eth_dev_pci_remove,
 	},
 	.eth_dev_init = eth_cxgbe_dev_init,
 	.dev_private_size = sizeof(struct port_info),
@@ -865,8 +867,7 @@ static int rte_cxgbe_pmd_init(const char *name __rte_unused,
 			      const char *params __rte_unused)
 {
 	CXGBE_FUNC_TRACE();
-
-	rte_eth_driver_register(&rte_cxgbe_pmd);
+	rte_eal_pci_register(&rte_cxgbe_pmd.pci_drv);
 	return 0;
 }
 
diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c
index 66e8993..973ec97 100644
--- a/drivers/net/e1000/em_ethdev.c
+++ b/drivers/net/e1000/em_ethdev.c
@@ -340,6 +340,8 @@ static struct eth_driver rte_em_pmd = {
 		.id_table = pci_id_em_map,
 		.drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC |
 			RTE_PCI_DRV_DETACHABLE,
+		.devinit = rte_eth_dev_pci_probe,
+		.devuninit = rte_eth_dev_pci_remove,
 	},
 	.eth_dev_init = eth_em_dev_init,
 	.eth_dev_uninit = eth_em_dev_uninit,
@@ -349,7 +351,7 @@ static struct eth_driver rte_em_pmd = {
 static int
 rte_em_pmd_init(const char *name __rte_unused, const char *params __rte_unused)
 {
-	rte_eth_driver_register(&rte_em_pmd);
+	rte_eal_pci_register(&rte_em_pmd.pci_drv);
 	return 0;
 }
 
diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
index d1bbcda..a8d94a4 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ b/drivers/net/e1000/igb_ethdev.c
@@ -961,6 +961,8 @@ static struct eth_driver rte_igb_pmd = {
 		.id_table = pci_id_igb_map,
 		.drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC |
 			RTE_PCI_DRV_DETACHABLE,
+		.devinit = rte_eth_dev_pci_probe,
+		.devuninit = rte_eth_dev_pci_remove,
 	},
 	.eth_dev_init = eth_igb_dev_init,
 	.eth_dev_uninit = eth_igb_dev_uninit,
@@ -975,6 +977,8 @@ static struct eth_driver rte_igbvf_pmd = {
 		.name = "rte_igbvf_pmd",
 		.id_table = pci_id_igbvf_map,
 		.drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_DETACHABLE,
+		.devinit = rte_eth_dev_pci_probe,
+		.devuninit = rte_eth_dev_pci_remove,
 	},
 	.eth_dev_init = eth_igbvf_dev_init,
 	.eth_dev_uninit = eth_igbvf_dev_uninit,
@@ -984,7 +988,7 @@ static struct eth_driver rte_igbvf_pmd = {
 static int
 rte_igb_pmd_init(const char *name __rte_unused, const char *params __rte_unused)
 {
-	rte_eth_driver_register(&rte_igb_pmd);
+	rte_eal_pci_register(&rte_igb_pmd.pci_drv);
 	return 0;
 }
 
@@ -1005,12 +1009,12 @@ igb_vmdq_vlan_hw_filter_enable(struct rte_eth_dev *dev)
  * Register itself as the [Virtual Poll Mode] Driver of PCI IGB devices.
  */
 static int
-rte_igbvf_pmd_init(const char *name __rte_unused, const char *params __rte_unused)
+rte_igbvf_pmd_init(const char *name __rte_unused,
+		   const char *params __rte_unused)
 {
 	PMD_INIT_FUNC_TRACE();
-
-	rte_eth_driver_register(&rte_igbvf_pmd);
-	return (0);
+	rte_eal_pci_register(&rte_igbvf_pmd.pci_drv);
+	return 0;
 }
 
 static int
diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c
index 2a88043..7678c0a 100644
--- a/drivers/net/enic/enic_ethdev.c
+++ b/drivers/net/enic/enic_ethdev.c
@@ -625,6 +625,8 @@ static struct eth_driver rte_enic_pmd = {
 		.name = "rte_enic_pmd",
 		.id_table = pci_id_enic_map,
 		.drv_flags = RTE_PCI_DRV_NEED_MAPPING,
+		.devinit = rte_eth_dev_pci_probe,
+		.devuninit = rte_eth_dev_pci_remove,
 	},
 	.eth_dev_init = eth_enicpmd_dev_init,
 	.dev_private_size = sizeof(struct enic),
@@ -639,8 +641,7 @@ rte_enic_pmd_init(const char *name __rte_unused,
 	const char *params __rte_unused)
 {
 	ENICPMD_FUNC_TRACE();
-
-	rte_eth_driver_register(&rte_enic_pmd);
+	rte_eal_pci_register(&rte_enic_pmd.pci_drv);
 	return 0;
 }
 
diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index e4aed94..75537e0 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -2752,6 +2752,8 @@ static struct eth_driver rte_pmd_fm10k = {
 		.name = "rte_pmd_fm10k",
 		.id_table = pci_id_fm10k_map,
 		.drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_DETACHABLE,
+		.devinit = rte_eth_dev_pci_probe,
+		.devuninit = rte_eth_dev_pci_remove,
 	},
 	.eth_dev_init = eth_fm10k_dev_init,
 	.eth_dev_uninit = eth_fm10k_dev_uninit,
@@ -2768,7 +2770,7 @@ rte_pmd_fm10k_init(__rte_unused const char *name,
 	__rte_unused const char *params)
 {
 	PMD_INIT_FUNC_TRACE();
-	rte_eth_driver_register(&rte_pmd_fm10k);
+	rte_eal_pci_register(&rte_pmd_fm10k.pci_drv);
 	return 0;
 }
 
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index bf6220d..ab24115 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -603,6 +603,8 @@ static struct eth_driver rte_i40e_pmd = {
 		.id_table = pci_id_i40e_map,
 		.drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC |
 			RTE_PCI_DRV_DETACHABLE,
+		.devinit = rte_eth_dev_pci_probe,
+		.devuninit = rte_eth_dev_pci_remove,
 	},
 	.eth_dev_init = eth_i40e_dev_init,
 	.eth_dev_uninit = eth_i40e_dev_uninit,
@@ -647,8 +649,7 @@ rte_i40e_pmd_init(const char *name __rte_unused,
 		  const char *params __rte_unused)
 {
 	PMD_INIT_FUNC_TRACE();
-	rte_eth_driver_register(&rte_i40e_pmd);
-
+	rte_eal_pci_register(&rte_i40e_pmd.pci_drv);
 	return 0;
 }
 
diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index 14d2a50..050d7ea 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -1366,6 +1366,8 @@ static struct eth_driver rte_i40evf_pmd = {
 		.name = "rte_i40evf_pmd",
 		.id_table = pci_id_i40evf_map,
 		.drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_DETACHABLE,
+		.devinit = rte_eth_dev_pci_probe,
+		.devuninit = rte_eth_dev_pci_remove,
 	},
 	.eth_dev_init = i40evf_dev_init,
 	.eth_dev_uninit = i40evf_dev_uninit,
@@ -1382,9 +1384,7 @@ rte_i40evf_pmd_init(const char *name __rte_unused,
 		    const char *params __rte_unused)
 {
 	PMD_INIT_FUNC_TRACE();
-
-	rte_eth_driver_register(&rte_i40evf_pmd);
-
+	rte_eal_pci_register(&rte_i40evf_pmd.pci_drv);
 	return 0;
 }
 
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 4c4c6df..970528e 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -1433,6 +1433,8 @@ static struct eth_driver rte_ixgbe_pmd = {
 		.id_table = pci_id_ixgbe_map,
 		.drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC |
 			RTE_PCI_DRV_DETACHABLE,
+		.devinit = rte_eth_dev_pci_probe,
+		.devuninit = rte_eth_dev_pci_remove,
 	},
 	.eth_dev_init = eth_ixgbe_dev_init,
 	.eth_dev_uninit = eth_ixgbe_dev_uninit,
@@ -1447,6 +1449,8 @@ static struct eth_driver rte_ixgbevf_pmd = {
 		.name = "rte_ixgbevf_pmd",
 		.id_table = pci_id_ixgbevf_map,
 		.drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_DETACHABLE,
+		.devinit = rte_eth_dev_pci_probe,
+		.devuninit = rte_eth_dev_pci_remove,
 	},
 	.eth_dev_init = eth_ixgbevf_dev_init,
 	.eth_dev_uninit = eth_ixgbevf_dev_uninit,
@@ -1462,8 +1466,7 @@ static int
 rte_ixgbe_pmd_init(const char *name __rte_unused, const char *params __rte_unused)
 {
 	PMD_INIT_FUNC_TRACE();
-
-	rte_eth_driver_register(&rte_ixgbe_pmd);
+	rte_eal_pci_register(&rte_ixgbe_pmd.pci_drv);
 	return 0;
 }
 
@@ -1476,8 +1479,7 @@ static int
 rte_ixgbevf_pmd_init(const char *name __rte_unused, const char *param __rte_unused)
 {
 	PMD_INIT_FUNC_TRACE();
-
-	rte_eth_driver_register(&rte_ixgbevf_pmd);
+	rte_eal_pci_register(&rte_ixgbevf_pmd.pci_drv);
 	return (0);
 }
 
diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c
index bc2089f..89ba703 100644
--- a/drivers/net/nfp/nfp_net.c
+++ b/drivers/net/nfp/nfp_net.c
@@ -2463,10 +2463,12 @@ static struct rte_pci_id pci_id_nfp_net_map[] = {
 };
 
 static struct eth_driver rte_nfp_net_pmd = {
-	{
+	.pci_drv = {
 		.name = "rte_nfp_net_pmd",
 		.id_table = pci_id_nfp_net_map,
 		.drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC,
+		.devinit = rte_eth_dev_pci_probe,
+		.devuninit = rte_eth_dev_pci_remove,
 	},
 	.eth_dev_init = nfp_net_init,
 	.dev_private_size = sizeof(struct nfp_net_adapter),
@@ -2479,8 +2481,7 @@ nfp_net_pmd_init(const char *name __rte_unused,
 	PMD_INIT_FUNC_TRACE();
 	PMD_INIT_LOG(INFO, "librte_pmd_nfp_net version %s\n",
 		     NFP_NET_PMD_VERSION);
-
-	rte_eth_driver_register(&rte_nfp_net_pmd);
+	rte_eal_pci_register(&rte_nfp_net_pmd.pci_drv);
 	return 0;
 }
 
diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index d928339..08f386a 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -1439,6 +1439,8 @@ static struct eth_driver rte_virtio_pmd = {
 		.name = "rte_virtio_pmd",
 		.id_table = pci_id_virtio_map,
 		.drv_flags = RTE_PCI_DRV_DETACHABLE,
+		.devinit = rte_eth_dev_pci_probe,
+		.devuninit = rte_eth_dev_pci_remove,
 	},
 	.eth_dev_init = eth_virtio_dev_init,
 	.eth_dev_uninit = eth_virtio_dev_uninit,
@@ -1460,7 +1462,7 @@ rte_virtio_pmd_init(const char *name __rte_unused,
 		return -1;
 	}
 
-	rte_eth_driver_register(&rte_virtio_pmd);
+	rte_eal_pci_register(&rte_virtio_pmd.pci_drv);
 	return 0;
 }
 
diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
index c363bf6..1a3bc66 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -325,6 +325,8 @@ static struct eth_driver rte_vmxnet3_pmd = {
 		.name = "rte_vmxnet3_pmd",
 		.id_table = pci_id_vmxnet3_map,
 		.drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_DETACHABLE,
+		.devinit = rte_eth_dev_pci_probe,
+		.devuninit = rte_eth_dev_pci_remove,
 	},
 	.eth_dev_init = eth_vmxnet3_dev_init,
 	.eth_dev_uninit = eth_vmxnet3_dev_uninit,
@@ -340,8 +342,7 @@ static int
 rte_vmxnet3_pmd_init(const char *name __rte_unused, const char *param __rte_unused)
 {
 	PMD_INIT_FUNC_TRACE();
-
-	rte_eth_driver_register(&rte_vmxnet3_pmd);
+	rte_eal_pci_register(&rte_vmxnet3_pmd.pci_drv);
 	return 0;
 }
 
diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c
index f09f67e..1950020 100644
--- a/lib/librte_cryptodev/rte_cryptodev.c
+++ b/lib/librte_cryptodev/rte_cryptodev.c
@@ -313,9 +313,9 @@ rte_cryptodev_pmd_virtual_dev_init(const char *name, size_t dev_private_size,
 	return cryptodev;
 }
 
-static int
-rte_cryptodev_init(struct rte_pci_driver *pci_drv,
-		struct rte_pci_device *pci_dev)
+int
+rte_cryptodev_pci_probe(struct rte_pci_driver *pci_drv,
+			struct rte_pci_device *pci_dev)
 {
 	struct rte_cryptodev_driver *cryptodrv;
 	struct rte_cryptodev *cryptodev;
@@ -375,8 +375,8 @@ rte_cryptodev_init(struct rte_pci_driver *pci_drv,
 	return -ENXIO;
 }
 
-static int
-rte_cryptodev_uninit(struct rte_pci_device *pci_dev)
+int
+rte_cryptodev_pci_remove(struct rte_pci_device *pci_dev)
 {
 	const struct rte_cryptodev_driver *cryptodrv;
 	struct rte_cryptodev *cryptodev;
@@ -418,26 +418,28 @@ rte_cryptodev_uninit(struct rte_pci_device *pci_dev)
 	return 0;
 }
 
+#ifndef RTE_NEXT_ABI
 int
 rte_cryptodev_pmd_driver_register(struct rte_cryptodev_driver *cryptodrv,
 		enum pmd_type type)
 {
 	/* Call crypto device initialization directly if device is virtual */
 	if (type == PMD_VDEV)
-		return rte_cryptodev_init((struct rte_pci_driver *)cryptodrv,
+		return rte_cryptodev_pci_probe((struct rte_pci_driver *)cryptodrv,
 				NULL);
 
 	/*
 	 * Register PCI driver for physical device intialisation during
 	 * PCI probing
 	 */
-	cryptodrv->pci_drv.devinit = rte_cryptodev_init;
-	cryptodrv->pci_drv.devuninit = rte_cryptodev_uninit;
+	cryptodrv->pci_drv.devinit = rte_cryptodev_pci_probe;
+	cryptodrv->pci_drv.devuninit = rte_cryptodev_pci_remove;
 
 	rte_eal_pci_register(&cryptodrv->pci_drv);
 
 	return 0;
 }
+#endif
 
 
 uint16_t
diff --git a/lib/librte_cryptodev/rte_cryptodev_pmd.h b/lib/librte_cryptodev/rte_cryptodev_pmd.h
index 8270afa..1c5ee14 100644
--- a/lib/librte_cryptodev/rte_cryptodev_pmd.h
+++ b/lib/librte_cryptodev/rte_cryptodev_pmd.h
@@ -499,6 +499,7 @@ extern int
 rte_cryptodev_pmd_release_device(struct rte_cryptodev *cryptodev);
 
 
+#ifndef RTE_NEXT_ABI
 /**
  * Register a Crypto [Poll Mode] driver.
  *
@@ -527,6 +528,7 @@ rte_cryptodev_pmd_release_device(struct rte_cryptodev *cryptodev);
 extern int
 rte_cryptodev_pmd_driver_register(struct rte_cryptodev_driver *crypto_drv,
 		enum pmd_type type);
+#endif
 
 /**
  * Executes all the user application registered callbacks for the specific
@@ -541,6 +543,18 @@ rte_cryptodev_pmd_driver_register(struct rte_cryptodev_driver *crypto_drv,
 void rte_cryptodev_pmd_callback_process(struct rte_cryptodev *dev,
 				enum rte_cryptodev_event_type event);
 
+/**
+ * Wrapper for use by pci drivers as a .devinit function to attach to a crypto
+ * interface.
+ */
+int rte_cryptodev_pci_probe(struct rte_pci_driver *pci_drv,
+			    struct rte_pci_device *pci_dev);
+
+/**
+ * Wrapper for use by pci drivers as a .devuninit function to detach a crypto
+ * interface.
+ */
+int rte_cryptodev_pci_remove(struct rte_pci_device *pci_dev);
 
 #ifdef __cplusplus
 }
diff --git a/lib/librte_cryptodev/rte_cryptodev_version.map b/lib/librte_cryptodev/rte_cryptodev_version.map
index ff8e93d..3f838a4 100644
--- a/lib/librte_cryptodev/rte_cryptodev_version.map
+++ b/lib/librte_cryptodev/rte_cryptodev_version.map
@@ -29,4 +29,12 @@ DPDK_2.2 {
 	rte_cryptodev_queue_pair_stop;
 
 	local: *;
-};
\ No newline at end of file
+};
+
+DPDK_2.3 {
+	global:
+
+	rte_cryptodev_pci_probe;
+	rte_cryptodev_pci_remove;
+
+} DPDK_2.2;
diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index 756b234..17e4f4d 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -239,9 +239,9 @@ rte_eth_dev_release_port(struct rte_eth_dev *eth_dev)
 	return 0;
 }
 
-static int
-rte_eth_dev_init(struct rte_pci_driver *pci_drv,
-		 struct rte_pci_device *pci_dev)
+int
+rte_eth_dev_pci_probe(struct rte_pci_driver *pci_drv,
+		      struct rte_pci_device *pci_dev)
 {
 	struct eth_driver    *eth_drv;
 	struct rte_eth_dev *eth_dev;
@@ -293,8 +293,8 @@ rte_eth_dev_init(struct rte_pci_driver *pci_drv,
 	return diag;
 }
 
-static int
-rte_eth_dev_uninit(struct rte_pci_device *pci_dev)
+int
+rte_eth_dev_pci_remove(struct rte_pci_device *pci_dev)
 {
 	const struct eth_driver *eth_drv;
 	struct rte_eth_dev *eth_dev;
@@ -334,6 +334,7 @@ rte_eth_dev_uninit(struct rte_pci_device *pci_dev)
 	return 0;
 }
 
+#ifndef RTE_NEXT_ABI
 /**
  * Register an Ethernet [Poll Mode] driver.
  *
@@ -351,10 +352,11 @@ rte_eth_dev_uninit(struct rte_pci_device *pci_dev)
 void
 rte_eth_driver_register(struct eth_driver *eth_drv)
 {
-	eth_drv->pci_drv.devinit = rte_eth_dev_init;
-	eth_drv->pci_drv.devuninit = rte_eth_dev_uninit;
+	eth_drv->pci_drv.devinit = rte_eth_dev_pci_probe;
+	eth_drv->pci_drv.devuninit = rte_eth_dev_pci_remove;
 	rte_eal_pci_register(&eth_drv->pci_drv);
 }
+#endif
 
 int
 rte_eth_dev_is_valid_port(uint8_t port_id)
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 8710dd7..af051d1 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -1774,6 +1774,7 @@ struct eth_driver {
 	unsigned int dev_private_size;    /**< Size of device private data. */
 };
 
+#ifndef RTE_NEXT_ABI
 /**
  * @internal
  * A function invoked by the initialization function of an Ethernet driver
@@ -1785,6 +1786,7 @@ struct eth_driver {
  *   the Ethernet driver.
  */
 void rte_eth_driver_register(struct eth_driver *eth_drv);
+#endif
 
 /**
  * Configure an Ethernet device.
@@ -3880,6 +3882,19 @@ rte_eth_dma_zone_reserve(const struct rte_eth_dev *eth_dev, const char *name,
 			 uint16_t queue_id, size_t size,
 			 unsigned align, int socket_id);
 
+/**
+ * Wrapper for use by pci drivers as a .devinit function to attach to a ethdev
+ * interface.
+ */
+int rte_eth_dev_pci_probe(struct rte_pci_driver *pci_drv,
+			  struct rte_pci_device *pci_dev);
+
+/**
+ * Wrapper for use by pci drivers as a .devuninit function to detach a ethdev
+ * interface.
+ */
+int rte_eth_dev_pci_remove(struct rte_pci_device *pci_dev);
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/lib/librte_ether/rte_ether_version.map b/lib/librte_ether/rte_ether_version.map
index d8db24d..07b2d8b 100644
--- a/lib/librte_ether/rte_ether_version.map
+++ b/lib/librte_ether/rte_ether_version.map
@@ -117,3 +117,11 @@ DPDK_2.2 {
 
 	local: *;
 };
+
+DPDK_2.3 {
+	global:
+
+	rte_eth_dev_pci_probe;
+	rte_eth_dev_pci_remove;
+
+} DPDK_2.2;
-- 
1.9.1



More information about the dev mailing list