DPDK patches and discussions
 help / color / mirror / Atom feed
From: Shreyansh Jain <shreyansh.jain@nxp.com>
To: Jan Blunck <jblunck@infradead.org>
Cc: <dev@dpdk.org>, <david.marchand@6wind.com>, <stephen@networkplumber.org>
Subject: Re: [dpdk-dev] [PATCH v3 7/9] ethdev: Move filling of rte_eth_dev_info->pci_dev to dev_infos_get()
Date: Wed, 21 Dec 2016 15:24:50 +0530	[thread overview]
Message-ID: <7bba31bd-074e-ab03-b03d-d5758372b1eb@nxp.com> (raw)
In-Reply-To: <1482232315-21626-8-git-send-email-jblunck@infradead.org>

On Tuesday 20 December 2016 04:41 PM, Jan Blunck 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(-)
>

<snip>

> 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);
> +

My compilation environment is reporting following error:

--->8---
/home/shreyansh/build/DPDK/01_dpdk/drivers/net/mlx4/mlx4.c: In function 
‘mlx4_pci_probe’:
/home/shreyansh/build/DPDK/01_dpdk/drivers/net/mlx4/mlx4.c:5843:10: 
error: ‘struct rte_eth_dev’ has no member named ‘pci_dev’
    eth_dev->pci_dev = pci_dev;
           ^
/home/shreyansh/build/DPDK/01_dpdk/mk/internal/rte.compile-pre.mk:138: 
recipe for target 'mlx4.o' failed
--->8---

Exact same issue exists on MLX5 also I think:

1d [shreyansh:~/build/DPDK/01_dpdk] 
tmp/jan_patches_ethdev_21dec(+11/-11)+* ± grep "eth_dev->pci_dev" * -rn
drivers/net/mlx5/mlx5.c:660:            eth_dev->pci_dev = pci_dev;
drivers/net/mlx4/mlx4.c:5843:           eth_dev->pci_dev = pci_dev;

(I don't yet have MLX5 compilation env - so, above is just my guess).


>  	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;

<Snip>

-
Shreyansh

  parent reply	other threads:[~2016-12-21  9:51 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
2016-12-21 15:35     ` Jan Blunck
2016-12-21  9:54   ` Shreyansh Jain [this message]
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=7bba31bd-074e-ab03-b03d-d5758372b1eb@nxp.com \
    --to=shreyansh.jain@nxp.com \
    --cc=david.marchand@6wind.com \
    --cc=dev@dpdk.org \
    --cc=jblunck@infradead.org \
    --cc=stephen@networkplumber.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).