[PATCH 00/38] Remove struct eth_driver

STALE3422d

104 messages, 11 authors, 2017-05-10 · page 2 of 2 · open the first message on its own page

[PATCH v2 30/42] net/nfp: Don't use eth_driver

From: Gaetan Rivet <hidden>
Date: 2017-04-11 15:45:35

From: Jan Blunck <redacted>

Signed-off-by: Jan Blunck <redacted>
---
 drivers/net/nfp/nfp_net.c | 29 +++++++++++++++++++----------
 1 file changed, 19 insertions(+), 10 deletions(-)
diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c
index d06b10a..eda87a5 100644
--- a/drivers/net/nfp/nfp_net.c
+++ b/drivers/net/nfp/nfp_net.c
@@ -46,6 +46,7 @@
 #include <rte_log.h>
 #include <rte_debug.h>
 #include <rte_ethdev.h>
+#include <rte_ethdev_pci.h>
 #include <rte_dev.h>
 #include <rte_ether.h>
 #include <rte_malloc.h>
@@ -2580,18 +2581,26 @@ static const struct rte_pci_id pci_id_nfp_net_map[] = {
 	},
 };
 
-static struct eth_driver rte_nfp_net_pmd = {
-	.pci_drv = {
-		.id_table = pci_id_nfp_net_map,
-		.drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC,
-		.probe = rte_eth_dev_pci_probe,
-		.remove = rte_eth_dev_pci_remove,
-	},
-	.eth_dev_init = nfp_net_init,
-	.dev_private_size = sizeof(struct nfp_net_adapter),
+static int eth_nfp_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
+	struct rte_pci_device *pci_dev)
+{
+	return rte_eth_dev_pci_generic_probe(pci_dev,
+		sizeof(struct nfp_net_adapter), nfp_net_init);
+}
+
+static int eth_nfp_pci_remove(struct rte_pci_device *pci_dev)
+{
+	return rte_eth_dev_pci_generic_remove(pci_dev, NULL);
+}
+
+static struct rte_pci_driver rte_nfp_net_pmd = {
+	.id_table = pci_id_nfp_net_map,
+	.drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC,
+	.probe = eth_nfp_pci_probe,
+	.remove = eth_nfp_pci_remove,
 };
 
-RTE_PMD_REGISTER_PCI(net_nfp, rte_nfp_net_pmd.pci_drv);
+RTE_PMD_REGISTER_PCI(net_nfp, rte_nfp_net_pmd);
 RTE_PMD_REGISTER_PCI_TABLE(net_nfp, pci_id_nfp_net_map);
 RTE_PMD_REGISTER_KMOD_DEP(net_nfp, "* igb_uio | uio_pci_generic | vfio");
 
-- 
2.1.4

[PATCH v2 31/42] net/qede: Don't use eth_driver

From: Gaetan Rivet <hidden>
Date: 2017-04-11 15:45:36

From: Jan Blunck <redacted>

Signed-off-by: Jan Blunck <redacted>
---
 drivers/net/qede/qede_ethdev.c | 60 +++++++++++++++++++++++++-----------------
 drivers/net/qede/qede_ethdev.h |  1 +
 2 files changed, 37 insertions(+), 24 deletions(-)
diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c
index 5f469e5..fbad2a6 100644
--- a/drivers/net/qede/qede_ethdev.c
+++ b/drivers/net/qede/qede_ethdev.c
@@ -2382,35 +2382,47 @@ static const struct rte_pci_id pci_id_qede_map[] = {
 	{.vendor_id = 0,}
 };
 
-static struct eth_driver rte_qedevf_pmd = {
-	.pci_drv = {
-		    .id_table = pci_id_qedevf_map,
-		    .drv_flags =
-		    RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC,
-		    .probe = rte_eth_dev_pci_probe,
-		    .remove = rte_eth_dev_pci_remove,
-		   },
-	.eth_dev_init = qedevf_eth_dev_init,
-	.eth_dev_uninit = qedevf_eth_dev_uninit,
-	.dev_private_size = sizeof(struct qede_dev),
+static int qedevf_eth_dev_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
+	struct rte_pci_device *pci_dev)
+{
+	return rte_eth_dev_pci_generic_probe(pci_dev,
+		sizeof(struct qede_dev), qedevf_eth_dev_init);
+}
+
+static int qedevf_eth_dev_pci_remove(struct rte_pci_device *pci_dev)
+{
+	return rte_eth_dev_pci_generic_remove(pci_dev, qedevf_eth_dev_uninit);
+}
+
+static struct rte_pci_driver rte_qedevf_pmd = {
+	.id_table = pci_id_qedevf_map,
+	.drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC,
+	.probe = qedevf_eth_dev_pci_probe,
+	.remove = qedevf_eth_dev_pci_remove,
 };
 
-static struct eth_driver rte_qede_pmd = {
-	.pci_drv = {
-		    .id_table = pci_id_qede_map,
-		    .drv_flags =
-		    RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC,
-		    .probe = rte_eth_dev_pci_probe,
-		    .remove = rte_eth_dev_pci_remove,
-		   },
-	.eth_dev_init = qede_eth_dev_init,
-	.eth_dev_uninit = qede_eth_dev_uninit,
-	.dev_private_size = sizeof(struct qede_dev),
+static int qede_eth_dev_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
+	struct rte_pci_device *pci_dev)
+{
+	return rte_eth_dev_pci_generic_probe(pci_dev,
+		sizeof(struct qede_dev), qede_eth_dev_init);
+}
+
+static int qede_eth_dev_pci_remove(struct rte_pci_device *pci_dev)
+{
+	return rte_eth_dev_pci_generic_remove(pci_dev, qede_eth_dev_uninit);
+}
+
+static struct rte_pci_driver rte_qede_pmd = {
+	.id_table = pci_id_qede_map,
+	.drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC,
+	.probe = qede_eth_dev_pci_probe,
+	.remove = qede_eth_dev_pci_remove,
 };
 
-RTE_PMD_REGISTER_PCI(net_qede, rte_qede_pmd.pci_drv);
+RTE_PMD_REGISTER_PCI(net_qede, rte_qede_pmd);
 RTE_PMD_REGISTER_PCI_TABLE(net_qede, pci_id_qede_map);
 RTE_PMD_REGISTER_KMOD_DEP(net_qede, "* igb_uio | uio_pci_generic | vfio");
-RTE_PMD_REGISTER_PCI(net_qede_vf, rte_qedevf_pmd.pci_drv);
+RTE_PMD_REGISTER_PCI(net_qede_vf, rte_qedevf_pmd);
 RTE_PMD_REGISTER_PCI_TABLE(net_qede_vf, pci_id_qedevf_map);
 RTE_PMD_REGISTER_KMOD_DEP(net_qede_vf, "* igb_uio | vfio");
diff --git a/drivers/net/qede/qede_ethdev.h b/drivers/net/qede/qede_ethdev.h
index 56703da..f5549c2 100644
--- a/drivers/net/qede/qede_ethdev.h
+++ b/drivers/net/qede/qede_ethdev.h
@@ -14,6 +14,7 @@
 
 #include <rte_ether.h>
 #include <rte_ethdev.h>
+#include <rte_ethdev_pci.h>
 #include <rte_dev.h>
 #include <rte_ip.h>
 
-- 
2.1.4

[PATCH v2 32/42] net/sfc: Don't use eth_driver

From: Gaetan Rivet <hidden>
Date: 2017-04-11 15:45:37

From: Jan Blunck <redacted>

Signed-off-by: Jan Blunck <redacted>
---
 drivers/net/sfc/sfc_ethdev.c | 34 +++++++++++++++++++++-------------
 1 file changed, 21 insertions(+), 13 deletions(-)
diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c
index 4f7b640..7620080 100644
--- a/drivers/net/sfc/sfc_ethdev.c
+++ b/drivers/net/sfc/sfc_ethdev.c
@@ -31,6 +31,7 @@
 
 #include <rte_dev.h>
 #include <rte_ethdev.h>
+#include <rte_ethdev_pci.h>
 #include <rte_pci.h>
 #include <rte_errno.h>
 
@@ -1596,21 +1597,28 @@ static const struct rte_pci_id pci_id_sfc_efx_map[] = {
 	{ .vendor_id = 0 /* sentinel */ }
 };
 
-static struct eth_driver sfc_efx_pmd = {
-	.pci_drv = {
-		.id_table = pci_id_sfc_efx_map,
-		.drv_flags =
-			RTE_PCI_DRV_INTR_LSC |
-			RTE_PCI_DRV_NEED_MAPPING,
-		.probe = rte_eth_dev_pci_probe,
-		.remove = rte_eth_dev_pci_remove,
-	},
-	.eth_dev_init = sfc_eth_dev_init,
-	.eth_dev_uninit = sfc_eth_dev_uninit,
-	.dev_private_size = sizeof(struct sfc_adapter),
+static int sfc_eth_dev_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
+	struct rte_pci_device *pci_dev)
+{
+	return rte_eth_dev_pci_generic_probe(pci_dev,
+		sizeof(struct sfc_adapter), sfc_eth_dev_init);
+}
+
+static int sfc_eth_dev_pci_remove(struct rte_pci_device *pci_dev)
+{
+	return rte_eth_dev_pci_generic_remove(pci_dev, sfc_eth_dev_uninit);
+}
+
+static struct rte_pci_driver sfc_efx_pmd = {
+	.id_table = pci_id_sfc_efx_map,
+	.drv_flags =
+		RTE_PCI_DRV_INTR_LSC |
+		RTE_PCI_DRV_NEED_MAPPING,
+	.probe = sfc_eth_dev_pci_probe,
+	.remove = sfc_eth_dev_pci_remove,
 };
 
-RTE_PMD_REGISTER_PCI(net_sfc_efx, sfc_efx_pmd.pci_drv);
+RTE_PMD_REGISTER_PCI(net_sfc_efx, sfc_efx_pmd);
 RTE_PMD_REGISTER_PCI_TABLE(net_sfc_efx, pci_id_sfc_efx_map);
 RTE_PMD_REGISTER_KMOD_DEP(net_sfc_efx, "* igb_uio | uio_pci_generic | vfio");
 RTE_PMD_REGISTER_PARAM_STRING(net_sfc_efx,
-- 
2.1.4

[PATCH v2 33/42] net/szedata2: Don't use eth_driver

From: Gaetan Rivet <hidden>
Date: 2017-04-11 15:45:37

From: Jan Blunck <redacted>

Signed-off-by: Jan Blunck <redacted>
---
 drivers/net/szedata2/rte_eth_szedata2.c | 29 +++++++++++++++++++----------
 1 file changed, 19 insertions(+), 10 deletions(-)
diff --git a/drivers/net/szedata2/rte_eth_szedata2.c b/drivers/net/szedata2/rte_eth_szedata2.c
index fe7a6b3..54212b7 100644
--- a/drivers/net/szedata2/rte_eth_szedata2.c
+++ b/drivers/net/szedata2/rte_eth_szedata2.c
@@ -45,6 +45,7 @@
 
 #include <rte_mbuf.h>
 #include <rte_ethdev.h>
+#include <rte_ethdev_pci.h>
 #include <rte_malloc.h>
 #include <rte_memcpy.h>
 #include <rte_kvargs.h>
@@ -1587,18 +1588,26 @@ static const struct rte_pci_id rte_szedata2_pci_id_table[] = {
 	}
 };
 
-static struct eth_driver szedata2_eth_driver = {
-	.pci_drv = {
-		.id_table = rte_szedata2_pci_id_table,
-		.probe = rte_eth_dev_pci_probe,
-		.remove = rte_eth_dev_pci_remove,
-	},
-	.eth_dev_init     = rte_szedata2_eth_dev_init,
-	.eth_dev_uninit   = rte_szedata2_eth_dev_uninit,
-	.dev_private_size = sizeof(struct pmd_internals),
+static int szedata2_eth_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
+	struct rte_pci_device *pci_dev)
+{
+	return rte_eth_dev_pci_generic_probe(pci_dev,
+		sizeof(struct pmd_internals), rte_szedata2_eth_dev_init);
+}
+
+static int szedata2_eth_pci_remove(struct rte_pci_device *pci_dev)
+{
+	return rte_eth_dev_pci_generic_remove(pci_dev,
+		rte_szedata2_eth_dev_uninit);
+}
+
+static struct rte_pci_driver szedata2_eth_driver = {
+	.id_table = rte_szedata2_pci_id_table,
+	.probe = szedata2_eth_pci_probe,
+	.remove = szedata2_eth_pci_remove,
 };
 
-RTE_PMD_REGISTER_PCI(RTE_SZEDATA2_DRIVER_NAME, szedata2_eth_driver.pci_drv);
+RTE_PMD_REGISTER_PCI(RTE_SZEDATA2_DRIVER_NAME, szedata2_eth_driver);
 RTE_PMD_REGISTER_PCI_TABLE(RTE_SZEDATA2_DRIVER_NAME, rte_szedata2_pci_id_table);
 RTE_PMD_REGISTER_KMOD_DEP(RTE_SZEDATA2_DRIVER_NAME,
 	"* combo6core & combov3 & szedata2 & szedata2_cv3");
-- 
2.1.4

[PATCH v2 34/42] net/thunderx: Don't use eth_driver

From: Gaetan Rivet <hidden>
Date: 2017-04-11 15:45:39

From: Jan Blunck <redacted>

Signed-off-by: Jan Blunck <redacted>
---
 drivers/net/thunderx/nicvf_ethdev.c | 29 +++++++++++++++++++----------
 1 file changed, 19 insertions(+), 10 deletions(-)
diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c
index 6c3670a..b0b9c3b 100644
--- a/drivers/net/thunderx/nicvf_ethdev.c
+++ b/drivers/net/thunderx/nicvf_ethdev.c
@@ -53,6 +53,7 @@
 #include <rte_eal.h>
 #include <rte_ether.h>
 #include <rte_ethdev.h>
+#include <rte_ethdev_pci.h>
 #include <rte_interrupts.h>
 #include <rte_log.h>
 #include <rte_memory.h>
@@ -2131,17 +2132,25 @@ static const struct rte_pci_id pci_id_nicvf_map[] = {
 	},
 };
 
-static struct eth_driver rte_nicvf_pmd = {
-	.pci_drv = {
-		.id_table = pci_id_nicvf_map,
-		.drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC,
-		.probe = rte_eth_dev_pci_probe,
-		.remove = rte_eth_dev_pci_remove,
-	},
-	.eth_dev_init = nicvf_eth_dev_init,
-	.dev_private_size = sizeof(struct nicvf),
+static int nicvf_eth_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
+	struct rte_pci_device *pci_dev)
+{
+	return rte_eth_dev_pci_generic_probe(pci_dev, sizeof(struct nicvf),
+		nicvf_eth_dev_init);
+}
+
+static int nicvf_eth_pci_remove(struct rte_pci_device *pci_dev)
+{
+	return rte_eth_dev_pci_generic_remove(pci_dev, NULL);
+}
+
+static struct rte_pci_driver rte_nicvf_pmd = {
+	.id_table = pci_id_nicvf_map,
+	.drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC,
+	.probe = nicvf_eth_pci_probe,
+	.remove = nicvf_eth_pci_remove,
 };
 
-RTE_PMD_REGISTER_PCI(net_thunderx, rte_nicvf_pmd.pci_drv);
+RTE_PMD_REGISTER_PCI(net_thunderx, rte_nicvf_pmd);
 RTE_PMD_REGISTER_PCI_TABLE(net_thunderx, pci_id_nicvf_map);
 RTE_PMD_REGISTER_KMOD_DEP(net_thunderx, "* igb_uio | uio_pci_generic | vfio");
-- 
2.1.4

[PATCH v2 35/42] net/vmxnet3: Don't use eth_driver

From: Gaetan Rivet <hidden>
Date: 2017-04-11 15:45:40

From: Jan Blunck <redacted>

Signed-off-by: Jan Blunck <redacted>
---
 drivers/net/vmxnet3/vmxnet3_ethdev.c | 30 +++++++++++++++++++-----------
 1 file changed, 19 insertions(+), 11 deletions(-)
diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
index ae3efaa..0e8eb75 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -56,6 +56,7 @@
 #include <rte_alarm.h>
 #include <rte_ether.h>
 #include <rte_ethdev.h>
+#include <rte_ethdev_pci.h>
 #include <rte_atomic.h>
 #include <rte_string_fns.h>
 #include <rte_malloc.h>
@@ -377,16 +378,23 @@ eth_vmxnet3_dev_uninit(struct rte_eth_dev *eth_dev)
 	return 0;
 }
 
-static struct eth_driver rte_vmxnet3_pmd = {
-	.pci_drv = {
-		.id_table = pci_id_vmxnet3_map,
-		.drv_flags = RTE_PCI_DRV_NEED_MAPPING,
-		.probe = rte_eth_dev_pci_probe,
-		.remove = rte_eth_dev_pci_remove,
-	},
-	.eth_dev_init = eth_vmxnet3_dev_init,
-	.eth_dev_uninit = eth_vmxnet3_dev_uninit,
-	.dev_private_size = sizeof(struct vmxnet3_hw),
+static int eth_vmxnet3_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
+	struct rte_pci_device *pci_dev)
+{
+	return rte_eth_dev_pci_generic_probe(pci_dev,
+		sizeof(struct vmxnet3_hw), eth_vmxnet3_dev_init);
+}
+
+static int eth_vmxnet3_pci_remove(struct rte_pci_device *pci_dev)
+{
+	return rte_eth_dev_pci_generic_remove(pci_dev, eth_vmxnet3_dev_uninit);
+}
+
+static struct rte_pci_driver rte_vmxnet3_pmd = {
+	.id_table = pci_id_vmxnet3_map,
+	.drv_flags = RTE_PCI_DRV_NEED_MAPPING,
+	.probe = eth_vmxnet3_pci_probe,
+	.remove = eth_vmxnet3_pci_remove,
 };
 
 static int
@@ -1116,6 +1124,6 @@ vmxnet3_process_events(struct vmxnet3_hw *hw)
 }
 #endif
 
-RTE_PMD_REGISTER_PCI(net_vmxnet3, rte_vmxnet3_pmd.pci_drv);
+RTE_PMD_REGISTER_PCI(net_vmxnet3, rte_vmxnet3_pmd);
 RTE_PMD_REGISTER_PCI_TABLE(net_vmxnet3, pci_id_vmxnet3_map);
 RTE_PMD_REGISTER_KMOD_DEP(net_vmxnet3, "* igb_uio | uio_pci_generic | vfio");
-- 
2.1.4

[PATCH v2 36/42] net/avp: Don't use eth_driver

From: Gaetan Rivet <hidden>
Date: 2017-04-11 15:45:41

Signed-off-by: Gaetan Rivet <redacted>
---
 drivers/net/avp/avp_ethdev.c | 43 ++++++++++++++++++++++++++++++++-----------
 1 file changed, 32 insertions(+), 11 deletions(-)
diff --git a/drivers/net/avp/avp_ethdev.c b/drivers/net/avp/avp_ethdev.c
index 7f2ab47..9ca2786 100644
--- a/drivers/net/avp/avp_ethdev.c
+++ b/drivers/net/avp/avp_ethdev.c
@@ -37,6 +37,7 @@
 #include <unistd.h>
 
 #include <rte_ethdev.h>
+#include <rte_ethdev_pci.h>
 #include <rte_memcpy.h>
 #include <rte_string_fns.h>
 #include <rte_memzone.h>
@@ -1076,17 +1077,37 @@ eth_avp_dev_uninit(struct rte_eth_dev *eth_dev)
 	return 0;
 }
 
+static int
+eth_avp_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
+		  struct rte_pci_device *pci_dev)
+{
+	struct rte_eth_dev *eth_dev;
+	int ret;
 
-static struct eth_driver rte_avp_pmd = {
-	{
-		.id_table = pci_id_avp_map,
-		.drv_flags = RTE_PCI_DRV_NEED_MAPPING,
-		.probe = rte_eth_dev_pci_probe,
-		.remove = rte_eth_dev_pci_remove,
-	},
-	.eth_dev_init = eth_avp_dev_init,
-	.eth_dev_uninit = eth_avp_dev_uninit,
-	.dev_private_size = sizeof(struct avp_adapter),
+	eth_dev = rte_eth_dev_pci_allocate(pci_dev,
+					   sizeof(struct avp_adapter));
+	if (eth_dev == NULL)
+		return -ENOMEM;
+
+	ret = eth_avp_dev_init(eth_dev);
+	if (ret)
+		rte_eth_dev_pci_release(eth_dev);
+
+	return ret;
+}
+
+static int
+eth_avp_pci_remove(struct rte_pci_device *pci_dev)
+{
+	return rte_eth_dev_pci_generic_remove(pci_dev,
+					      eth_avp_dev_uninit);
+}
+
+static struct rte_pci_driver rte_avp_pmd = {
+	.id_table = pci_id_avp_map,
+	.drv_flags = RTE_PCI_DRV_NEED_MAPPING,
+	.probe = eth_avp_pci_probe,
+	.remove = eth_avp_pci_remove,
 };
 
 static int
@@ -2287,5 +2308,5 @@ avp_dev_stats_reset(struct rte_eth_dev *eth_dev)
 	}
 }
 
-RTE_PMD_REGISTER_PCI(net_avp, rte_avp_pmd.pci_drv);
+RTE_PMD_REGISTER_PCI(net_avp, rte_avp_pmd);
 RTE_PMD_REGISTER_PCI_TABLE(net_avp, pci_id_avp_map);
-- 
2.1.4

[PATCH v2 37/42] net/liquidio: Don't use eth_driver

From: Gaetan Rivet <hidden>
Date: 2017-04-11 15:45:42

Signed-off-by: Gaetan Rivet <redacted>
---
 drivers/net/liquidio/lio_ethdev.c | 44 +++++++++++++++++++++++++++++----------
 1 file changed, 33 insertions(+), 11 deletions(-)
diff --git a/drivers/net/liquidio/lio_ethdev.c b/drivers/net/liquidio/lio_ethdev.c
index df91659..4edb0d1 100644
--- a/drivers/net/liquidio/lio_ethdev.c
+++ b/drivers/net/liquidio/lio_ethdev.c
@@ -32,6 +32,7 @@
  */
 
 #include <rte_ethdev.h>
+#include <rte_ethdev_pci.h>
 #include <rte_cycles.h>
 #include <rte_malloc.h>
 #include <rte_alarm.h>
@@ -2011,24 +2012,45 @@ lio_eth_dev_init(struct rte_eth_dev *eth_dev)
 	return 0;
 }
 
+static int
+lio_eth_dev_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
+		      struct rte_pci_device *pci_dev)
+{
+	struct rte_eth_dev *eth_dev;
+	int ret;
+
+	eth_dev = rte_eth_dev_pci_allocate(pci_dev,
+					   sizeof(struct lio_device));
+	if (eth_dev == NULL)
+		return -ENOMEM;
+
+	ret = lio_eth_dev_init(eth_dev);
+	if (ret)
+		rte_eth_dev_pci_release(eth_dev);
+
+	return ret;
+}
+
+static int
+lio_eth_dev_pci_remove(struct rte_pci_device *pci_dev)
+{
+	return rte_eth_dev_pci_generic_remove(pci_dev,
+					      lio_eth_dev_uninit);
+}
+
 /* Set of PCI devices this driver supports */
 static const struct rte_pci_id pci_id_liovf_map[] = {
 	{ RTE_PCI_DEVICE(PCI_VENDOR_ID_CAVIUM, LIO_CN23XX_VF_VID) },
 	{ .vendor_id = 0, /* sentinel */ }
 };
 
-static struct eth_driver rte_liovf_pmd = {
-	.pci_drv = {
-		.id_table	= pci_id_liovf_map,
-		.drv_flags      = RTE_PCI_DRV_NEED_MAPPING,
-		.probe		= rte_eth_dev_pci_probe,
-		.remove		= rte_eth_dev_pci_remove,
-	},
-	.eth_dev_init		= lio_eth_dev_init,
-	.eth_dev_uninit		= lio_eth_dev_uninit,
-	.dev_private_size	= sizeof(struct lio_device),
+static struct rte_pci_driver rte_liovf_pmd = {
+	.id_table	= pci_id_liovf_map,
+	.drv_flags      = RTE_PCI_DRV_NEED_MAPPING,
+	.probe		= lio_eth_dev_pci_probe,
+	.remove		= lio_eth_dev_pci_remove,
 };
 
-RTE_PMD_REGISTER_PCI(net_liovf, rte_liovf_pmd.pci_drv);
+RTE_PMD_REGISTER_PCI(net_liovf, rte_liovf_pmd);
 RTE_PMD_REGISTER_PCI_TABLE(net_liovf, pci_id_liovf_map);
 RTE_PMD_REGISTER_KMOD_DEP(net_liovf, "* igb_uio | vfio");
-- 
2.1.4

[PATCH v2 38/42] ethdev: remove unused ethdev PCI probe/remove

From: Gaetan Rivet <hidden>
Date: 2017-04-11 15:45:43

From: Jan Blunck <redacted>

This removes the now unused rte_eth_dev_pci_probe() and
rte_eth_dev_pci_remove() functions.

Signed-off-by: Jan Blunck <redacted>
---
 lib/librte_ether/rte_ethdev.c          | 97 ----------------------------------
 lib/librte_ether/rte_ethdev.h          | 15 ------
 lib/librte_ether/rte_ethdev_pci.h      | 10 ++++
 lib/librte_ether/rte_ether_version.map | 10 +---
 4 files changed, 11 insertions(+), 121 deletions(-)
diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index 6ed2321..5bb016d 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -285,103 +285,6 @@ rte_eth_dev_release_port(struct rte_eth_dev *eth_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;
-	char ethdev_name[RTE_ETH_NAME_MAX_LEN];
-
-	int diag;
-
-	eth_drv = (struct eth_driver *)pci_drv;
-
-	rte_eal_pci_device_name(&pci_dev->addr, ethdev_name,
-			sizeof(ethdev_name));
-
-	if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
-		eth_dev = rte_eth_dev_allocate(ethdev_name);
-		if (eth_dev == NULL)
-			return -ENOMEM;
-
-		eth_dev->data->dev_private = rte_zmalloc("ethdev private structure",
-				  eth_drv->dev_private_size,
-				  RTE_CACHE_LINE_SIZE);
-		if (eth_dev->data->dev_private == NULL)
-			rte_panic("Cannot allocate memzone for private port data\n");
-	} else {
-		eth_dev = rte_eth_dev_attach_secondary(ethdev_name);
-		if (eth_dev == NULL) {
-			/*
-			 * if we failed to attach a device, it means the
-			 * device is skipped in primary process, due to
-			 * some errors. If so, we return a positive value,
-			 * to let EAL skip it for the secondary process
-			 * as well.
-			 */
-			return 1;
-		}
-	}
-	eth_dev->device = &pci_dev->device;
-	eth_dev->intr_handle = &pci_dev->intr_handle;
-	eth_dev->driver = eth_drv;
-
-	/* Invoke PMD device initialization function */
-	diag = (*eth_drv->eth_dev_init)(eth_dev);
-	if (diag == 0)
-		return 0;
-
-	RTE_PMD_DEBUG_TRACE("driver %s: eth_dev_init(vendor_id=0x%x device_id=0x%x) failed\n",
-			pci_drv->driver.name,
-			(unsigned) pci_dev->id.vendor_id,
-			(unsigned) pci_dev->id.device_id);
-	if (rte_eal_process_type() == RTE_PROC_PRIMARY)
-		rte_free(eth_dev->data->dev_private);
-	rte_eth_dev_release_port(eth_dev);
-	return diag;
-}
-
-int
-rte_eth_dev_pci_remove(struct rte_pci_device *pci_dev)
-{
-	const struct eth_driver *eth_drv;
-	struct rte_eth_dev *eth_dev;
-	char ethdev_name[RTE_ETH_NAME_MAX_LEN];
-	int ret;
-
-	if (pci_dev == NULL)
-		return -EINVAL;
-
-	rte_eal_pci_device_name(&pci_dev->addr, ethdev_name,
-			sizeof(ethdev_name));
-
-	eth_dev = rte_eth_dev_allocated(ethdev_name);
-	if (eth_dev == NULL)
-		return -ENODEV;
-
-	eth_drv = (const struct eth_driver *)pci_dev->driver;
-
-	/* Invoke PMD device uninit function */
-	if (*eth_drv->eth_dev_uninit) {
-		ret = (*eth_drv->eth_dev_uninit)(eth_dev);
-		if (ret)
-			return ret;
-	}
-
-	/* free ether device */
-	rte_eth_dev_release_port(eth_dev);
-
-	if (rte_eal_process_type() == RTE_PROC_PRIMARY)
-		rte_free(eth_dev->data->dev_private);
-
-	eth_dev->device = NULL;
-	eth_dev->driver = NULL;
-	eth_dev->data = NULL;
-
-	return 0;
-}
-
-int
 rte_eth_dev_is_valid_port(uint8_t port_id)
 {
 	if (port_id >= RTE_MAX_ETHPORTS ||
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 8cd1a11..abef70f 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -4608,21 +4608,6 @@ rte_eth_dev_get_port_by_name(const char *name, uint8_t *port_id);
 int
 rte_eth_dev_get_name_by_port(uint8_t port_id, char *name);
 
-/**
- * @internal
- * Wrapper for use by pci drivers as a .probe 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);
-
-/**
- * @internal
- * Wrapper for use by pci drivers as a .remove 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_ethdev_pci.h b/lib/librte_ether/rte_ethdev_pci.h
index 4b728db..fe62589 100644
--- a/lib/librte_ether/rte_ethdev_pci.h
+++ b/lib/librte_ether/rte_ethdev_pci.h
@@ -108,6 +108,11 @@ rte_eth_dev_pci_release(struct rte_eth_dev *eth_dev)
 
 typedef int (*eth_dev_pci_callback_t)(struct rte_eth_dev *eth_dev);
 
+/**
+ * @internal
+ * Wrapper for use by pci drivers in a .probe function to attach to a ethdev
+ * interface.
+ */
 static inline int
 rte_eth_dev_pci_generic_probe(struct rte_pci_device *pci_dev,
 	size_t private_data_size, eth_dev_pci_callback_t dev_init)
@@ -127,6 +132,11 @@ rte_eth_dev_pci_generic_probe(struct rte_pci_device *pci_dev,
 	return ret;
 }
 
+/**
+ * @internal
+ * Wrapper for use by pci drivers in a .remove function to detach a ethdev
+ * interface.
+ */
 static inline int
 rte_eth_dev_pci_generic_remove(struct rte_pci_device *pci_dev,
 	eth_dev_pci_callback_t dev_uninit)
diff --git a/lib/librte_ether/rte_ether_version.map b/lib/librte_ether/rte_ether_version.map
index f2bed58..b95312f 100644
--- a/lib/librte_ether/rte_ether_version.map
+++ b/lib/librte_ether/rte_ether_version.map
@@ -134,14 +134,6 @@ DPDK_16.07 {
 
 } DPDK_16.04;
 
-DPDK_16.11 {
-	global:
-
-	rte_eth_dev_pci_probe;
-	rte_eth_dev_pci_remove;
-
-} DPDK_16.07;
-
 DPDK_17.02 {
 	global:
 
@@ -153,7 +145,7 @@ DPDK_17.02 {
 	rte_flow_query;
 	rte_flow_validate;
 
-} DPDK_16.11;
+} DPDK_16.07;
 
 DPDK_17.05 {
 	global:
-- 
2.1.4

[PATCH v2 40/42] test: remove unused ethdev driver

From: Gaetan Rivet <hidden>
Date: 2017-04-11 15:45:45

Signed-off-by: Gaetan Rivet <redacted>
---
 test/test/virtual_pmd.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/test/test/virtual_pmd.c b/test/test/virtual_pmd.c
index b209355..186d9b7 100644
--- a/test/test/virtual_pmd.c
+++ b/test/test/virtual_pmd.c
@@ -532,7 +532,6 @@ virtual_ethdev_create(const char *name, struct ether_addr *mac_addr,
 {
 	struct rte_pci_device *pci_dev = NULL;
 	struct rte_eth_dev *eth_dev = NULL;
-	struct eth_driver *eth_drv = NULL;
 	struct rte_pci_driver *pci_drv = NULL;
 	struct rte_pci_id *id_table = NULL;
 	struct virtual_ethdev_private *dev_private = NULL;
@@ -550,10 +549,6 @@ virtual_ethdev_create(const char *name, struct ether_addr *mac_addr,
 	if (pci_dev == NULL)
 		goto err;
 
-	eth_drv = rte_zmalloc_socket(name, sizeof(*eth_drv), 0, socket_id);
-	if (eth_drv == NULL)
-		goto err;
-
 	pci_drv = rte_zmalloc_socket(name, sizeof(*pci_drv), 0, socket_id);
 	if (pci_drv == NULL)
 		goto err;
@@ -594,8 +589,8 @@ virtual_ethdev_create(const char *name, struct ether_addr *mac_addr,
 		pci_drv->drv_flags &= ~RTE_PCI_DRV_INTR_LSC;
 
 
-	eth_drv->pci_drv = (struct rte_pci_driver)(*pci_drv);
-	eth_dev->driver = eth_drv;
+	eth_dev->device = &pci_dev->device;
+	eth_dev->device->driver = &pci_drv->driver;
 
 	eth_dev->data->nb_rx_queues = (uint16_t)1;
 	eth_dev->data->nb_tx_queues = (uint16_t)1;
@@ -622,7 +617,7 @@ virtual_ethdev_create(const char *name, struct ether_addr *mac_addr,
 	dev_private->dev_ops = virtual_ethdev_default_dev_ops;
 	eth_dev->dev_ops = &dev_private->dev_ops;
 
-	pci_dev->device.driver = &eth_drv->pci_drv.driver;
+	pci_dev->device.driver = &pci_drv->driver;
 	eth_dev->device = &pci_dev->device;
 
 	eth_dev->rx_pkt_burst = virtual_ethdev_rx_burst_success;
@@ -633,7 +628,6 @@ virtual_ethdev_create(const char *name, struct ether_addr *mac_addr,
 err:
 	rte_free(pci_dev);
 	rte_free(pci_drv);
-	rte_free(eth_drv);
 	rte_free(id_table);
 	rte_free(dev_private);
 
-- 
2.1.4

[PATCH v2 39/42] ethdev: remove unused ethdev driver

From: Gaetan Rivet <hidden>
Date: 2017-04-11 15:45:45

From: Jan Blunck <redacted>

This removes the now unused struct eth_driver.

Signed-off-by: Jan Blunck <redacted>
---
 drivers/net/cxgbe/cxgbe_main.c     |  1 -
 drivers/net/ring/rte_eth_ring.c    |  1 -
 lib/librte_ether/rte_ethdev.h      | 73 --------------------------------------
 lib/librte_ether/rte_ethdev_pci.h  |  2 --
 lib/librte_ether/rte_ethdev_vdev.h |  1 -
 5 files changed, 78 deletions(-)
diff --git a/drivers/net/cxgbe/cxgbe_main.c b/drivers/net/cxgbe/cxgbe_main.c
index 541fc40..f895b18 100644
--- a/drivers/net/cxgbe/cxgbe_main.c
+++ b/drivers/net/cxgbe/cxgbe_main.c
@@ -1165,7 +1165,6 @@ int cxgbe_probe(struct adapter *adapter)
 allocate_mac:
 		pi->eth_dev->device = &adapter->pdev->device;
 		pi->eth_dev->data->dev_private = pi;
-		pi->eth_dev->driver = adapter->eth_dev->driver;
 		pi->eth_dev->dev_ops = adapter->eth_dev->dev_ops;
 		pi->eth_dev->tx_pkt_burst = adapter->eth_dev->tx_pkt_burst;
 		pi->eth_dev->rx_pkt_burst = adapter->eth_dev->rx_pkt_burst;
diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c
index 4bae895..36867e6 100644
--- a/drivers/net/ring/rte_eth_ring.c
+++ b/drivers/net/ring/rte_eth_ring.c
@@ -338,7 +338,6 @@ do_eth_dev_ring_create(const char *name,
 	data->mac_addrs = &internals->address;
 
 	eth_dev->data = data;
-	eth_dev->driver = NULL;
 	eth_dev->dev_ops = &ops;
 	data->dev_flags = RTE_ETH_DEV_DETACHABLE;
 	data->kdrv = RTE_KDRV_NONE;
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index abef70f..9fb8432 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -1651,7 +1651,6 @@ struct rte_eth_dev {
 	eth_tx_burst_t tx_pkt_burst; /**< Pointer to PMD transmit function. */
 	eth_tx_prep_t tx_pkt_prepare; /**< Pointer to PMD transmit prepare function. */
 	struct rte_eth_dev_data *data;  /**< Pointer to device data */
-	const struct eth_driver *driver;/**< Driver for this device */
 	const struct eth_dev_ops *dev_ops; /**< Functions exported by PMD */
 	struct rte_device *device; /**< Backing device */
 	struct rte_intr_handle *intr_handle; /**< Device interrupt handle */
@@ -1854,78 +1853,6 @@ int rte_eth_dev_attach(const char *devargs, uint8_t *port_id);
  */
 int rte_eth_dev_detach(uint8_t port_id, char *devname);
 
-struct eth_driver;
-/**
- * @internal
- * Initialization function of an Ethernet driver invoked for each matching
- * Ethernet PCI device detected during the PCI probing phase.
- *
- * @param eth_dev
- *   The *eth_dev* pointer is the address of the *rte_eth_dev* structure
- *   associated with the matching device and which have been [automatically]
- *   allocated in the *rte_eth_devices* array.
- *   The *eth_dev* structure is supplied to the driver initialization function
- *   with the following fields already initialized:
- *
- *   - *pci_dev*: Holds the pointers to the *rte_pci_device* structure which
- *     contains the generic PCI information of the matching device.
- *
- *   - *driver*: Holds the pointer to the *eth_driver* structure.
- *
- *   - *dev_private*: Holds a pointer to the device private data structure.
- *
- *   - *mtu*: Contains the default Ethernet maximum frame length (1500).
- *
- *   - *port_id*: Contains the port index of the device (actually the index
- *     of the *eth_dev* structure in the *rte_eth_devices* array).
- *
- * @return
- *   - 0: Success, the device is properly initialized by the driver.
- *        In particular, the driver MUST have set up the *dev_ops* pointer
- *        of the *eth_dev* structure.
- *   - <0: Error code of the device initialization failure.
- */
-typedef int (*eth_dev_init_t)(struct rte_eth_dev *eth_dev);
-
-/**
- * @internal
- * Finalization function of an Ethernet driver invoked for each matching
- * Ethernet PCI device detected during the PCI closing phase.
- *
- * @param eth_dev
- *   The *eth_dev* pointer is the address of the *rte_eth_dev* structure
- *   associated with the matching device and which have been [automatically]
- *   allocated in the *rte_eth_devices* array.
- * @return
- *   - 0: Success, the device is properly finalized by the driver.
- *        In particular, the driver MUST free the *dev_ops* pointer
- *        of the *eth_dev* structure.
- *   - <0: Error code of the device initialization failure.
- */
-typedef int (*eth_dev_uninit_t)(struct rte_eth_dev *eth_dev);
-
-/**
- * @internal
- * The structure associated with a PMD Ethernet driver.
- *
- * Each Ethernet driver acts as a PCI driver and is represented by a generic
- * *eth_driver* structure that holds:
- *
- * - An *rte_pci_driver* structure (which must be the first field).
- *
- * - The *eth_dev_init* function invoked for each matching PCI device.
- *
- * - The *eth_dev_uninit* function invoked for each matching PCI device.
- *
- * - The size of the private data to allocate for each matching device.
- */
-struct eth_driver {
-	struct rte_pci_driver pci_drv;    /**< The PMD is also a PCI driver. */
-	eth_dev_init_t eth_dev_init;      /**< Device init function. */
-	eth_dev_uninit_t eth_dev_uninit;  /**< Device uninit function. */
-	unsigned int dev_private_size;    /**< Size of device private data. */
-};
-
 /**
  * Convert a numerical speed in Mbps to a bitmap flag that can be used in
  * the bitmap link_speeds of the struct rte_eth_conf
diff --git a/lib/librte_ether/rte_ethdev_pci.h b/lib/librte_ether/rte_ethdev_pci.h
index fe62589..f85d26f 100644
--- a/lib/librte_ether/rte_ethdev_pci.h
+++ b/lib/librte_ether/rte_ethdev_pci.h
@@ -84,7 +84,6 @@ rte_eth_dev_pci_allocate(struct rte_pci_device *dev, size_t private_data_size)
 	}
 
 	eth_dev->device = &dev->device;
-	eth_dev->driver = NULL;
 	eth_dev->intr_handle = &dev->intr_handle;
 	rte_eth_copy_pci_info(eth_dev, dev);
 	return eth_dev;
@@ -102,7 +101,6 @@ rte_eth_dev_pci_release(struct rte_eth_dev *eth_dev)
 	eth_dev->data->dev_private = NULL;
 
 	eth_dev->device = NULL;
-	eth_dev->driver = NULL;
 	eth_dev->intr_handle = NULL;
 }
 
diff --git a/lib/librte_ether/rte_ethdev_vdev.h b/lib/librte_ether/rte_ethdev_vdev.h
index 0b47535..fa2cb61 100644
--- a/lib/librte_ether/rte_ethdev_vdev.h
+++ b/lib/librte_ether/rte_ethdev_vdev.h
@@ -73,7 +73,6 @@ rte_eth_vdev_allocate(struct rte_vdev_device *dev, size_t private_data_size)
 	}
 
 	eth_dev->device = &dev->device;
-	eth_dev->driver = NULL;
 	eth_dev->intr_handle = NULL;
 
 	eth_dev->data->kdrv = RTE_KDRV_NONE;
-- 
2.1.4

[PATCH v2 41/42] ethdev: remove PCI specific helper from generic ethdev header

From: Gaetan Rivet <hidden>
Date: 2017-04-11 15:45:46

From: Jan Blunck <redacted>

This moves the rte_eth_copy_pci_info() into the PCI specific ethdev
header. As a side effect this also removes it from the list of symbols
exported by the rte_ethdev library.

Signed-off-by: Jan Blunck <redacted>
---
 drivers/net/cxgbe/cxgbe_main.c         |  1 +
 lib/librte_ether/rte_ethdev.c          | 20 --------------------
 lib/librte_ether/rte_ethdev.h          | 14 --------------
 lib/librte_ether/rte_ethdev_pci.h      | 32 ++++++++++++++++++++++++++++++++
 lib/librte_ether/rte_ether_version.map |  1 -
 5 files changed, 33 insertions(+), 35 deletions(-)
diff --git a/drivers/net/cxgbe/cxgbe_main.c b/drivers/net/cxgbe/cxgbe_main.c
index f895b18..1f230cd 100644
--- a/drivers/net/cxgbe/cxgbe_main.c
+++ b/drivers/net/cxgbe/cxgbe_main.c
@@ -57,6 +57,7 @@
 #include <rte_alarm.h>
 #include <rte_ether.h>
 #include <rte_ethdev.h>
+#include <rte_ethdev_pci.h>
 #include <rte_atomic.h>
 #include <rte_malloc.h>
 #include <rte_random.h>
diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index 5bb016d..474188c 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -3117,26 +3117,6 @@ rte_eth_dev_get_dcb_info(uint8_t port_id,
 	return (*dev->dev_ops->get_dcb_info)(dev, dcb_info);
 }
 
-void
-rte_eth_copy_pci_info(struct rte_eth_dev *eth_dev, struct rte_pci_device *pci_dev)
-{
-	if ((eth_dev == NULL) || (pci_dev == NULL)) {
-		RTE_PMD_DEBUG_TRACE("NULL pointer eth_dev=%p pci_dev=%p\n",
-				eth_dev, pci_dev);
-		return;
-	}
-
-	eth_dev->intr_handle = &pci_dev->intr_handle;
-
-	eth_dev->data->dev_flags = 0;
-	if (pci_dev->driver->drv_flags & RTE_PCI_DRV_INTR_LSC)
-		eth_dev->data->dev_flags |= RTE_ETH_DEV_INTR_LSC;
-
-	eth_dev->data->kdrv = pci_dev->kdrv;
-	eth_dev->data->numa_node = pci_dev->device.numa_node;
-	eth_dev->data->drv_name = pci_dev->driver->driver.name;
-}
-
 int
 rte_eth_dev_l2_tunnel_eth_type_conf(uint8_t port_id,
 				    struct rte_eth_l2_tunnel_conf *l2_tunnel)
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 9fb8432..bd538b0 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -4422,20 +4422,6 @@ int rte_eth_timesync_read_time(uint8_t port_id, struct timespec *time);
 int rte_eth_timesync_write_time(uint8_t port_id, const struct timespec *time);
 
 /**
- * Copy pci device info to the Ethernet device data.
- *
- * @param eth_dev
- * The *eth_dev* pointer is the address of the *rte_eth_dev* structure.
- * @param pci_dev
- * The *pci_dev* pointer is the address of the *rte_pci_device* structure.
- *
- * @return
- *   - 0 on success, negative on error
- */
-void rte_eth_copy_pci_info(struct rte_eth_dev *eth_dev,
-		struct rte_pci_device *pci_dev);
-
-/**
  * Create memzone for HW rings.
  * malloc can't be used as the physical address is needed.
  * If the memzone is already created, then this function returns a ptr
diff --git a/lib/librte_ether/rte_ethdev_pci.h b/lib/librte_ether/rte_ethdev_pci.h
index f85d26f..2953579 100644
--- a/lib/librte_ether/rte_ethdev_pci.h
+++ b/lib/librte_ether/rte_ethdev_pci.h
@@ -39,6 +39,38 @@
 #include <rte_ethdev.h>
 
 /**
+ * Copy pci device info to the Ethernet device data.
+ *
+ * @param eth_dev
+ * The *eth_dev* pointer is the address of the *rte_eth_dev* structure.
+ * @param pci_dev
+ * The *pci_dev* pointer is the address of the *rte_pci_device* structure.
+ *
+ * @return
+ *   - 0 on success, negative on error
+ */
+static inline void
+rte_eth_copy_pci_info(struct rte_eth_dev *eth_dev,
+	struct rte_pci_device *pci_dev)
+{
+	if ((eth_dev == NULL) || (pci_dev == NULL)) {
+		RTE_PMD_DEBUG_TRACE("NULL pointer eth_dev=%p pci_dev=%p\n",
+				eth_dev, pci_dev);
+		return;
+	}
+
+	eth_dev->intr_handle = &pci_dev->intr_handle;
+
+	eth_dev->data->dev_flags = 0;
+	if (pci_dev->driver->drv_flags & RTE_PCI_DRV_INTR_LSC)
+		eth_dev->data->dev_flags |= RTE_ETH_DEV_INTR_LSC;
+
+	eth_dev->data->kdrv = pci_dev->kdrv;
+	eth_dev->data->numa_node = pci_dev->device.numa_node;
+	eth_dev->data->drv_name = pci_dev->driver->driver.name;
+}
+
+/**
  * @internal
  * Allocates a new ethdev slot for an ethernet device and returns the pointer
  * to that slot for the driver to use.
diff --git a/lib/librte_ether/rte_ether_version.map b/lib/librte_ether/rte_ether_version.map
index b95312f..e6018ae 100644
--- a/lib/librte_ether/rte_ether_version.map
+++ b/lib/librte_ether/rte_ether_version.map
@@ -7,7 +7,6 @@ DPDK_2.2 {
 	rte_eth_allmulticast_disable;
 	rte_eth_allmulticast_enable;
 	rte_eth_allmulticast_get;
-	rte_eth_copy_pci_info;
 	rte_eth_dev_allocate;
 	rte_eth_dev_allocated;
 	rte_eth_dev_attach;
-- 
2.1.4

[PATCH v2 42/42] ethdev: don't include PCI header

From: Gaetan Rivet <hidden>
Date: 2017-04-11 15:45:47

From: Jan Blunck <redacted>

Since the PCI functionality has been moved to the PCI specific ethdev
header we don't need to include rte_pci.h from here anymore.

Signed-off-by: Jan Blunck <redacted>
---
 lib/librte_ether/rte_ethdev.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index bd538b0..68a91e2 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -179,7 +179,6 @@ extern "C" {
 
 #include <rte_log.h>
 #include <rte_interrupts.h>
-#include <rte_pci.h>
 #include <rte_dev.h>
 #include <rte_devargs.h>
 #include <rte_errno.h>
@@ -901,6 +900,8 @@ struct rte_eth_conf {
 #define DEV_TX_OFFLOAD_GENEVE_TNL_TSO   0x00001000    /**< Used for tunneling packet. */
 #define DEV_TX_OFFLOAD_MACSEC_INSERT    0x00002000
 
+struct rte_pci_device;
+
 /**
  * Ethernet device information
  */
-- 
2.1.4

Re: [PATCH v2 36/42] net/avp: Don't use eth_driver

From: Legacy, Allain <hidden>
Date: 2017-04-11 18:48:25

-----Original Message-----
From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Gaetan Rivet
Sent: Tuesday, April 11, 2017 11:45 AM
To: dev@dpdk.org
Cc: Jan Blunck
Subject: [dpdk-dev] [PATCH v2 36/42] net/avp: Don't use eth_driver

Signed-off-by: Gaetan Rivet <redacted>
---
Acked-by: Allain Legacy <redacted>

Re: [PATCH v2 38/42] ethdev: remove unused ethdev PCI probe/remove

From: Neil Horman <nhorman@tuxdriver.com>
Date: 2017-04-12 11:24:48

On Tue, Apr 11, 2017 at 05:44:45PM +0200, Gaetan Rivet wrote:
quoted hunk
From: Jan Blunck <redacted>

This removes the now unused rte_eth_dev_pci_probe() and
rte_eth_dev_pci_remove() functions.

Signed-off-by: Jan Blunck <redacted>
---
 lib/librte_ether/rte_ethdev.c          | 97 ----------------------------------
 lib/librte_ether/rte_ethdev.h          | 15 ------
 lib/librte_ether/rte_ethdev_pci.h      | 10 ++++
 lib/librte_ether/rte_ether_version.map | 10 +---
 4 files changed, 11 insertions(+), 121 deletions(-)
diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index 6ed2321..5bb016d 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -285,103 +285,6 @@ rte_eth_dev_release_port(struct rte_eth_dev *eth_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;
-	char ethdev_name[RTE_ETH_NAME_MAX_LEN];
-
-	int diag;
-
-	eth_drv = (struct eth_driver *)pci_drv;
-
-	rte_eal_pci_device_name(&pci_dev->addr, ethdev_name,
-			sizeof(ethdev_name));
-
-	if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
-		eth_dev = rte_eth_dev_allocate(ethdev_name);
-		if (eth_dev == NULL)
-			return -ENOMEM;
-
-		eth_dev->data->dev_private = rte_zmalloc("ethdev private structure",
-				  eth_drv->dev_private_size,
-				  RTE_CACHE_LINE_SIZE);
-		if (eth_dev->data->dev_private == NULL)
-			rte_panic("Cannot allocate memzone for private port data\n");
-	} else {
-		eth_dev = rte_eth_dev_attach_secondary(ethdev_name);
-		if (eth_dev == NULL) {
-			/*
-			 * if we failed to attach a device, it means the
-			 * device is skipped in primary process, due to
-			 * some errors. If so, we return a positive value,
-			 * to let EAL skip it for the secondary process
-			 * as well.
-			 */
-			return 1;
-		}
-	}
-	eth_dev->device = &pci_dev->device;
-	eth_dev->intr_handle = &pci_dev->intr_handle;
-	eth_dev->driver = eth_drv;
-
-	/* Invoke PMD device initialization function */
-	diag = (*eth_drv->eth_dev_init)(eth_dev);
-	if (diag == 0)
-		return 0;
-
-	RTE_PMD_DEBUG_TRACE("driver %s: eth_dev_init(vendor_id=0x%x device_id=0x%x) failed\n",
-			pci_drv->driver.name,
-			(unsigned) pci_dev->id.vendor_id,
-			(unsigned) pci_dev->id.device_id);
-	if (rte_eal_process_type() == RTE_PROC_PRIMARY)
-		rte_free(eth_dev->data->dev_private);
-	rte_eth_dev_release_port(eth_dev);
-	return diag;
-}
-
-int
-rte_eth_dev_pci_remove(struct rte_pci_device *pci_dev)
-{
-	const struct eth_driver *eth_drv;
-	struct rte_eth_dev *eth_dev;
-	char ethdev_name[RTE_ETH_NAME_MAX_LEN];
-	int ret;
-
-	if (pci_dev == NULL)
-		return -EINVAL;
-
-	rte_eal_pci_device_name(&pci_dev->addr, ethdev_name,
-			sizeof(ethdev_name));
-
-	eth_dev = rte_eth_dev_allocated(ethdev_name);
-	if (eth_dev == NULL)
-		return -ENODEV;
-
-	eth_drv = (const struct eth_driver *)pci_dev->driver;
-
-	/* Invoke PMD device uninit function */
-	if (*eth_drv->eth_dev_uninit) {
-		ret = (*eth_drv->eth_dev_uninit)(eth_dev);
-		if (ret)
-			return ret;
-	}
-
-	/* free ether device */
-	rte_eth_dev_release_port(eth_dev);
-
-	if (rte_eal_process_type() == RTE_PROC_PRIMARY)
-		rte_free(eth_dev->data->dev_private);
-
-	eth_dev->device = NULL;
-	eth_dev->driver = NULL;
-	eth_dev->data = NULL;
-
-	return 0;
-}
-
-int
 rte_eth_dev_is_valid_port(uint8_t port_id)
 {
 	if (port_id >= RTE_MAX_ETHPORTS ||
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 8cd1a11..abef70f 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -4608,21 +4608,6 @@ rte_eth_dev_get_port_by_name(const char *name, uint8_t *port_id);
 int
 rte_eth_dev_get_name_by_port(uint8_t port_id, char *name);
 
-/**
- * @internal
- * Wrapper for use by pci drivers as a .probe 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);
-
-/**
- * @internal
- * Wrapper for use by pci drivers as a .remove 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_ethdev_pci.h b/lib/librte_ether/rte_ethdev_pci.h
index 4b728db..fe62589 100644
--- a/lib/librte_ether/rte_ethdev_pci.h
+++ b/lib/librte_ether/rte_ethdev_pci.h
@@ -108,6 +108,11 @@ rte_eth_dev_pci_release(struct rte_eth_dev *eth_dev)
 
 typedef int (*eth_dev_pci_callback_t)(struct rte_eth_dev *eth_dev);
 
+/**
+ * @internal
+ * Wrapper for use by pci drivers in a .probe function to attach to a ethdev
+ * interface.
+ */
 static inline int
 rte_eth_dev_pci_generic_probe(struct rte_pci_device *pci_dev,
 	size_t private_data_size, eth_dev_pci_callback_t dev_init)
@@ -127,6 +132,11 @@ rte_eth_dev_pci_generic_probe(struct rte_pci_device *pci_dev,
 	return ret;
 }
 
+/**
+ * @internal
+ * Wrapper for use by pci drivers in a .remove function to detach a ethdev
+ * interface.
+ */
 static inline int
 rte_eth_dev_pci_generic_remove(struct rte_pci_device *pci_dev,
 	eth_dev_pci_callback_t dev_uninit)
diff --git a/lib/librte_ether/rte_ether_version.map b/lib/librte_ether/rte_ether_version.map
index f2bed58..b95312f 100644
--- a/lib/librte_ether/rte_ether_version.map
+++ b/lib/librte_ether/rte_ether_version.map
@@ -134,14 +134,6 @@ DPDK_16.07 {
 
 } DPDK_16.04;
 
-DPDK_16.11 {
-	global:
-
-	rte_eth_dev_pci_probe;
-	rte_eth_dev_pci_remove;
-
-} DPDK_16.07;
-
 DPDK_17.02 {
 	global:
 
@@ -153,7 +145,7 @@ DPDK_17.02 {
 	rte_flow_query;
 	rte_flow_validate;
 
-} DPDK_16.11;
+} DPDK_16.07;
 
 DPDK_17.05 {
 	global:
-- 
2.1.4
given that this was an exported function, there may be other application out
there using this method.  You need to go through the deprecation process before
this can be integrated.

Neil

Re: [PATCH v2 38/42] ethdev: remove unused ethdev PCI probe/remove

From: Neil Horman <nhorman@tuxdriver.com>
Date: 2017-04-12 11:29:06

On Wed, Apr 12, 2017 at 07:24:26AM -0400, Neil Horman wrote:
On Tue, Apr 11, 2017 at 05:44:45PM +0200, Gaetan Rivet wrote:
quoted
From: Jan Blunck <redacted>

This removes the now unused rte_eth_dev_pci_probe() and
rte_eth_dev_pci_remove() functions.

Signed-off-by: Jan Blunck <redacted>
---
 lib/librte_ether/rte_ethdev.c          | 97 ----------------------------------
 lib/librte_ether/rte_ethdev.h          | 15 ------
 lib/librte_ether/rte_ethdev_pci.h      | 10 ++++
 lib/librte_ether/rte_ether_version.map | 10 +---
 4 files changed, 11 insertions(+), 121 deletions(-)
diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index 6ed2321..5bb016d 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -285,103 +285,6 @@ rte_eth_dev_release_port(struct rte_eth_dev *eth_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;
-	char ethdev_name[RTE_ETH_NAME_MAX_LEN];
-
-	int diag;
-
-	eth_drv = (struct eth_driver *)pci_drv;
-
-	rte_eal_pci_device_name(&pci_dev->addr, ethdev_name,
-			sizeof(ethdev_name));
-
-	if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
-		eth_dev = rte_eth_dev_allocate(ethdev_name);
-		if (eth_dev == NULL)
-			return -ENOMEM;
-
-		eth_dev->data->dev_private = rte_zmalloc("ethdev private structure",
-				  eth_drv->dev_private_size,
-				  RTE_CACHE_LINE_SIZE);
-		if (eth_dev->data->dev_private == NULL)
-			rte_panic("Cannot allocate memzone for private port data\n");
-	} else {
-		eth_dev = rte_eth_dev_attach_secondary(ethdev_name);
-		if (eth_dev == NULL) {
-			/*
-			 * if we failed to attach a device, it means the
-			 * device is skipped in primary process, due to
-			 * some errors. If so, we return a positive value,
-			 * to let EAL skip it for the secondary process
-			 * as well.
-			 */
-			return 1;
-		}
-	}
-	eth_dev->device = &pci_dev->device;
-	eth_dev->intr_handle = &pci_dev->intr_handle;
-	eth_dev->driver = eth_drv;
-
-	/* Invoke PMD device initialization function */
-	diag = (*eth_drv->eth_dev_init)(eth_dev);
-	if (diag == 0)
-		return 0;
-
-	RTE_PMD_DEBUG_TRACE("driver %s: eth_dev_init(vendor_id=0x%x device_id=0x%x) failed\n",
-			pci_drv->driver.name,
-			(unsigned) pci_dev->id.vendor_id,
-			(unsigned) pci_dev->id.device_id);
-	if (rte_eal_process_type() == RTE_PROC_PRIMARY)
-		rte_free(eth_dev->data->dev_private);
-	rte_eth_dev_release_port(eth_dev);
-	return diag;
-}
-
-int
-rte_eth_dev_pci_remove(struct rte_pci_device *pci_dev)
-{
-	const struct eth_driver *eth_drv;
-	struct rte_eth_dev *eth_dev;
-	char ethdev_name[RTE_ETH_NAME_MAX_LEN];
-	int ret;
-
-	if (pci_dev == NULL)
-		return -EINVAL;
-
-	rte_eal_pci_device_name(&pci_dev->addr, ethdev_name,
-			sizeof(ethdev_name));
-
-	eth_dev = rte_eth_dev_allocated(ethdev_name);
-	if (eth_dev == NULL)
-		return -ENODEV;
-
-	eth_drv = (const struct eth_driver *)pci_dev->driver;
-
-	/* Invoke PMD device uninit function */
-	if (*eth_drv->eth_dev_uninit) {
-		ret = (*eth_drv->eth_dev_uninit)(eth_dev);
-		if (ret)
-			return ret;
-	}
-
-	/* free ether device */
-	rte_eth_dev_release_port(eth_dev);
-
-	if (rte_eal_process_type() == RTE_PROC_PRIMARY)
-		rte_free(eth_dev->data->dev_private);
-
-	eth_dev->device = NULL;
-	eth_dev->driver = NULL;
-	eth_dev->data = NULL;
-
-	return 0;
-}
-
-int
 rte_eth_dev_is_valid_port(uint8_t port_id)
 {
 	if (port_id >= RTE_MAX_ETHPORTS ||
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 8cd1a11..abef70f 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -4608,21 +4608,6 @@ rte_eth_dev_get_port_by_name(const char *name, uint8_t *port_id);
 int
 rte_eth_dev_get_name_by_port(uint8_t port_id, char *name);
 
-/**
- * @internal
- * Wrapper for use by pci drivers as a .probe 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);
-
-/**
- * @internal
- * Wrapper for use by pci drivers as a .remove 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_ethdev_pci.h b/lib/librte_ether/rte_ethdev_pci.h
index 4b728db..fe62589 100644
--- a/lib/librte_ether/rte_ethdev_pci.h
+++ b/lib/librte_ether/rte_ethdev_pci.h
@@ -108,6 +108,11 @@ rte_eth_dev_pci_release(struct rte_eth_dev *eth_dev)
 
 typedef int (*eth_dev_pci_callback_t)(struct rte_eth_dev *eth_dev);
 
+/**
+ * @internal
+ * Wrapper for use by pci drivers in a .probe function to attach to a ethdev
+ * interface.
+ */
 static inline int
 rte_eth_dev_pci_generic_probe(struct rte_pci_device *pci_dev,
 	size_t private_data_size, eth_dev_pci_callback_t dev_init)
@@ -127,6 +132,11 @@ rte_eth_dev_pci_generic_probe(struct rte_pci_device *pci_dev,
 	return ret;
 }
 
+/**
+ * @internal
+ * Wrapper for use by pci drivers in a .remove function to detach a ethdev
+ * interface.
+ */
 static inline int
 rte_eth_dev_pci_generic_remove(struct rte_pci_device *pci_dev,
 	eth_dev_pci_callback_t dev_uninit)
diff --git a/lib/librte_ether/rte_ether_version.map b/lib/librte_ether/rte_ether_version.map
index f2bed58..b95312f 100644
--- a/lib/librte_ether/rte_ether_version.map
+++ b/lib/librte_ether/rte_ether_version.map
@@ -134,14 +134,6 @@ DPDK_16.07 {
 
 } DPDK_16.04;
 
-DPDK_16.11 {
-	global:
-
-	rte_eth_dev_pci_probe;
-	rte_eth_dev_pci_remove;
-
-} DPDK_16.07;
-
 DPDK_17.02 {
 	global:
 
@@ -153,7 +145,7 @@ DPDK_17.02 {
 	rte_flow_query;
 	rte_flow_validate;
 
-} DPDK_16.11;
+} DPDK_16.07;
 
 DPDK_17.05 {
 	global:
-- 
2.1.4
given that this was an exported function, there may be other application out
there using this method.  You need to go through the deprecation process before
this can be integrated.

Neil
Scratch that, was looking at an old version of the deprecation file, this has
already been announced.

Neil

Re: [PATCH v2 00/42] Remove struct eth_driver

From: Stephen Hemminger <stephen@networkplumber.org>
Date: 2017-04-12 16:25:21

On Tue, 11 Apr 2017 17:44:07 +0200
Gaetan Rivet [off-list ref] wrote:
I rebased the following work of Jan:

This series is removing the PCI specific struct eth_driver from rte_ether. The
PCI drivers are changed to use the newly introduced header-only helpers
instead. Although the virtual drivers did not make use of the ethdev's driver
field they are converted to use the VDEV specific allocation helpers. The
motivation for this change is to properly embed a reference to the generic
rte_device in the ethdev.

The series is based on:

* http://dpdk.org/dev/patchwork/patch/20416/
* http://dpdk.org/dev/patchwork/patch/20417/
* The "Rework vdev probing to use rte_bus infrastructure" series
* http://dpdk.org/dev/patchwork/patch/21058/

Changes in v2:
 * Removed the patch "net/vmxnet3: use library function for DMA zone reserve"
   It is essentially duplicating the following commit:
      04df93d1edac ("net/vmxnet3: fix queue size changes")
 * Fixed header includes for mlx4 and mlx5 PMD
 * Followed the changes of the series for new PMDs (AVP, liquidio)
 * Made KNI use the new API
 * Made PCAP use the new API
 * Fixed undefined behavior on vdev driver arg parsing
 * Fixed virtual_pmd for unit test

Gaetan Rivet (5):
  net/kni: use ethdev allocation helper for virtual devices
  net/pcap: use ethdev allocation helper for virtual devices
  net/avp: Don't use eth_driver
  net/liquidio: Don't use eth_driver
  test: remove unused ethdev driver

Jan Blunck (37):
  eal: add name field to generic device
  eal: parse "driver" device argument before probing drivers
  net/nfp: use library function for DMA zone reserve
  ether: add allocation helper for virtual drivers
  net/tap: use ethdev allocation helper for virtual devices
  net/vhost: use ethdev allocation helper for virtual devices
  net/virtio: use ethdev allocation helper for virtual devices
  net/af_packet: use ethdev allocation helper for virtual devices
  app/test: don't short-circuit null device creation
  net/null: internalize eth_dev_null_create()
  net/null: use ethdev allocation helper for virtual devices
  net/bonding: make bonding API call through EAL on create/free
  net/bonding: use ethdev allocation helper for virtual devices
  ethdev: add PCI driver helpers
  net/virtio: Don't use eth_driver
  net/bnx2x: Don't use eth_driver
  net/bnxt: Don't use eth_driver
  net/cxgbe: Don't use eth_driver
  net/em: Don't use eth_driver
  net/igb: Don't use eth_driver
  net/ena: Don't use eth_driver
  net/enic: Don't use eth_driver
  net/fm10k: Don't use eth_driver
  net/i40e: Don't use eth_driver
  net/i40evf: Don't use eth_driver
  net/ixgbe: Don't use eth_driver
  net/mlx: Don't reference eth_driver
  net/nfp: Don't use eth_driver
  net/qede: Don't use eth_driver
  net/sfc: Don't use eth_driver
  net/szedata2: Don't use eth_driver
  net/thunderx: Don't use eth_driver
  net/vmxnet3: Don't use eth_driver
  ethdev: remove unused ethdev PCI probe/remove
  ethdev: remove unused ethdev driver
  ethdev: remove PCI specific helper from generic ethdev header
  ethdev: don't include PCI header

 drivers/net/af_packet/rte_eth_af_packet.c |  42 +++----
 drivers/net/avp/avp_ethdev.c              |  43 +++++--
 drivers/net/bnx2x/bnx2x_ethdev.c          |  64 ++++++----
 drivers/net/bnx2x/bnx2x_rxtx.c            |   2 +-
 drivers/net/bnxt/bnxt_ethdev.c            |  36 ++++--
 drivers/net/bonding/rte_eth_bond_api.c    | 171 ++++----------------------
 drivers/net/bonding/rte_eth_bond_args.c   |   2 +-
 drivers/net/bonding/rte_eth_bond_pmd.c    | 160 +++++++++++++++++++++++--
 drivers/net/cxgbe/cxgbe_ethdev.c          |  29 +++--
 drivers/net/cxgbe/cxgbe_main.c            |   2 +-
 drivers/net/cxgbe/sge.c                   |   6 +-
 drivers/net/e1000/em_ethdev.c             |  30 +++--
 drivers/net/e1000/igb_ethdev.c            |  60 ++++++----
 drivers/net/ena/ena_ethdev.c              |  29 +++--
 drivers/net/enic/enic_ethdev.c            |  29 +++--
 drivers/net/fm10k/fm10k_ethdev.c          |  30 +++--
 drivers/net/i40e/i40e_ethdev.c            |  36 +++---
 drivers/net/i40e/i40e_ethdev_vf.c         |  31 +++--
 drivers/net/i40e/i40e_fdir.c              |   2 +-
 drivers/net/ixgbe/ixgbe_ethdev.c          |  66 +++++++----
 drivers/net/kni/rte_eth_kni.c             |  39 +++---
 drivers/net/liquidio/lio_ethdev.c         |  44 +++++--
 drivers/net/mlx4/mlx4.c                   |  24 ++--
 drivers/net/mlx5/mlx5.c                   |  24 ++--
 drivers/net/nfp/nfp_net.c                 |  59 ++++-----
 drivers/net/null/Makefile                 |   7 +-
 drivers/net/null/rte_eth_null.c           |  55 +++------
 drivers/net/null/rte_eth_null.h           |  40 -------
 drivers/net/null/rte_pmd_null_version.map |   7 --
 drivers/net/pcap/rte_eth_pcap.c           |  62 +++++-----
 drivers/net/qede/qede_ethdev.c            |  60 ++++++----
 drivers/net/qede/qede_ethdev.h            |   1 +
 drivers/net/ring/rte_eth_ring.c           |   1 -
 drivers/net/sfc/sfc_ethdev.c              |  34 ++++--
 drivers/net/szedata2/rte_eth_szedata2.c   |  29 +++--
 drivers/net/tap/rte_eth_tap.c             |  38 ++----
 drivers/net/thunderx/nicvf_ethdev.c       |  29 +++--
 drivers/net/vhost/rte_eth_vhost.c         |  54 ++++-----
 drivers/net/virtio/virtio_ethdev.c        |  34 ++++--
 drivers/net/virtio/virtio_user_ethdev.c   |  20 +---
 drivers/net/vmxnet3/vmxnet3_ethdev.c      |  30 +++--
 lib/librte_eal/bsdapp/eal/eal_pci.c       |   3 +
 lib/librte_eal/common/eal_common_dev.c    |   3 +
 lib/librte_eal/common/eal_common_vdev.c   |  53 ++++++++-
 lib/librte_eal/common/include/rte_dev.h   |   1 +
 lib/librte_eal/common/include/rte_pci.h   |   1 +
 lib/librte_eal/linuxapp/eal/eal_pci.c     |   3 +
 lib/librte_ether/Makefile                 |   2 +
 lib/librte_ether/rte_ethdev.c             | 117 ------------------
 lib/librte_ether/rte_ethdev.h             | 105 +---------------
 lib/librte_ether/rte_ethdev_pci.h         | 191 ++++++++++++++++++++++++++++++
 lib/librte_ether/rte_ethdev_vdev.h        |  84 +++++++++++++
 lib/librte_ether/rte_ether_version.map    |  11 +-
 test/test/test_link_bonding_rssconf.c     |   4 +-
 test/test/virtual_pmd.c                   |  12 +-
 55 files changed, 1185 insertions(+), 966 deletions(-)
 delete mode 100644 drivers/net/null/rte_eth_null.h
 create mode 100644 lib/librte_ether/rte_ethdev_pci.h
 create mode 100644 lib/librte_ether/rte_ethdev_vdev.h
Looks good.

Acked-by: Stephen Hemminger <stephen@networkplumber.org>

Re: [PATCH v2 00/42] Remove struct eth_driver

From: Thomas Monjalon <hidden>
Date: 2017-04-14 13:09:40

2017-04-12 09:25, Stephen Hemminger:
On Tue, 11 Apr 2017 17:44:07 +0200
Gaetan Rivet [off-list ref] wrote:
quoted
I rebased the following work of Jan:

This series is removing the PCI specific struct eth_driver from rte_ether. The
PCI drivers are changed to use the newly introduced header-only helpers
instead. Although the virtual drivers did not make use of the ethdev's driver
field they are converted to use the VDEV specific allocation helpers. The
motivation for this change is to properly embed a reference to the generic
rte_device in the ethdev.

The series is based on:

* http://dpdk.org/dev/patchwork/patch/20416/
* http://dpdk.org/dev/patchwork/patch/20417/
* The "Rework vdev probing to use rte_bus infrastructure" series
* http://dpdk.org/dev/patchwork/patch/21058/

Changes in v2:
 * Removed the patch "net/vmxnet3: use library function for DMA zone reserve"
   It is essentially duplicating the following commit:
      04df93d1edac ("net/vmxnet3: fix queue size changes")
 * Fixed header includes for mlx4 and mlx5 PMD
 * Followed the changes of the series for new PMDs (AVP, liquidio)
 * Made KNI use the new API
 * Made PCAP use the new API
 * Fixed undefined behavior on vdev driver arg parsing
 * Fixed virtual_pmd for unit test
Looks good.

Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Applied, thanks

Now we need to remove
	struct rte_pci_driver pci_drv;
from cryptodev and eventdev.
Sooner is better :)
Thanks

[PATCH 0/2] next-net: remove ethdev driver

From: Ferruh Yigit <hidden>
Date: 2017-04-18 18:27:31

There are two PMDs in next-net and not merged into main tree:
- ARK
- DPAA2

These drivers also needs to get these updates.

And to prevent breaking build these changes can be squashed into PMD
in next-net before integration. This means these changes needs to be
merged promptly.

ARK PMD updates are done, can you please review and please feel free to
re-make the patch if required.
CC: Shepard Siegel <redacted>
CC: Ed Czeck <redacted>
CC: John Miller <redacted>

Since DPAA2 has its own device type and not using ethdev driver, it
looks like no update required, can you please double check?
CC: Hemant Agrawal <redacted>
CC: Shreyansh Jain <shreyansh.jain@nxp.c

Also xenvirt giving a build error related ethdev driver usage, build
error fixed, again please feel free to send new version of the patch
if required. This can be preferred to get into main tree.
CC: Jianfeng Tan <redacted>


CC: Jan Blunck <redacted>
CC: Stephen Hemminger <stephen@networkplumber.org>
CC: Gaetan Rivet <redacted>


Ferruh Yigit (2):
  net/ark: remove eth_dev
  net/xenvirt: remove ethdev driver

 drivers/net/ark/ark_ethdev.c          | 44 +++++++++++++++++++++++++----------
 drivers/net/xenvirt/rte_eth_xenvirt.c |  1 -
 2 files changed, 32 insertions(+), 13 deletions(-)

-- 
2.9.3

[PATCH 1/2] net/ark: remove eth_dev

From: Ferruh Yigit <hidden>
Date: 2017-04-18 18:27:32

Signed-off-by: Ferruh Yigit <redacted>
---

CC: Shepard Siegel <redacted>
CC: Ed Czeck <redacted>
CC: John Miller <redacted>
---
 drivers/net/ark/ark_ethdev.c | 44 ++++++++++++++++++++++++++++++++------------
 1 file changed, 32 insertions(+), 12 deletions(-)
diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c
index 651dd26..1f6cd0d 100644
--- a/drivers/net/ark/ark_ethdev.c
+++ b/drivers/net/ark/ark_ethdev.c
@@ -40,6 +40,7 @@
 #include "ark_global.h"
 #include "ark_logs.h"
 #include "ark_ethdev.h"
+#include <rte_ethdev_pci.h>
 #include "ark_ethdev_tx.h"
 #include "ark_ethdev_rx.h"
 #include "ark_mpu.h"
@@ -118,16 +119,36 @@ static const struct rte_pci_id pci_id_ark_map[] = {
 	{.vendor_id = 0, /* sentinel */ },
 };
 
-static struct eth_driver rte_ark_pmd = {
-	.pci_drv = {
-		.probe = rte_eth_dev_pci_probe,
-		.remove = rte_eth_dev_pci_remove,
-		.id_table = pci_id_ark_map,
-		.drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC
-	},
-	.eth_dev_init = eth_ark_dev_init,
-	.eth_dev_uninit = eth_ark_dev_uninit,
-	.dev_private_size = sizeof(struct ark_adapter),
+static int
+eth_ark_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
+		struct rte_pci_device *pci_dev)
+{
+	struct rte_eth_dev *eth_dev;
+	int ret;
+
+	eth_dev = rte_eth_dev_pci_allocate(pci_dev, sizeof(struct ark_adapter));
+
+	if (eth_dev == NULL)
+		return -ENOMEM;
+
+	ret = eth_ark_dev_init(eth_dev);
+	if (ret)
+		rte_eth_dev_pci_release(eth_dev);
+
+	return ret;
+}
+
+static int
+eth_ark_pci_remove(struct rte_pci_device *pci_dev)
+{
+	return rte_eth_dev_pci_generic_remove(pci_dev, eth_ark_dev_uninit);
+}
+
+static struct rte_pci_driver rte_ark_pmd = {
+	.id_table = pci_id_ark_map,
+	.drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC,
+	.probe = eth_ark_pci_probe,
+	.remove = eth_ark_pci_remove,
 };
 
 static const struct eth_dev_ops ark_eth_dev_ops = {
@@ -375,7 +396,6 @@ eth_ark_dev_init(struct rte_eth_dev *dev)
 
 		eth_dev->device = &pci_dev->device;
 		eth_dev->data->dev_private = ark;
-		eth_dev->driver = ark->eth_dev->driver;
 		eth_dev->dev_ops = ark->eth_dev->dev_ops;
 		eth_dev->tx_pkt_burst = ark->eth_dev->tx_pkt_burst;
 		eth_dev->rx_pkt_burst = ark->eth_dev->rx_pkt_burst;
@@ -963,7 +983,7 @@ eth_ark_check_args(struct ark_adapter *ark, const char *params)
 	return 0;
 }
 
-RTE_PMD_REGISTER_PCI(net_ark, rte_ark_pmd.pci_drv);
+RTE_PMD_REGISTER_PCI(net_ark, rte_ark_pmd);
 RTE_PMD_REGISTER_KMOD_DEP(net_ark, "* igb_uio | uio_pci_generic ");
 RTE_PMD_REGISTER_PCI_TABLE(net_ark, pci_id_ark_map);
 RTE_PMD_REGISTER_PARAM_STRING(net_ark,
-- 
2.9.3

[PATCH 2/2] net/xenvirt: remove ethdev driver

From: Ferruh Yigit <hidden>
Date: 2017-04-18 18:27:33

Signed-off-by: Ferruh Yigit <redacted>
---

CC: Jianfeng Tan <redacted>
---
 drivers/net/xenvirt/rte_eth_xenvirt.c | 1 -
 1 file changed, 1 deletion(-)
diff --git a/drivers/net/xenvirt/rte_eth_xenvirt.c b/drivers/net/xenvirt/rte_eth_xenvirt.c
index 6ec8c08..7bd29fa 100644
--- a/drivers/net/xenvirt/rte_eth_xenvirt.c
+++ b/drivers/net/xenvirt/rte_eth_xenvirt.c
@@ -673,7 +673,6 @@ eth_dev_xenvirt_create(const char *name, const char *params,
 	eth_dev->data->dev_flags = RTE_ETH_DEV_DETACHABLE;
 	eth_dev->data->kdrv = RTE_KDRV_NONE;
 	eth_dev->data->drv_name = pmd_xenvirt_drv.driver.name;
-	eth_dev->driver = NULL;
 	eth_dev->data->numa_node = numa_node;
 
 	eth_dev->rx_pkt_burst = eth_xenvirt_rx;
-- 
2.9.3

Re: [PATCH 0/2] next-net: remove ethdev driver

From: Ferruh Yigit <hidden>
Date: 2017-04-18 18:38:18

On 4/18/2017 7:27 PM, Ferruh Yigit wrote:
There are two PMDs in next-net and not merged into main tree:
- ARK
- DPAA2

These drivers also needs to get these updates.
latest next-net rebased on main tree to help development of these.

! next-net is broken now !
And to prevent breaking build these changes can be squashed into PMD
in next-net before integration. This means these changes needs to be
merged promptly.

ARK PMD updates are done, can you please review and please feel free to
re-make the patch if required.
CC: Shepard Siegel <redacted>
CC: Ed Czeck <redacted>
CC: John Miller <redacted>

Since DPAA2 has its own device type and not using ethdev driver, it
looks like no update required, can you please double check?
CC: Hemant Agrawal <redacted>
CC: Shreyansh Jain <shreyansh.jain@nxp.c

Also xenvirt giving a build error related ethdev driver usage, build
error fixed, again please feel free to send new version of the patch
if required. This can be preferred to get into main tree.
CC: Jianfeng Tan <redacted>


CC: Jan Blunck <redacted>
CC: Stephen Hemminger <stephen@networkplumber.org>
CC: Gaetan Rivet <redacted>


Ferruh Yigit (2):
  net/ark: remove eth_dev
  net/xenvirt: remove ethdev driver

 drivers/net/ark/ark_ethdev.c          | 44 +++++++++++++++++++++++++----------
 drivers/net/xenvirt/rte_eth_xenvirt.c |  1 -
 2 files changed, 32 insertions(+), 13 deletions(-)

Re: [PATCH 1/2] net/ark: remove eth_dev

From: Ed Czeck <hidden>
Date: 2017-04-18 19:24:38

Thanks Ferruh,   It all looks good and our tests pass

Acked-by: Ed Czeck <redacted>

[PATCH v2] net/xenvirt: fix build error

From: Ferruh Yigit <hidden>
Date: 2017-04-19 09:52:13

build error:
.../drivers/net/xenvirt/rte_eth_xenvirt.c:676:9:
error: ‘struct rte_eth_dev’ has no member named ‘driver’
  eth_dev->driver = NULL;
         ^~

ethdev driver removed, removing assignment to it to fix the build error

Fixes: 9dca21fb80b6 ("ethdev: remove ethdev driver")

Signed-off-by: Ferruh Yigit <redacted>
---

CC: Jianfeng Tan <redacted>
---
 drivers/net/xenvirt/rte_eth_xenvirt.c | 1 -
 1 file changed, 1 deletion(-)
diff --git a/drivers/net/xenvirt/rte_eth_xenvirt.c b/drivers/net/xenvirt/rte_eth_xenvirt.c
index 6ec8c08..7bd29fa 100644
--- a/drivers/net/xenvirt/rte_eth_xenvirt.c
+++ b/drivers/net/xenvirt/rte_eth_xenvirt.c
@@ -673,7 +673,6 @@ eth_dev_xenvirt_create(const char *name, const char *params,
 	eth_dev->data->dev_flags = RTE_ETH_DEV_DETACHABLE;
 	eth_dev->data->kdrv = RTE_KDRV_NONE;
 	eth_dev->data->drv_name = pmd_xenvirt_drv.driver.name;
-	eth_dev->driver = NULL;
 	eth_dev->data->numa_node = numa_node;
 
 	eth_dev->rx_pkt_burst = eth_xenvirt_rx;
-- 
2.9.3

Re: [PATCH 1/2] net/ark: remove eth_dev

From: Ferruh Yigit <hidden>
Date: 2017-04-19 10:03:10

On 4/18/2017 8:24 PM, Ed Czeck wrote:
Thanks Ferruh,   It all looks good and our tests pass

Acked-by: Ed Czeck <ed.czeck@atomicrules.com
Squashed into relevant commit in next-net, thanks.

Re: [PATCH 0/2] next-net: remove ethdev driver

From: Shreyansh Jain <hidden>
Date: 2017-04-19 11:31:28

On Tuesday 18 April 2017 11:57 PM, Ferruh Yigit wrote:
There are two PMDs in next-net and not merged into main tree:
- ARK
- DPAA2

These drivers also needs to get these updates.

And to prevent breaking build these changes can be squashed into PMD
in next-net before integration. This means these changes needs to be
merged promptly.

ARK PMD updates are done, can you please review and please feel free to
re-make the patch if required.
CC: Shepard Siegel <redacted>
CC: Ed Czeck <redacted>
CC: John Miller <redacted>

Since DPAA2 has its own device type and not using ethdev driver, it
looks like no update required, can you please double check?
CC: Hemant Agrawal <redacted>
CC: Shreyansh Jain <shreyansh.jain@nxp.c
Based on this patch series, eth_driver was removed a couple of versions
back [1]. DPAA2 PMD is not using eth_driver now.

[1] http://dpdk.org/ml/archives/dev/2017-March/060478.html - v9
Also xenvirt giving a build error related ethdev driver usage, build
error fixed, again please feel free to send new version of the patch
if required. This can be preferred to get into main tree.
CC: Jianfeng Tan <redacted>


CC: Jan Blunck <redacted>
CC: Stephen Hemminger <stephen@networkplumber.org>
CC: Gaetan Rivet <redacted>


Ferruh Yigit (2):
  net/ark: remove eth_dev
  net/xenvirt: remove ethdev driver

 drivers/net/ark/ark_ethdev.c          | 44 +++++++++++++++++++++++++----------
 drivers/net/xenvirt/rte_eth_xenvirt.c |  1 -
 2 files changed, 32 insertions(+), 13 deletions(-)

Re: [PATCH v2] net/xenvirt: fix build error

From: Thomas Monjalon <hidden>
Date: 2017-04-19 12:12:37

19/04/2017 11:52, Ferruh Yigit:
build error:
.../drivers/net/xenvirt/rte_eth_xenvirt.c:676:9:
error: ‘struct rte_eth_dev’ has no member named ‘driver’
  eth_dev->driver = NULL;
         ^~

ethdev driver removed, removing assignment to it to fix the build error

Fixes: 9dca21fb80b6 ("ethdev: remove ethdev driver")

Signed-off-by: Ferruh Yigit <redacted>
Applied, thanks

Re: [PATCH v2 02/42] eal: parse "driver" device argument before probing drivers

From: Ferruh Yigit <hidden>
Date: 2017-05-10 02:34:22

On 4/11/2017 4:44 PM, Gaetan Rivet wrote:
From: Jan Blunck <redacted>

In some cases the virtual device name should be totally different than
the driver being used for the device. Therefore lets parse the devargs for
the "driver" argument before probing drivers in vdev_probe_all_drivers().
Hi Gaetan, Jan,

I have caught this while checking something else.

This patch adds an alternative way for virtual devices to get probed
when device name is not proper.

This probing can be done by having "driver=<driver_name>" in device
argument (not in name).

Do we really need this alternative method, as far as I can see only user
of this is a unit test for bonding?

This method is a little hidden/undocumented and a hack solution, I think
it is better and easier to fix virtual device names in unit test and
remove this, what do you think?

Thanks,
ferruh
Signed-off-by: Jan Blunck <redacted>
<...>

Re: [PATCH v2 02/42] eal: parse "driver" device argument before probing drivers

From: Ferruh Yigit <hidden>
Date: 2017-05-10 11:01:55

On 5/10/2017 3:34 AM, Ferruh Yigit wrote:
On 4/11/2017 4:44 PM, Gaetan Rivet wrote:
quoted
From: Jan Blunck <redacted>

In some cases the virtual device name should be totally different than
the driver being used for the device. Therefore lets parse the devargs for
the "driver" argument before probing drivers in vdev_probe_all_drivers().
Hi Gaetan, Jan,

I have caught this while checking something else.

This patch adds an alternative way for virtual devices to get probed
when device name is not proper.

This probing can be done by having "driver=<driver_name>" in device
argument (not in name).

Do we really need this alternative method, as far as I can see only user
of this is a unit test for bonding?

This method is a little hidden/undocumented and a hack solution, I think
it is better and easier to fix virtual device names in unit test and
remove this, what do you think?
I am suggesting: http://dpdk.org/dev/patchwork/patch/24196/
Thanks,
ferruh
quoted
Signed-off-by: Jan Blunck <redacted>
<...>

Previous page

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help