DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bernard Iremonger <bernard.iremonger@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH v8 02/11] pdev: copy pci device info to eth_dev data
Date: Tue,  3 Nov 2015 13:01:56 +0000	[thread overview]
Message-ID: <1446555725-19540-3-git-send-email-bernard.iremonger@intel.com> (raw)
In-Reply-To: <1446555725-19540-1-git-send-email-bernard.iremonger@intel.com>

use new function rte_eth_copy_pci_info.
copy device info for the following pdevs:

ixgbe
e1000
i40e
fm10k
bnx2x
cxgbe
enic
mlx4
vmxnet3
virtio
mlx5

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/net/bnx2x/bnx2x_ethdev.c     | 3 +++
 drivers/net/cxgbe/cxgbe_ethdev.c     | 3 +++
 drivers/net/e1000/em_ethdev.c        | 3 +++
 drivers/net/e1000/igb_ethdev.c       | 5 +++++
 drivers/net/enic/enic_ethdev.c       | 1 +
 drivers/net/fm10k/fm10k_ethdev.c     | 2 ++
 drivers/net/i40e/i40e_ethdev.c       | 3 +++
 drivers/net/i40e/i40e_ethdev_vf.c    | 2 ++
 drivers/net/ixgbe/ixgbe_ethdev.c     | 4 ++++
 drivers/net/mlx4/mlx4.c              | 3 +++
 drivers/net/mlx5/mlx5.c              | 3 +++
 drivers/net/virtio/virtio_ethdev.c   | 3 +++
 drivers/net/vmxnet3/vmxnet3_ethdev.c | 2 ++
 13 files changed, 37 insertions(+)

diff --git a/drivers/net/bnx2x/bnx2x_ethdev.c b/drivers/net/bnx2x/bnx2x_ethdev.c
index 09b5920..36779ea 100644
--- a/drivers/net/bnx2x/bnx2x_ethdev.c
+++ b/drivers/net/bnx2x/bnx2x_ethdev.c
@@ -419,6 +419,9 @@ bnx2x_common_dev_init(struct rte_eth_dev *eth_dev, int is_vf)
 
 	eth_dev->dev_ops = is_vf ? &bnx2xvf_eth_dev_ops : &bnx2x_eth_dev_ops;
 	pci_dev = eth_dev->pci_dev;
+
+	rte_eth_copy_pci_info(eth_dev, pci_dev);
+
 	sc = eth_dev->data->dev_private;
 	sc->pcie_bus    = pci_dev->addr.bus;
 	sc->pcie_device = pci_dev->addr.devid;
diff --git a/drivers/net/cxgbe/cxgbe_ethdev.c b/drivers/net/cxgbe/cxgbe_ethdev.c
index 920e071..7884642 100644
--- a/drivers/net/cxgbe/cxgbe_ethdev.c
+++ b/drivers/net/cxgbe/cxgbe_ethdev.c
@@ -801,6 +801,9 @@ static int eth_cxgbe_dev_init(struct rte_eth_dev *eth_dev)
 		return 0;
 
 	pci_dev = eth_dev->pci_dev;
+
+	rte_eth_copy_pci_info(eth_dev, pci_dev);
+
 	snprintf(name, sizeof(name), "cxgbeadapter%d", eth_dev->data->port_id);
 	adapter = rte_zmalloc(name, sizeof(*adapter), 0);
 	if (!adapter)
diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c
index a009bc2..500985d 100644
--- a/drivers/net/e1000/em_ethdev.c
+++ b/drivers/net/e1000/em_ethdev.c
@@ -243,6 +243,9 @@ eth_em_dev_init(struct rte_eth_dev *eth_dev)
 		E1000_DEV_PRIVATE_TO_VFTA(eth_dev->data->dev_private);
 
 	pci_dev = eth_dev->pci_dev;
+
+	rte_eth_copy_pci_info(eth_dev, pci_dev);
+
 	eth_dev->dev_ops = &eth_em_ops;
 	eth_dev->rx_pkt_burst = (eth_rx_burst_t)&eth_em_recv_pkts;
 	eth_dev->tx_pkt_burst = (eth_tx_burst_t)&eth_em_xmit_pkts;
diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
index c2b92f8..42207e9 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ b/drivers/net/e1000/igb_ethdev.c
@@ -546,6 +546,9 @@ eth_igb_dev_init(struct rte_eth_dev *eth_dev)
 	uint32_t ctrl_ext;
 
 	pci_dev = eth_dev->pci_dev;
+
+	rte_eth_copy_pci_info(eth_dev, pci_dev);
+
 	eth_dev->dev_ops = &eth_igb_ops;
 	eth_dev->rx_pkt_burst = &eth_igb_recv_pkts;
 	eth_dev->tx_pkt_burst = &eth_igb_xmit_pkts;
@@ -754,6 +757,8 @@ eth_igbvf_dev_init(struct rte_eth_dev *eth_dev)
 
 	pci_dev = eth_dev->pci_dev;
 
+	rte_eth_copy_pci_info(eth_dev, pci_dev);
+
 	hw->device_id = pci_dev->id.device_id;
 	hw->vendor_id = pci_dev->id.vendor_id;
 	hw->hw_addr = (void *)pci_dev->mem_resource[0].addr;
diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c
index f8f7817..1e1a5da 100644
--- a/drivers/net/enic/enic_ethdev.c
+++ b/drivers/net/enic/enic_ethdev.c
@@ -603,6 +603,7 @@ static int eth_enicpmd_dev_init(struct rte_eth_dev *eth_dev)
 	eth_dev->tx_pkt_burst = &enicpmd_xmit_pkts;
 
 	pdev = eth_dev->pci_dev;
+	rte_eth_copy_pci_info(eth_dev, pdev);
 	enic->pdev = pdev;
 	addr = &pdev->addr;
 
diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index f603c4e..a05cc05 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -2423,6 +2423,8 @@ eth_fm10k_dev_init(struct rte_eth_dev *dev)
 	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
 		return 0;
 
+	rte_eth_copy_pci_info(dev, dev->pci_dev);
+
 	macvlan = FM10K_DEV_PRIVATE_TO_MACVLAN(dev->data->dev_private);
 	memset(macvlan, 0, sizeof(*macvlan));
 	/* Vendor and Device ID need to be set before init of shared code */
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 8381c8e..c30607d 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -468,6 +468,9 @@ eth_i40e_dev_init(struct rte_eth_dev *dev)
 		return 0;
 	}
 	pci_dev = dev->pci_dev;
+
+	rte_eth_copy_pci_info(dev, pci_dev);
+
 	pf->adapter = I40E_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
 	pf->adapter->eth_dev = dev;
 	pf->dev_data = dev->data;
diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index 8142ff4..c7dc7a6 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -1202,6 +1202,8 @@ i40evf_dev_init(struct rte_eth_dev *eth_dev)
 		return 0;
 	}
 
+	rte_eth_copy_pci_info(eth_dev, eth_dev->pci_dev);
+
 	hw->vendor_id = eth_dev->pci_dev->id.vendor_id;
 	hw->device_id = eth_dev->pci_dev->id.device_id;
 	hw->subsystem_vendor_id = eth_dev->pci_dev->id.subsystem_vendor_id;
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 38d44d4..06f819f 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -910,6 +910,8 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev)
 	}
 	pci_dev = eth_dev->pci_dev;
 
+	rte_eth_copy_pci_info(eth_dev, pci_dev);
+
 	/* Vendor and Device ID need to be set before init of shared code */
 	hw->device_id = pci_dev->id.device_id;
 	hw->vendor_id = pci_dev->id.vendor_id;
@@ -1178,6 +1180,8 @@ eth_ixgbevf_dev_init(struct rte_eth_dev *eth_dev)
 
 	pci_dev = eth_dev->pci_dev;
 
+	rte_eth_copy_pci_info(eth_dev, pci_dev);
+
 	hw->device_id = pci_dev->id.device_id;
 	hw->vendor_id = pci_dev->id.vendor_id;
 	hw->hw_addr = (void *)pci_dev->mem_resource[0].addr;
diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
index 691e0e5..4198c04 100644
--- a/drivers/net/mlx4/mlx4.c
+++ b/drivers/net/mlx4/mlx4.c
@@ -5138,6 +5138,9 @@ mlx4_pci_devinit(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
 
 		eth_dev->data->dev_private = priv;
 		eth_dev->pci_dev = pci_dev;
+
+		rte_eth_copy_pci_info(eth_dev, pci_dev);
+
 		eth_dev->driver = &mlx4_driver;
 		eth_dev->data->rx_mbuf_alloc_failed = 0;
 		eth_dev->data->mtu = ETHER_MTU;
diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index 9636588..e9f059c 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -444,6 +444,9 @@ mlx5_pci_devinit(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
 
 		eth_dev->data->dev_private = priv;
 		eth_dev->pci_dev = pci_dev;
+
+		rte_eth_copy_pci_info(eth_dev, pci_dev);
+
 		eth_dev->driver = &mlx5_driver;
 		eth_dev->data->rx_mbuf_alloc_failed = 0;
 		eth_dev->data->mtu = ETHER_MTU;
diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 12fcc23..ef6330f 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -1184,6 +1184,9 @@ eth_virtio_dev_init(struct rte_eth_dev *eth_dev)
 	}
 
 	pci_dev = eth_dev->pci_dev;
+
+	rte_eth_copy_pci_info(eth_dev, pci_dev);
+
 	if (virtio_resource_init(pci_dev) < 0)
 		return -1;
 
diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
index 3745b7d..bcb4c9d 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -235,6 +235,8 @@ eth_vmxnet3_dev_init(struct rte_eth_dev *eth_dev)
 	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
 		return 0;
 
+	rte_eth_copy_pci_info(eth_dev, pci_dev);
+
 	/* Vendor and Device ID need to be set before init of shared code */
 	hw->device_id = pci_dev->id.device_id;
 	hw->vendor_id = pci_dev->id.vendor_id;
-- 
1.9.1

  parent reply	other threads:[~2015-11-03 13:02 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <PATCH v8>
2015-11-03 13:01 ` [dpdk-dev] [PATCH v8 00/11] remove pci driver from vdevs Bernard Iremonger
2015-11-03 13:01   ` [dpdk-dev] [PATCH v8 01/11] librte_ether: add fields from rte_pci_driver to rte_eth_dev_data Bernard Iremonger
2015-11-03 16:31     ` Thomas Monjalon
2015-11-03 13:01   ` Bernard Iremonger [this message]
2015-11-03 13:01   ` [dpdk-dev] [PATCH v8 03/11] vdev: copy device info to eth_dev data Bernard Iremonger
2015-11-03 17:17     ` Thomas Monjalon
2015-11-03 13:01   ` [dpdk-dev] [PATCH v8 04/11] librte_ether: remove branches on pci_dev Bernard Iremonger
2015-11-03 13:01   ` [dpdk-dev] [PATCH v8 05/11] null: remove pci device Bernard Iremonger
2015-11-03 13:02   ` [dpdk-dev] [PATCH v8 06/11] ring: " Bernard Iremonger
2015-11-03 13:02   ` [dpdk-dev] [PATCH v8 07/11] pcap: " Bernard Iremonger
2015-11-03 13:02   ` [dpdk-dev] [PATCH v8 08/11] af_packet: " Bernard Iremonger
2015-11-03 13:02   ` [dpdk-dev] [PATCH v8 09/11] xenvirt: " Bernard Iremonger
2015-11-03 13:02   ` [dpdk-dev] [PATCH v8 10/11] mpipe: " Bernard Iremonger
2015-11-03 13:02   ` [dpdk-dev] [PATCH v8 11/11] bonding: " Bernard Iremonger
2015-11-03 17:50   ` [dpdk-dev] [PATCH v8 00/11] remove pci driver from vdevs Thomas Monjalon

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=1446555725-19540-3-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).