DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/ena: initialize PCI info in eth_ena_dev_init
@ 2019-12-10 22:37 David Harton
  2019-12-11  8:45 ` Michał Krawczyk
  2019-12-12 14:53 ` Ferruh Yigit
  0 siblings, 2 replies; 6+ messages in thread
From: David Harton @ 2019-12-10 22:37 UTC (permalink / raw)
  To: dev, mw, mk, gtzalik, evgenys, igorch; +Cc: David Harton

Network drivers were originally modified to initialize PCI info with
commit eeefe73f0af1 ("drivers: copy PCI device info to ethdev data").
Modifying net/ena to conform.

Signed-off-by: David Harton <dharton@cisco.com>
---
 drivers/net/ena/ena_ethdev.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
index 7d4a3b225..4170cf749 100644
--- a/drivers/net/ena/ena_ethdev.c
+++ b/drivers/net/ena/ena_ethdev.c
@@ -1701,6 +1701,7 @@ static int eth_ena_dev_init(struct rte_eth_dev *eth_dev)
 	adapter->rte_dev = eth_dev;
 
 	pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
+	rte_eth_copy_pci_info(eth_dev, pci_dev);
 	adapter->pdev = pci_dev;
 
 	PMD_INIT_LOG(INFO, "Initializing %x:%x:%x.%d",
-- 
2.19.1


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

* Re: [dpdk-dev] [PATCH] net/ena: initialize PCI info in eth_ena_dev_init
  2019-12-10 22:37 [dpdk-dev] [PATCH] net/ena: initialize PCI info in eth_ena_dev_init David Harton
@ 2019-12-11  8:45 ` Michał Krawczyk
  2019-12-12 14:53 ` Ferruh Yigit
  1 sibling, 0 replies; 6+ messages in thread
From: Michał Krawczyk @ 2019-12-11  8:45 UTC (permalink / raw)
  To: David Harton
  Cc: dev, Marcin Wojtas, Tzalik, Guy, Schmeilin, Evgeny, Chauskin, Igor

wt., 10 gru 2019 o 23:37 David Harton <dharton@cisco.com> napisał(a):
>
> Network drivers were originally modified to initialize PCI info with
> commit eeefe73f0af1 ("drivers: copy PCI device info to ethdev data").
> Modifying net/ena to conform.
>
> Signed-off-by: David Harton <dharton@cisco.com>
Acked-by: Michal Krawczyk <mk@semihalf.com>

> ---
>  drivers/net/ena/ena_ethdev.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
> index 7d4a3b225..4170cf749 100644
> --- a/drivers/net/ena/ena_ethdev.c
> +++ b/drivers/net/ena/ena_ethdev.c
> @@ -1701,6 +1701,7 @@ static int eth_ena_dev_init(struct rte_eth_dev *eth_dev)
>         adapter->rte_dev = eth_dev;
>
>         pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
> +       rte_eth_copy_pci_info(eth_dev, pci_dev);
>         adapter->pdev = pci_dev;
>
>         PMD_INIT_LOG(INFO, "Initializing %x:%x:%x.%d",
> --
> 2.19.1
>

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

* Re: [dpdk-dev] [PATCH] net/ena: initialize PCI info in eth_ena_dev_init
  2019-12-10 22:37 [dpdk-dev] [PATCH] net/ena: initialize PCI info in eth_ena_dev_init David Harton
  2019-12-11  8:45 ` Michał Krawczyk
@ 2019-12-12 14:53 ` Ferruh Yigit
  2019-12-12 15:52   ` David Harton (dharton)
  1 sibling, 1 reply; 6+ messages in thread
From: Ferruh Yigit @ 2019-12-12 14:53 UTC (permalink / raw)
  To: David Harton, dev, mw, mk, gtzalik, evgenys, igorch

On 12/10/2019 10:37 PM, David Harton wrote:
> Network drivers were originally modified to initialize PCI info with
> commit eeefe73f0af1 ("drivers: copy PCI device info to ethdev data").
> Modifying net/ena to conform.
> 
> Signed-off-by: David Harton <dharton@cisco.com>
> ---
>  drivers/net/ena/ena_ethdev.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
> index 7d4a3b225..4170cf749 100644
> --- a/drivers/net/ena/ena_ethdev.c
> +++ b/drivers/net/ena/ena_ethdev.c
> @@ -1701,6 +1701,7 @@ static int eth_ena_dev_init(struct rte_eth_dev *eth_dev)
>  	adapter->rte_dev = eth_dev;
>  
>  	pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
> +	rte_eth_copy_pci_info(eth_dev, pci_dev);
>  	adapter->pdev = pci_dev;
>  
>  	PMD_INIT_LOG(INFO, "Initializing %x:%x:%x.%d",
> 

Hi David,

Is it really needed, since it should be called by API already [1], what field in
eth_dev was missing?

[1]
eth_ena_pci_probe()
  rte_eth_dev_pci_generic_probe(eth_ena_dev_init)
    rte_eth_dev_pci_allocate()
      rte_eth_copy_pci_info()
    eth_ena_dev_init()

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

* Re: [dpdk-dev] [PATCH] net/ena: initialize PCI info in eth_ena_dev_init
  2019-12-12 14:53 ` Ferruh Yigit
@ 2019-12-12 15:52   ` David Harton (dharton)
  0 siblings, 0 replies; 6+ messages in thread
From: David Harton (dharton) @ 2019-12-12 15:52 UTC (permalink / raw)
  To: Ferruh Yigit, dev, mw, mk, gtzalik, evgenys, igorch

> -----Original Message-----
> From: Ferruh Yigit <ferruh.yigit@intel.com>
> Sent: Thursday, December 12, 2019 9:54 AM
> To: David Harton (dharton) <dharton@cisco.com>; dev@dpdk.org;
> mw@semihalf.com; mk@semihalf.com; gtzalik@amazon.com; evgenys@amazon.com;
> igorch@amazon.com
> Subject: Re: [dpdk-dev] [PATCH] net/ena: initialize PCI info in
> eth_ena_dev_init
> 
> On 12/10/2019 10:37 PM, David Harton wrote:
> > Network drivers were originally modified to initialize PCI info with
> > commit eeefe73f0af1 ("drivers: copy PCI device info to ethdev data").
> > Modifying net/ena to conform.
> >
> > Signed-off-by: David Harton <dharton@cisco.com>
> > ---
> >  drivers/net/ena/ena_ethdev.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/net/ena/ena_ethdev.c
> > b/drivers/net/ena/ena_ethdev.c index 7d4a3b225..4170cf749 100644
> > --- a/drivers/net/ena/ena_ethdev.c
> > +++ b/drivers/net/ena/ena_ethdev.c
> > @@ -1701,6 +1701,7 @@ static int eth_ena_dev_init(struct rte_eth_dev
> *eth_dev)
> >  	adapter->rte_dev = eth_dev;
> >
> >  	pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
> > +	rte_eth_copy_pci_info(eth_dev, pci_dev);
> >  	adapter->pdev = pci_dev;
> >
> >  	PMD_INIT_LOG(INFO, "Initializing %x:%x:%x.%d",
> >
> 
> Hi David,
> 
> Is it really needed, since it should be called by API already [1], what
> field in eth_dev was missing?

Hi Ferruh,

Great catch!  I'm embarrassed.

In all honesty, I made this fix for our applications back for DPDK 16.07.  At that time, the drv_name used to get initialized by rte_eth_copy_pci_info() and each driver was responsible for calling rte_eth_copy_pci_info() in their init functions.  Our apps would crash for ena devices when we tried to reference the drv_name.

I just realized I had never upstreamed this private patch and pushed it along with some others recently made yesterday.

So, you're 100% right it is no longer needed.  Probably all of the drivers should remove calling it in their init functions to remove this legacy/deprecated requirement.

Sorry for the noise...

Regards,
Dave

> 
> [1]
> eth_ena_pci_probe()
>   rte_eth_dev_pci_generic_probe(eth_ena_dev_init)
>     rte_eth_dev_pci_allocate()
>       rte_eth_copy_pci_info()
>     eth_ena_dev_init()

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

* [dpdk-dev] [PATCH] net/ena: initialize PCI info in eth_ena_dev_init
@ 2019-12-10 22:18 David Harton
  0 siblings, 0 replies; 6+ messages in thread
From: David Harton @ 2019-12-10 22:18 UTC (permalink / raw)
  To: dev, mw, mk, gtzalik, evgenys, igorch; +Cc: David Harton

Network drivers were originally modified to initialize PCI info
with commit eeefe73f.  Modifying net/ena to conform.

Signed-off-by: David Harton <dharton@cisco.com>
---
 drivers/net/ena/ena_ethdev.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
index 7d4a3b225..4170cf749 100644
--- a/drivers/net/ena/ena_ethdev.c
+++ b/drivers/net/ena/ena_ethdev.c
@@ -1701,6 +1701,7 @@ static int eth_ena_dev_init(struct rte_eth_dev *eth_dev)
 	adapter->rte_dev = eth_dev;
 
 	pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
+	rte_eth_copy_pci_info(eth_dev, pci_dev);
 	adapter->pdev = pci_dev;
 
 	PMD_INIT_LOG(INFO, "Initializing %x:%x:%x.%d",
-- 
2.19.1


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

* [dpdk-dev] [PATCH] net/ena: initialize PCI info in eth_ena_dev_init
@ 2019-12-10 22:13 David Harton
  0 siblings, 0 replies; 6+ messages in thread
From: David Harton @ 2019-12-10 22:13 UTC (permalink / raw)
  To: dev, mw, mk, gtzalik, evgenys, igorch; +Cc: David Harton

Network drivers were originally modified to initialize PCI info
with commit eeefe73f.  Modifying net/ena to conform.

Signed-off-by: David Harton <dharton@cisco.com>
---
 drivers/net/ena/ena_ethdev.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
index 7d4a3b225..ccbc0160e 100644
--- a/drivers/net/ena/ena_ethdev.c
+++ b/drivers/net/ena/ena_ethdev.c
@@ -1701,6 +1701,7 @@ static int eth_ena_dev_init(struct rte_eth_dev *eth_dev)
 	adapter->rte_dev = eth_dev;
 
 	pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
+        rte_eth_copy_pci_info(eth_dev, pci_dev);
 	adapter->pdev = pci_dev;
 
 	PMD_INIT_LOG(INFO, "Initializing %x:%x:%x.%d",
-- 
2.19.1


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

end of thread, other threads:[~2019-12-12 15:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-10 22:37 [dpdk-dev] [PATCH] net/ena: initialize PCI info in eth_ena_dev_init David Harton
2019-12-11  8:45 ` Michał Krawczyk
2019-12-12 14:53 ` Ferruh Yigit
2019-12-12 15:52   ` David Harton (dharton)
  -- strict thread matches above, loose matches on Subject: below --
2019-12-10 22:18 David Harton
2019-12-10 22:13 David Harton

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