DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v1] drivers/net/ena: Copy PCI info to rte_eth_dev
@ 2018-01-16 19:06 sodey
  2018-01-16 19:16 ` Ferruh Yigit
  0 siblings, 1 reply; 3+ messages in thread
From: sodey @ 2018-01-16 19:06 UTC (permalink / raw)
  To: jan, jpa, netanel, evgenys; +Cc: dev, sodey

From: Souvik Dey <sodey@rbbn.com>

We need to add the pci_dev info to the rte_eth_dev structure
during the eth_ena_dev_init. Informantions like driver_name
and numa_node will not be populated otherwise.

Signed-off-by: Souvik Dey <sodey@rbbn.com>

---

 drivers/net/ena/ena_ethdev.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
index ac0803d..329cb29 100644
--- a/drivers/net/ena/ena_ethdev.c
+++ b/drivers/net/ena/ena_ethdev.c
@@ -1270,6 +1270,8 @@ static int eth_ena_dev_init(struct rte_eth_dev *eth_dev)
 		     pci_dev->addr.devid,
 		     pci_dev->addr.function);
 
+	rte_eth_copy_pci_info(eth_dev, pci_dev);
+
 	adapter->regs = pci_dev->mem_resource[ENA_REGS_BAR].addr;
 	adapter->dev_mem_base = pci_dev->mem_resource[ENA_MEM_BAR].addr;
 
-- 
2.9.3.windows.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH v1] drivers/net/ena: Copy PCI info to rte_eth_dev
  2018-01-16 19:06 [dpdk-dev] [PATCH v1] drivers/net/ena: Copy PCI info to rte_eth_dev sodey
@ 2018-01-16 19:16 ` Ferruh Yigit
  2018-01-17 20:49   ` Dey, Souvik
  0 siblings, 1 reply; 3+ messages in thread
From: Ferruh Yigit @ 2018-01-16 19:16 UTC (permalink / raw)
  To: sodey, jan, jpa, netanel, evgenys; +Cc: dev

On 1/16/2018 7:06 PM, sodey@rbbn.com wrote:
> From: Souvik Dey <sodey@rbbn.com>
> 
> We need to add the pci_dev info to the rte_eth_dev structure
> during the eth_ena_dev_init. Informantions like driver_name
> and numa_node will not be populated otherwise.

stacktrace is like:

eth_ena_pci_probe
  rte_eth_dev_pci_generic_probe
    rte_eth_dev_pci_allocate
      rte_eth_copy_pci_info
    eth_ena_dev_init

So, before eth_ena_dev_init() called,  rte_eth_copy_pci_info() already should be
called and eth_dev updated with pci_dev info. And you shouldn't need this patch.

Do you observe any missing data in eth_dev?

> 
> Signed-off-by: Souvik Dey <sodey@rbbn.com>
> 
> ---
> 
>  drivers/net/ena/ena_ethdev.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
> index ac0803d..329cb29 100644
> --- a/drivers/net/ena/ena_ethdev.c
> +++ b/drivers/net/ena/ena_ethdev.c
> @@ -1270,6 +1270,8 @@ static int eth_ena_dev_init(struct rte_eth_dev *eth_dev)
>  		     pci_dev->addr.devid,
>  		     pci_dev->addr.function);
>  
> +	rte_eth_copy_pci_info(eth_dev, pci_dev);
> +
>  	adapter->regs = pci_dev->mem_resource[ENA_REGS_BAR].addr;
>  	adapter->dev_mem_base = pci_dev->mem_resource[ENA_MEM_BAR].addr;
>  
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH v1] drivers/net/ena: Copy PCI info to rte_eth_dev
  2018-01-16 19:16 ` Ferruh Yigit
@ 2018-01-17 20:49   ` Dey, Souvik
  0 siblings, 0 replies; 3+ messages in thread
From: Dey, Souvik @ 2018-01-17 20:49 UTC (permalink / raw)
  To: Ferruh Yigit, netanel, evgenys; +Cc: dev

Hi Yigit,
	I was testing with 16.11.2 dpdk version did found that few data were missing in the rte_eth_dev like the driver.name. Then tried to update my stream and check the handling and found the same missing. So raised the below patch. Now on double checking it looks like my pull from master failed and due to that I missed the below flow. 
 Yes, I cross checked and all the data is getting populated properly in the rte_eth_dev structure from the rte_pci_device. The below is not needed any more and can be removed. 
Thanks for pointing it out.

--
Regards,
Souvik


-----Original Message-----
From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Ferruh Yigit
Sent: Tuesday, January 16, 2018 2:17 PM
To: Dey, Souvik <sodey@rbbn.com>; jan@semihalf.com; jpa@semihalf.com; netanel@amazon.com; evgenys@amazon.com
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH v1] drivers/net/ena: Copy PCI info to rte_eth_dev

On 1/16/2018 7:06 PM, sodey@rbbn.com wrote:
> From: Souvik Dey <sodey@rbbn.com>
> 
> We need to add the pci_dev info to the rte_eth_dev structure during 
> the eth_ena_dev_init. Informantions like driver_name and numa_node 
> will not be populated otherwise.

stacktrace is like:

eth_ena_pci_probe
  rte_eth_dev_pci_generic_probe
    rte_eth_dev_pci_allocate
      rte_eth_copy_pci_info
    eth_ena_dev_init

So, before eth_ena_dev_init() called,  rte_eth_copy_pci_info() already should be called and eth_dev updated with pci_dev info. And you shouldn't need this patch.

Do you observe any missing data in eth_dev?

> 
> Signed-off-by: Souvik Dey <sodey@rbbn.com>
> 
> ---
> 
>  drivers/net/ena/ena_ethdev.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/net/ena/ena_ethdev.c 
> b/drivers/net/ena/ena_ethdev.c index ac0803d..329cb29 100644
> --- a/drivers/net/ena/ena_ethdev.c
> +++ b/drivers/net/ena/ena_ethdev.c
> @@ -1270,6 +1270,8 @@ static int eth_ena_dev_init(struct rte_eth_dev *eth_dev)
>  		     pci_dev->addr.devid,
>  		     pci_dev->addr.function);
>  
> +	rte_eth_copy_pci_info(eth_dev, pci_dev);
> +
>  	adapter->regs = pci_dev->mem_resource[ENA_REGS_BAR].addr;
>  	adapter->dev_mem_base = pci_dev->mem_resource[ENA_MEM_BAR].addr;
>  
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-01-17 20:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-16 19:06 [dpdk-dev] [PATCH v1] drivers/net/ena: Copy PCI info to rte_eth_dev sodey
2018-01-16 19:16 ` Ferruh Yigit
2018-01-17 20:49   ` Dey, Souvik

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).