All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bernard Iremonger <bernard.iremonger@intel.com>
To: dev@dpdk.org
Subject: [RFC PATCH 4/6] ring: remove pci device driver
Date: Thu, 27 Aug 2015 16:40:39 +0100	[thread overview]
Message-ID: <1440690041-32391-5-git-send-email-bernard.iremonger@intel.com> (raw)
In-Reply-To: <1440690041-32391-1-git-send-email-bernard.iremonger@intel.com>

remove rte_ring_pmd and pci_dev.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 drivers/net/ring/rte_eth_ring.c | 35 ++++++-----------------------------
 1 file changed, 6 insertions(+), 29 deletions(-)

diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c
index 6fd3d0a..111814e 100644
--- a/drivers/net/ring/rte_eth_ring.c
+++ b/drivers/net/ring/rte_eth_ring.c
@@ -44,8 +44,6 @@
 #define ETH_RING_ACTION_CREATE		"CREATE"
 #define ETH_RING_ACTION_ATTACH		"ATTACH"
 
-static const char *ring_ethdev_driver_name = "Ring PMD";
-
 static const char *valid_arguments[] = {
 	ETH_RING_NUMA_NODE_ACTION_ARG,
 	NULL
@@ -252,15 +250,6 @@ static const struct eth_dev_ops ops = {
 	.mac_addr_add = eth_mac_addr_add,
 };
 
-static struct eth_driver rte_ring_pmd = {
-	.pci_drv = {
-		.name = "rte_ring_pmd",
-		.drv_flags = RTE_PCI_DRV_DETACHABLE,
-	},
-};
-
-static struct rte_pci_id id_table;
-
 int
 rte_eth_from_rings(const char *name, struct rte_ring *const rx_queues[],
 		const unsigned nb_rx_queues,
@@ -269,7 +258,6 @@ rte_eth_from_rings(const char *name, struct rte_ring *const rx_queues[],
 		const unsigned numa_node)
 {
 	struct rte_eth_dev_data *data = NULL;
-	struct rte_pci_device *pci_dev = NULL;
 	struct pmd_internals *internals = NULL;
 	struct rte_eth_dev *eth_dev = NULL;
 
@@ -291,10 +279,6 @@ rte_eth_from_rings(const char *name, struct rte_ring *const rx_queues[],
 	if (data == NULL)
 		goto error;
 
-	pci_dev = rte_zmalloc_socket(name, sizeof(*pci_dev), 0, numa_node);
-	if (pci_dev == NULL)
-		goto error;
-
 	internals = rte_zmalloc_socket(name, sizeof(*internals), 0, numa_node);
 	if (internals == NULL)
 		goto error;
@@ -304,11 +288,10 @@ rte_eth_from_rings(const char *name, struct rte_ring *const rx_queues[],
 	if (eth_dev == NULL)
 		goto error;
 
-
 	/* now put it all together
 	 * - store queue data in internals,
-	 * - store numa_node info in pci_driver
-	 * - point eth_dev_data to internals and pci_driver
+	 * - store numa_node info in eth_dev_data
+	 * - point eth_dev_data to internals
 	 * - and point eth_dev structure to new eth_dev_data structure
 	 */
 	/* NOTE: we'll replace the data element, of originally allocated eth_dev
@@ -323,12 +306,6 @@ rte_eth_from_rings(const char *name, struct rte_ring *const rx_queues[],
 		internals->tx_ring_queues[i].rng = tx_queues[i];
 	}
 
-	rte_ring_pmd.pci_drv.name = ring_ethdev_driver_name;
-	rte_ring_pmd.pci_drv.id_table = &id_table;
-
-	pci_dev->numa_node = numa_node;
-	pci_dev->driver = &rte_ring_pmd.pci_drv;
-
 	data->dev_private = internals;
 	data->port_id = eth_dev->data->port_id;
 	memmove(data->name, eth_dev->data->name, sizeof(data->name));
@@ -336,11 +313,13 @@ rte_eth_from_rings(const char *name, struct rte_ring *const rx_queues[],
 	data->nb_tx_queues = (uint16_t)nb_tx_queues;
 	data->dev_link = pmd_link;
 	data->mac_addrs = &internals->address;
+	data->numa_node = numa_node;
 
 	eth_dev->data = data;
-	eth_dev->driver = &rte_ring_pmd;
+	eth_dev->driver = NULL;
 	eth_dev->dev_ops = &ops;
-	eth_dev->pci_dev = pci_dev;
+	eth_dev->pci_dev = NULL;
+	eth_dev->dev_flags = RTE_ETH_DEV_DETACHABLE;
 	TAILQ_INIT(&(eth_dev->link_intr_cbs));
 
 	/* finally assign rx and tx ops */
@@ -351,7 +330,6 @@ rte_eth_from_rings(const char *name, struct rte_ring *const rx_queues[],
 
 error:
 	rte_free(data);
-	rte_free(pci_dev);
 	rte_free(internals);
 
 	return -1;
@@ -617,7 +595,6 @@ rte_pmd_ring_devuninit(const char *name)
 	eth_dev_stop(eth_dev);
 	rte_free(eth_dev->data->dev_private);
 	rte_free(eth_dev->data);
-	rte_free(eth_dev->pci_dev);
 
 	rte_eth_dev_release_port(eth_dev);
 	return 0;
-- 
1.9.1

  parent reply	other threads:[~2015-08-27 15:40 UTC|newest]

Thread overview: 96+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <RFC PATCH>
2015-04-08 10:02 ` [RFC PATCH] librte_pmd_ixgbe: changes to support PCI Port Hotplug Bernard Iremonger
2015-04-22  3:14   ` Qiu, Michael
2015-04-08 14:11 ` [RFC PATCH] librte_pmd_e1000: igb and em1000 PCI Port Hotplug changes Bernard Iremonger
2015-04-30 13:16 ` [RFC PATCH 1/1] librte_pmd_ring: changes to support PCI Port Hotplug Bernard Iremonger
2015-04-30 15:40 ` [RFC PATCH 1/4] librte_pmd_i40e: " Bernard Iremonger
2015-04-30 15:41 ` [RFC PATCH 2/4] librte_pmd_i40e: release vmdq vsi's in dev_close Bernard Iremonger
2015-04-30 15:42 ` [RFC PATCH 3/4] librte_pmd_i40e: increase ASQ_DELAY_MS to 100 in i40evf_wait_cmd_done() Bernard Iremonger
2015-04-30 15:42 ` [RFC PATCH 4/4] librte_pmd_i40e: call _clear_cmd() when error occurs Bernard Iremonger
2015-05-01 14:36 ` [RFC PATCH] librte_pmd_bond: add support for PCI Port Hotplug Bernard Iremonger
     [not found]   ` <1430490979-1994-1-git-send-email-bernard.iremonger-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2015-05-01 15:17     ` Neil Horman
2015-05-01 15:28 ` [RFC PATCH] librte_pmd_virtio: " Bernard Iremonger
2015-05-05 14:36 ` [RFC PATCH V2] librte_pmd_ring: changes to support " Bernard Iremonger
     [not found]   ` <1430836601-12248-1-git-send-email-bernard.iremonger-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2015-05-06 16:15     ` Bruce Richardson
2015-05-06 10:22 ` [RFC PATCH V2] librte_pmd_ixgbe: " Bernard Iremonger
2015-05-06 11:20 ` [RFC PATCH V2] librte_pmd_e1000: igb and em1000 PCI Port Hotplug changes Bernard Iremonger
2015-05-27 16:00 ` [RFC PATCH V2 1/2] drivers/net/virtio: add support for PCI Port Hotplug Bernard Iremonger
2015-05-27 16:00 ` [RFC PATCH V2 2/2] drivers/net/virtio: check vq parameter Bernard Iremonger
2015-06-16  1:08   ` Ouyang, Changchun
2015-05-28 12:28 ` [RFC PATCH V2] drivers/net/bonding: add support for PCI Port Hotplug Bernard Iremonger
2015-05-29 13:46 ` [RFC PATCH V3] drivers/net/ring: changes to support " Bernard Iremonger
2015-06-03 15:21   ` Bruce Richardson
2015-06-02 10:18 ` [RFC PATCH V3] ixgbe: " Bernard Iremonger
2015-06-03 14:03 ` [RFC PATCH V3] e1000: igb and em1000 PCI Port Hotplug changes Bernard Iremonger
2015-06-04 16:24 ` [RFC PATCH V2 1/4] i40e: changes to support PCI Port Hotplug Bernard Iremonger
2015-06-24  8:03   ` Qiu, Michael
2015-06-04 16:25 ` [RFC PATCH V2 2/4] i40e: release vmdq vsi's in dev_close Bernard Iremonger
2015-06-04 16:25 ` [RFC PATCH V2 3/4] i40e: increase ASQ_DELAY_MS to 100 in i40evf_wait_cmd_done() Bernard Iremonger
2015-06-04 16:26 ` [RFC PATCH V2 4/4] i40e: call _clear_cmd() when error occurs Bernard Iremonger
2015-06-08 15:47 ` [RFC PATCH V4] ixgbe: changes to support PCI Port Hotplug Bernard Iremonger
2015-06-15 22:31   ` Ananyev, Konstantin
2015-06-17  6:11   ` Zhang, Helin
2015-06-24  7:45   ` Qiu, Michael
2015-06-24  7:46   ` Qiu, Michael
2015-06-10  8:27 ` [RFC PATCH V3 0/5] PCI Port Hotplug changes Bernard Iremonger
2015-06-10  8:27   ` [RFC PATCH V3 1/5] i40e: changes to support PCI Port Hotplug Bernard Iremonger
2015-06-10  8:27   ` [RFC PATCH V3 2/5] i40e: release vmdq vsi's in dev_close Bernard Iremonger
2015-06-10  8:27   ` [RFC PATCH V3 3/5] i40e: increase ASQ_DELAY_MS to 100 in i40evf_wait_cmd_done() Bernard Iremonger
2015-06-10  8:27   ` [RFC PATCH V3 4/5] i40e: call _clear_cmd() when error occurs Bernard Iremonger
2015-06-10  8:27   ` [RFC PATCH V3 5/5] i40e: clear queues in i40evf_dev_stop Bernard Iremonger
2015-06-10 12:09 ` [RFC PATCH V4] e1000: igb and em1000 PCI Port Hotplug changes Bernard Iremonger
2015-08-27 15:40 ` [RFC PATCH 0/6] remove pci driver from vdevs Bernard Iremonger
2015-08-27 15:40   ` [RFC PATCH 1/6] librte_ether: add fields from rte_pci_driver to rte_eth_dev and rte_eth_dev_data Bernard Iremonger
2015-08-31 14:07     ` Thomas Monjalon
2015-09-01 11:38       ` Iremonger, Bernard
2015-09-01 12:03         ` Bruce Richardson
2015-09-01 12:37         ` Ananyev, Konstantin
2015-09-01 12:43           ` Richardson, Bruce
2015-08-27 15:40   ` [RFC PATCH 2/6] librte_ether: handle RTE_ETH_DEV_INTR_LSC for vdevs Bernard Iremonger
2015-08-27 15:40   ` [RFC PATCH 3/6] null: remove pci device driver Bernard Iremonger
2015-08-31 14:11     ` Thomas Monjalon
2015-08-31 16:05       ` Iremonger, Bernard
2015-08-27 15:40   ` Bernard Iremonger [this message]
2015-08-27 15:40   ` [RFC PATCH 5/6] bonding: " Bernard Iremonger
2015-08-27 17:48     ` Stephen Hemminger
2015-08-28  8:32       ` Iremonger, Bernard
2015-08-28 15:57         ` Stephen Hemminger
2015-08-27 15:40   ` [RFC PATCH 6/6] pcap: " Bernard Iremonger
2015-08-27 17:43   ` [RFC PATCH 0/6] remove pci driver from vdevs John W. Linville
2015-08-28  8:15     ` Iremonger, Bernard
2015-08-28 10:32       ` Neil Horman
2015-08-28 19:48         ` Wiles, Keith
2015-08-31 11:21           ` Iremonger, Bernard
2015-08-31 12:41             ` Neil Horman
2015-08-28 17:51       ` John W. Linville
2015-08-31 10:23         ` Iremonger, Bernard
2015-08-31 12:59           ` Neil Horman
2015-08-31 14:22             ` Thomas Monjalon
2015-09-01 13:38               ` Iremonger, Bernard
2015-09-01 19:18                 ` Neil Horman
2015-09-03 14:02                   ` Iremonger, Bernard
2015-09-07  9:22                     ` Zende, Amruta S
2015-09-04 11:01 ` [RFC PATCH 00/18] refactor eal driver registration code Bernard Iremonger
2015-09-04 11:01   ` [RFC PATCH 01/18] librte_eal: remove type field from rte_driver structure Bernard Iremonger
2015-09-04 13:08     ` Thomas Monjalon
2015-09-04 11:01   ` [RFC PATCH 02/18] af_packet: " Bernard Iremonger
2015-09-04 11:01   ` [RFC PATCH 03/18] bnx2x: remove type field and initialise name field in " Bernard Iremonger
2015-09-04 11:26     ` Harish Patil
2015-09-04 11:01   ` [RFC PATCH 04/18] bonding: remove type field from " Bernard Iremonger
2015-09-04 11:01   ` [RFC PATCH 05/18] cxgbe: " Bernard Iremonger
2015-09-04 11:01   ` [RFC PATCH 06/18] e1000: remove type field and initialise name field in rte_driver structures Bernard Iremonger
2015-09-04 11:01   ` [RFC PATCH 07/18] enic: remove type field and initialise name field in rte_driver structure Bernard Iremonger
2015-09-04 11:01   ` [RFC PATCH 08/18] fm10k: " Bernard Iremonger
2015-09-04 11:01   ` [RFC PATCH 09/18] i40e: remove type field and initialise name field in rte_driver structures Bernard Iremonger
2015-09-04 11:01   ` [RFC PATCH 10/18] ixgbe: remove type field and initialise name field in rte_driver structure Bernard Iremonger
2015-09-04 11:01   ` [RFC PATCH 11/18] mlx4: remove type field from " Bernard Iremonger
2015-09-04 11:01   ` [RFC PATCH 12/18] mpipe: remove type field and update name in " Bernard Iremonger
2015-09-04 11:01   ` [RFC PATCH 13/18] null: remove type field from " Bernard Iremonger
2015-09-04 11:01   ` [RFC PATCH 14/18] pcap: " Bernard Iremonger
2015-09-04 11:01   ` [RFC PATCH 15/18] ring: " Bernard Iremonger
2015-09-04 11:01   ` [RFC PATCH 16/18] virtio_ethdev: remove type field and initialise name field in " Bernard Iremonger
2015-09-04 11:01   ` [RFC PATCH 17/18] vmxnet3: " Bernard Iremonger
2015-09-04 11:01   ` [RFC PATCH 18/18] xenvirt: remove type field from " Bernard Iremonger
2015-09-04 11:18   ` [RFC PATCH 00/18] refactor eal driver registration code Bruce Richardson
2015-09-04 12:46     ` Iremonger, Bernard
2015-09-04 12:53       ` Bruce Richardson
2015-09-05  2:21     ` Neil Horman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1440690041-32391-5-git-send-email-bernard.iremonger@intel.com \
    --to=bernard.iremonger@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.