From: Stephen Hemminger <stephen@networkplumber.org>
To: Jan Blunck <jblunck@infradead.org>
Cc: dev@dpdk.org, shreyansh.jain@nxp.com, david.marchand@6wind.com
Subject: Re: [dpdk-dev] [PATCH v3 7/9] ethdev: Move filling of rte_eth_dev_info->pci_dev to dev_infos_get()
Date: Tue, 20 Dec 2016 07:41:00 -0800 [thread overview]
Message-ID: <20161220074100.7c9526ae@xeon-e3> (raw)
In-Reply-To: <1482232315-21626-8-git-send-email-jblunck@infradead.org>
On Tue, 20 Dec 2016 12:11:53 +0100
Jan Blunck <jblunck@infradead.org> wrote:
> Only the device itself can decide its PCI or not.
>
> Signed-off-by: Jan Blunck <jblunck@infradead.org>
> ---
> drivers/net/bnx2x/bnx2x_ethdev.c | 1 +
> drivers/net/bnxt/bnxt_ethdev.c | 2 ++
> drivers/net/cxgbe/cxgbe_ethdev.c | 2 ++
> drivers/net/e1000/em_ethdev.c | 1 +
> drivers/net/e1000/igb_ethdev.c | 2 ++
> drivers/net/ena/ena_ethdev.c | 2 ++
> drivers/net/enic/enic_ethdev.c | 1 +
> drivers/net/fm10k/fm10k_ethdev.c | 1 +
> drivers/net/i40e/i40e_ethdev.c | 1 +
> drivers/net/i40e/i40e_ethdev_vf.c | 1 +
> drivers/net/ixgbe/ixgbe_ethdev.c | 2 ++
> drivers/net/mlx4/mlx4.c | 2 ++
> drivers/net/mlx5/mlx5_ethdev.c | 2 ++
> drivers/net/nfp/nfp_net.c | 1 +
> drivers/net/qede/qede_ethdev.c | 1 +
> drivers/net/szedata2/rte_eth_szedata2.c | 1 +
> drivers/net/thunderx/nicvf_ethdev.c | 2 ++
> drivers/net/virtio/virtio_ethdev.c | 1 +
> drivers/net/vmxnet3/vmxnet3_ethdev.c | 2 ++
> lib/librte_ether/rte_ethdev.c | 1 -
> 20 files changed, 28 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/bnx2x/bnx2x_ethdev.c b/drivers/net/bnx2x/bnx2x_ethdev.c
> index c331ccd..551dbad 100644
> --- a/drivers/net/bnx2x/bnx2x_ethdev.c
> +++ b/drivers/net/bnx2x/bnx2x_ethdev.c
> @@ -431,6 +431,7 @@ static void
> bnx2x_dev_infos_get(struct rte_eth_dev *dev, __rte_unused struct rte_eth_dev_info *dev_info)
> {
> struct bnx2x_softc *sc = dev->data->dev_private;
> + dev_info->pci_dev = ETH_DEV_PCI_DEV(dev);
> dev_info->max_rx_queues = sc->max_rx_queues;
> dev_info->max_tx_queues = sc->max_tx_queues;
> dev_info->min_rx_bufsize = BNX2X_MIN_RX_BUF_SIZE;
> diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
> index cd50f11..bf39fbe 100644
> --- a/drivers/net/bnxt/bnxt_ethdev.c
> +++ b/drivers/net/bnxt/bnxt_ethdev.c
> @@ -303,6 +303,8 @@ static void bnxt_dev_info_get_op(struct rte_eth_dev *eth_dev,
> struct bnxt *bp = (struct bnxt *)eth_dev->data->dev_private;
> uint16_t max_vnics, i, j, vpool, vrxq;
>
> + dev_info->pci_dev = ETH_DEV_PCI_DEV(eth_dev);
> +
> /* MAC Specifics */
> dev_info->max_mac_addrs = MAX_NUM_MAC_ADDR;
> dev_info->max_hash_mac_addrs = 0;
> diff --git a/drivers/net/cxgbe/cxgbe_ethdev.c b/drivers/net/cxgbe/cxgbe_ethdev.c
> index 8bfdda8..8938b08 100644
> --- a/drivers/net/cxgbe/cxgbe_ethdev.c
> +++ b/drivers/net/cxgbe/cxgbe_ethdev.c
> @@ -147,6 +147,8 @@ static void cxgbe_dev_info_get(struct rte_eth_dev *eth_dev,
> .nb_align = 1,
> };
>
> + device_info->pci_dev = ETH_DEV_PCI_DEV(eth_dev);
> +
> device_info->min_rx_bufsize = CXGBE_MIN_RX_BUFSIZE;
> device_info->max_rx_pktlen = CXGBE_MAX_RX_PKTLEN;
> device_info->max_rx_queues = max_queues;
> diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c
> index 7f2f521..3d34e5b 100644
> --- a/drivers/net/e1000/em_ethdev.c
> +++ b/drivers/net/e1000/em_ethdev.c
> @@ -1048,6 +1048,7 @@ eth_em_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
> {
> struct e1000_hw *hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private);
>
> + dev_info->pci_dev = ETH_DEV_PCI_DEV(dev);
> dev_info->min_rx_bufsize = 256; /* See BSIZE field of RCTL register. */
> dev_info->max_rx_pktlen = em_get_max_pktlen(hw);
> dev_info->max_mac_addrs = hw->mac.rar_entry_count;
> diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
> index b25c66e..7d77561 100644
> --- a/drivers/net/e1000/igb_ethdev.c
> +++ b/drivers/net/e1000/igb_ethdev.c
> @@ -1983,6 +1983,7 @@ eth_igb_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
> {
> struct e1000_hw *hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private);
>
> + dev_info->pci_dev = ETH_DEV_PCI_DEV(dev);
> dev_info->min_rx_bufsize = 256; /* See BSIZE field of RCTL register. */
> dev_info->max_rx_pktlen = 0x3FFF; /* See RLPML register. */
> dev_info->max_mac_addrs = hw->mac.rar_entry_count;
> @@ -2111,6 +2112,7 @@ eth_igbvf_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
> {
> struct e1000_hw *hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private);
>
> + dev_info->pci_dev = ETH_DEV_PCI_DEV(dev);
> dev_info->min_rx_bufsize = 256; /* See BSIZE field of RCTL register. */
> dev_info->max_rx_pktlen = 0x3FFF; /* See RLPML register. */
> dev_info->max_mac_addrs = hw->mac.rar_entry_count;
> diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
> index c17d969..051275e 100644
> --- a/drivers/net/ena/ena_ethdev.c
> +++ b/drivers/net/ena/ena_ethdev.c
> @@ -1436,6 +1436,8 @@ static void ena_infos_get(struct rte_eth_dev *dev,
> ena_dev = &adapter->ena_dev;
> ena_assert_msg(ena_dev != NULL, "Uninitialized device");
>
> + dev_info->pci_dev = ETH_DEV_PCI_DEV(dev);
> +
> dev_info->speed_capa =
> ETH_LINK_SPEED_1G |
> ETH_LINK_SPEED_2_5G |
> diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c
> index 553a88e..bb5dfe6 100644
> --- a/drivers/net/enic/enic_ethdev.c
> +++ b/drivers/net/enic/enic_ethdev.c
> @@ -459,6 +459,7 @@ static void enicpmd_dev_info_get(struct rte_eth_dev *eth_dev,
> struct enic *enic = pmd_priv(eth_dev);
>
> ENICPMD_FUNC_TRACE();
> + device_info->pci_dev = ETH_DEV_PCI_DEV(eth_dev);
> /* Scattered Rx uses two receive queues per rx queue exposed to dpdk */
> device_info->max_rx_queues = enic->conf_rq_count / 2;
> device_info->max_tx_queues = enic->conf_wq_count;
> diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
> index e1250f6..5d0bce5 100644
> --- a/drivers/net/fm10k/fm10k_ethdev.c
> +++ b/drivers/net/fm10k/fm10k_ethdev.c
> @@ -1392,6 +1392,7 @@ fm10k_dev_infos_get(struct rte_eth_dev *dev,
>
> PMD_INIT_FUNC_TRACE();
>
> + dev_info->pci_dev = ETH_DEV_PCI_DEV(dev);
> dev_info->min_rx_bufsize = FM10K_MIN_RX_BUF_SIZE;
> dev_info->max_rx_pktlen = FM10K_MAX_PKT_SIZE;
> dev_info->max_rx_queues = hw->mac.max_queues;
> diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
> index 8a63a8c..29c0277 100644
> --- a/drivers/net/i40e/i40e_ethdev.c
> +++ b/drivers/net/i40e/i40e_ethdev.c
> @@ -2583,6 +2583,7 @@ i40e_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
> struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
> struct i40e_vsi *vsi = pf->main_vsi;
>
> + dev_info->pci_dev = ETH_DEV_PCI_DEV(dev);
> dev_info->max_rx_queues = vsi->nb_qps;
> dev_info->max_tx_queues = vsi->nb_qps;
> dev_info->min_rx_bufsize = I40E_BUF_SIZE_MIN;
> diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
> index 781e658..caef72c 100644
> --- a/drivers/net/i40e/i40e_ethdev_vf.c
> +++ b/drivers/net/i40e/i40e_ethdev_vf.c
> @@ -2217,6 +2217,7 @@ i40evf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
> struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
>
> memset(dev_info, 0, sizeof(*dev_info));
> + dev_info->pci_dev = ETH_DEV_PCI_DEV(dev);
> dev_info->max_rx_queues = vf->vsi_res->num_queue_pairs;
> dev_info->max_tx_queues = vf->vsi_res->num_queue_pairs;
> dev_info->min_rx_bufsize = I40E_BUF_SIZE_MIN;
> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
> index f17da46..c88b7bf 100644
> --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> @@ -3043,6 +3043,7 @@ ixgbe_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
> struct rte_eth_conf *dev_conf = &dev->data->dev_conf;
> struct rte_pci_device *pci_dev = ETH_DEV_PCI_DEV(dev);
>
> + dev_info->pci_dev = ETH_DEV_PCI_DEV(dev);
> dev_info->max_rx_queues = (uint16_t)hw->mac.max_rx_queues;
> dev_info->max_tx_queues = (uint16_t)hw->mac.max_tx_queues;
> if (RTE_ETH_DEV_SRIOV(dev).active == 0) {
> @@ -3175,6 +3176,7 @@ ixgbevf_dev_info_get(struct rte_eth_dev *dev,
> struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
> struct rte_pci_device *pci_dev = ETH_DEV_PCI_DEV(dev);
>
> + dev_info->pci_dev = ETH_DEV_PCI_DEV(dev);
> dev_info->max_rx_queues = (uint16_t)hw->mac.max_rx_queues;
> dev_info->max_tx_queues = (uint16_t)hw->mac.max_tx_queues;
> dev_info->min_rx_bufsize = 1024; /* cf BSIZEPACKET in SRRCTL reg */
> diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
> index da61a85..5455fea 100644
> --- a/drivers/net/mlx4/mlx4.c
> +++ b/drivers/net/mlx4/mlx4.c
> @@ -4421,6 +4421,8 @@ mlx4_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)
> unsigned int max;
> char ifname[IF_NAMESIZE];
>
> + info->pci_dev = ETH_DEV_PCI_DEV(dev);
> +
> if (priv == NULL)
> return;
> priv_lock(priv);
> diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
> index c0f73e9..489a4f6 100644
> --- a/drivers/net/mlx5/mlx5_ethdev.c
> +++ b/drivers/net/mlx5/mlx5_ethdev.c
> @@ -562,6 +562,8 @@ mlx5_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)
> unsigned int max;
> char ifname[IF_NAMESIZE];
>
> + info->pci_dev = ETH_DEV_PCI_DEV(dev);
> +
> priv_lock(priv);
> /* FIXME: we should ask the device for these values. */
> info->min_rx_bufsize = 32;
> diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c
> index 7299fad..c49d38a 100644
> --- a/drivers/net/nfp/nfp_net.c
> +++ b/drivers/net/nfp/nfp_net.c
> @@ -1008,6 +1008,7 @@ nfp_net_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
>
> hw = NFP_NET_DEV_PRIVATE_TO_HW(dev->data->dev_private);
>
> + dev_info->pci_dev = ETH_DEV_PCI_DEV(dev);
> dev_info->driver_name = dev->driver->pci_drv.driver.name;
> dev_info->max_rx_queues = (uint16_t)hw->max_rx_queues;
> dev_info->max_tx_queues = (uint16_t)hw->max_tx_queues;
> diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c
> index 959ff0f..2c4de92 100644
> --- a/drivers/net/qede/qede_ethdev.c
> +++ b/drivers/net/qede/qede_ethdev.c
> @@ -652,6 +652,7 @@ qede_dev_info_get(struct rte_eth_dev *eth_dev,
>
> PMD_INIT_FUNC_TRACE(edev);
>
> + dev_info->pci_dev = ETH_DEV_PCI_DEV(eth_dev);
> dev_info->min_rx_bufsize = (uint32_t)(ETHER_MIN_MTU +
> QEDE_ETH_OVERHEAD);
> dev_info->max_rx_pktlen = (uint32_t)ETH_TX_MAX_NON_LSO_PKT_LEN;
> diff --git a/drivers/net/szedata2/rte_eth_szedata2.c b/drivers/net/szedata2/rte_eth_szedata2.c
> index 6d80a5b..6356257 100644
> --- a/drivers/net/szedata2/rte_eth_szedata2.c
> +++ b/drivers/net/szedata2/rte_eth_szedata2.c
> @@ -1030,6 +1030,7 @@ eth_dev_info(struct rte_eth_dev *dev,
> struct rte_eth_dev_info *dev_info)
> {
> struct pmd_internals *internals = dev->data->dev_private;
> + dev_info->pci_dev = ETH_DEV_PCI_DEV(dev);
> dev_info->if_index = 0;
> dev_info->max_mac_addrs = 1;
> dev_info->max_rx_pktlen = (uint32_t)-1;
> diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c
> index 099b252..daac853 100644
> --- a/drivers/net/thunderx/nicvf_ethdev.c
> +++ b/drivers/net/thunderx/nicvf_ethdev.c
> @@ -1339,6 +1339,8 @@ nicvf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
>
> PMD_INIT_FUNC_TRACE();
>
> + dev_info->pci_dev = pci_dev;
> +
> dev_info->min_rx_bufsize = ETHER_MIN_MTU;
> dev_info->max_rx_pktlen = NIC_HW_MAX_FRS;
> dev_info->max_rx_queues =
> diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
> index 023101d..2eb6a06 100644
> --- a/drivers/net/virtio/virtio_ethdev.c
> +++ b/drivers/net/virtio/virtio_ethdev.c
> @@ -1625,6 +1625,7 @@ virtio_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
> uint64_t tso_mask;
> struct virtio_hw *hw = dev->data->dev_private;
>
> + dev_info->pci_dev = hw->dev;
> dev_info->max_rx_queues =
> RTE_MIN(hw->max_queue_pairs, VIRTIO_MAX_RX_QUEUES);
> dev_info->max_tx_queues =
> diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
> index bcb3751..f7c0382 100644
> --- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
> +++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
> @@ -709,6 +709,8 @@ static void
> vmxnet3_dev_info_get(__rte_unused struct rte_eth_dev *dev,
> struct rte_eth_dev_info *dev_info)
> {
> + dev_info->pci_dev = ETH_DEV_PCI_DEV(dev);
> +
> dev_info->max_rx_queues = VMXNET3_MAX_RX_QUEUES;
> dev_info->max_tx_queues = VMXNET3_MAX_TX_QUEUES;
> dev_info->min_rx_bufsize = 1518 + RTE_PKTMBUF_HEADROOM;
> diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
> index fde8112..4288577 100644
> --- a/lib/librte_ether/rte_ethdev.c
> +++ b/lib/librte_ether/rte_ethdev.c
> @@ -1556,7 +1556,6 @@ rte_eth_dev_info_get(uint8_t port_id, struct rte_eth_dev_info *dev_info)
>
> RTE_FUNC_PTR_OR_RET(*dev->dev_ops->dev_infos_get);
> (*dev->dev_ops->dev_infos_get)(dev, dev_info);
> - dev_info->pci_dev = dev->pci_dev;
> dev_info->driver_name = dev->data->drv_name;
> dev_info->nb_rx_queues = dev->data->nb_rx_queues;
> dev_info->nb_tx_queues = dev->data->nb_tx_queues;
If dev_info_get sets a pointer to device (rather than pci_dev) then it can
stay in generic code.
next prev parent reply other threads:[~2016-12-20 15:41 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-20 11:11 [dpdk-dev] [PATCH v3 0/9] Decouple ethdev from PCI device Jan Blunck
2016-12-20 11:11 ` [dpdk-dev] [PATCH v3 1/9] eal: define container_of macro Jan Blunck
2016-12-20 11:11 ` [dpdk-dev] [PATCH v3 2/9] ethdev: Helper to convert to struct rte_pci_device Jan Blunck
2016-12-20 15:38 ` Stephen Hemminger
2016-12-20 11:11 ` [dpdk-dev] [PATCH v3 3/9] drivers: Use ETH_DEV_PCI_DEV() helper Jan Blunck
2016-12-21 9:50 ` Shreyansh Jain
2016-12-21 9:57 ` Shreyansh Jain
2016-12-20 11:11 ` [dpdk-dev] [PATCH v3 4/9] virtio: Don't fill dev_info->driver_name Jan Blunck
2016-12-20 12:17 ` Ferruh Yigit
2016-12-20 12:40 ` Jan Blunck
2016-12-20 12:58 ` Ferruh Yigit
2016-12-20 11:11 ` [dpdk-dev] [PATCH v3 5/9] virtio: Add vtpci_intr_handle() helper to get rte_intr_handle Jan Blunck
2016-12-20 11:11 ` [dpdk-dev] [PATCH v3 6/9] virtio: Don't depend on struct rte_eth_dev's pci_dev Jan Blunck
2016-12-20 11:11 ` [dpdk-dev] [PATCH v3 7/9] ethdev: Move filling of rte_eth_dev_info->pci_dev to dev_infos_get() Jan Blunck
2016-12-20 15:41 ` Stephen Hemminger [this message]
2016-12-21 15:35 ` Jan Blunck
2016-12-21 9:54 ` Shreyansh Jain
2016-12-20 11:11 ` [dpdk-dev] [PATCH v3 8/9] ethdev: Decouple interrupt handling from PCI device Jan Blunck
2016-12-20 11:11 ` [dpdk-dev] [PATCH v3 9/9] ethdev: Decouple struct rte_eth_dev from struct rte_pci_device Jan Blunck
2016-12-21 10:00 ` [dpdk-dev] [PATCH v3 0/9] Decouple ethdev from PCI device Shreyansh Jain
2016-12-21 15:12 ` Jan Blunck
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=20161220074100.7c9526ae@xeon-e3 \
--to=stephen@networkplumber.org \
--cc=david.marchand@6wind.com \
--cc=dev@dpdk.org \
--cc=jblunck@infradead.org \
--cc=shreyansh.jain@nxp.com \
/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).