[dpdk-dev,6/9] eal: initialize vdevs right next to pci devices

Message ID 1454076516-21591-7-git-send-email-david.marchand@6wind.com (mailing list archive)
State Changes Requested, archived
Headers

Commit Message

David Marchand Jan. 29, 2016, 2:08 p.m. UTC
  This way, the resources probing happens in a common place.

Signed-off-by: David Marchand <david.marchand@6wind.com>
---
 lib/librte_eal/bsdapp/eal/eal.c         | 7 +++++++
 lib/librte_eal/common/include/rte_dev.h | 2 +-
 lib/librte_eal/linuxapp/eal/eal.c       | 7 +++++++
 3 files changed, 15 insertions(+), 1 deletion(-)
  

Comments

Jan Viktorin Feb. 10, 2016, 11:05 a.m. UTC | #1
On Fri, 29 Jan 2016 15:08:33 +0100
David Marchand <david.marchand@6wind.com> wrote:

> This way, the resources probing happens in a common place.
> 
> Signed-off-by: David Marchand <david.marchand@6wind.com>
> ---
>  lib/librte_eal/bsdapp/eal/eal.c         | 7 +++++++
>  lib/librte_eal/common/include/rte_dev.h | 2 +-
>  lib/librte_eal/linuxapp/eal/eal.c       | 7 +++++++
>  3 files changed, 15 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/librte_eal/bsdapp/eal/eal.c b/lib/librte_eal/bsdapp/eal/eal.c
> index a34e61d..b557a9f 100644
> --- a/lib/librte_eal/bsdapp/eal/eal.c
> +++ b/lib/librte_eal/bsdapp/eal/eal.c
> @@ -582,8 +582,10 @@ rte_eal_init(int argc, char **argv)
>  		rte_config.master_lcore, thread_id, cpuset,
>  		ret == 0 ? "" : "...");
>  
> +#ifndef RTE_NEXT_ABI
>  	if (rte_eal_dev_init() < 0)
>  		rte_panic("Cannot init pmd devices\n");
> +#endif
>  
>  	RTE_LCORE_FOREACH_SLAVE(i) {
>  
> @@ -617,6 +619,11 @@ rte_eal_init(int argc, char **argv)
>  	rte_eal_mp_remote_launch(sync_func, NULL, SKIP_MASTER);
>  	rte_eal_mp_wait_lcore();
>  
> +#ifdef RTE_NEXT_ABI
> +	if (rte_eal_dev_init() < 0)
> +		rte_panic("Cannot probe vdev devices\n");
> +#endif
> +
>  	/* Probe & Initialize PCI devices */
>  	if (rte_eal_pci_probe())
>  		rte_panic("Cannot probe PCI\n");
> diff --git a/lib/librte_eal/common/include/rte_dev.h b/lib/librte_eal/common/include/rte_dev.h
> index 88c1a19..df69e28 100644
> --- a/lib/librte_eal/common/include/rte_dev.h
> +++ b/lib/librte_eal/common/include/rte_dev.h
> @@ -156,7 +156,7 @@ void rte_eal_driver_register(struct rte_driver *driver);
>  void rte_eal_driver_unregister(struct rte_driver *driver);
>  
>  /**
> - * Initalize all the registered drivers in this process
> + * Scan all devargs and attach to drivers if available
>   */
>  int rte_eal_dev_init(void);

Move this to a separate commit? Is it just a forgotten doc comment?

>  
> diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c
> index 62241ee..95313af 100644
> --- a/lib/librte_eal/linuxapp/eal/eal.c
> +++ b/lib/librte_eal/linuxapp/eal/eal.c
> @@ -834,8 +834,10 @@ rte_eal_init(int argc, char **argv)
>  		rte_config.master_lcore, (int)thread_id, cpuset,
>  		ret == 0 ? "" : "...");
>  
> +#ifndef RTE_NEXT_ABI
>  	if (rte_eal_dev_init() < 0)
>  		rte_panic("Cannot init pmd devices\n");
> +#endif
>  
>  	RTE_LCORE_FOREACH_SLAVE(i) {
>  
> @@ -873,6 +875,11 @@ rte_eal_init(int argc, char **argv)
>  	rte_eal_mp_remote_launch(sync_func, NULL, SKIP_MASTER);
>  	rte_eal_mp_wait_lcore();
>  
> +#ifdef RTE_NEXT_ABI
> +	if (rte_eal_dev_init() < 0)
> +		rte_panic("Cannot probe vdev devices\n");
> +#endif
> +
>  	/* Probe & Initialize PCI devices */
>  	if (rte_eal_pci_probe())
>  		rte_panic("Cannot probe PCI\n");

I cannot see the point why it is enclosed in the RTE_NEXT_ABI. Is it
such a serious breakage?

Regards
Jan
  
David Marchand Feb. 10, 2016, 11:43 a.m. UTC | #2
On Wed, Feb 10, 2016 at 12:05 PM, Jan Viktorin <viktorin@rehivetech.com> wrote:
> On Fri, 29 Jan 2016 15:08:33 +0100
> David Marchand <david.marchand@6wind.com> wrote:
>> --- a/lib/librte_eal/common/include/rte_dev.h
>> +++ b/lib/librte_eal/common/include/rte_dev.h
>> @@ -156,7 +156,7 @@ void rte_eal_driver_register(struct rte_driver *driver);
>>  void rte_eal_driver_unregister(struct rte_driver *driver);
>>
>>  /**
>> - * Initalize all the registered drivers in this process
>> + * Scan all devargs and attach to drivers if available
>>   */
>>  int rte_eal_dev_init(void);
>
> Move this to a separate commit? Is it just a forgotten doc comment?

Should be in previous commit, yes.

>>
>> diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c
>> index 62241ee..95313af 100644
>> --- a/lib/librte_eal/linuxapp/eal/eal.c
>> +++ b/lib/librte_eal/linuxapp/eal/eal.c
>> @@ -834,8 +834,10 @@ rte_eal_init(int argc, char **argv)
>>               rte_config.master_lcore, (int)thread_id, cpuset,
>>               ret == 0 ? "" : "...");
>>
>> +#ifndef RTE_NEXT_ABI
>>       if (rte_eal_dev_init() < 0)
>>               rte_panic("Cannot init pmd devices\n");
>> +#endif
>>
>>       RTE_LCORE_FOREACH_SLAVE(i) {
>>
>> @@ -873,6 +875,11 @@ rte_eal_init(int argc, char **argv)
>>       rte_eal_mp_remote_launch(sync_func, NULL, SKIP_MASTER);
>>       rte_eal_mp_wait_lcore();
>>
>> +#ifdef RTE_NEXT_ABI
>> +     if (rte_eal_dev_init() < 0)
>> +             rte_panic("Cannot probe vdev devices\n");
>> +#endif
>> +
>>       /* Probe & Initialize PCI devices */
>>       if (rte_eal_pci_probe())
>>               rte_panic("Cannot probe PCI\n");
>
> I cannot see the point why it is enclosed in the RTE_NEXT_ABI. Is it
> such a serious breakage?

No.
We can make this move unconditional.

Thanks.
  

Patch

diff --git a/lib/librte_eal/bsdapp/eal/eal.c b/lib/librte_eal/bsdapp/eal/eal.c
index a34e61d..b557a9f 100644
--- a/lib/librte_eal/bsdapp/eal/eal.c
+++ b/lib/librte_eal/bsdapp/eal/eal.c
@@ -582,8 +582,10 @@  rte_eal_init(int argc, char **argv)
 		rte_config.master_lcore, thread_id, cpuset,
 		ret == 0 ? "" : "...");
 
+#ifndef RTE_NEXT_ABI
 	if (rte_eal_dev_init() < 0)
 		rte_panic("Cannot init pmd devices\n");
+#endif
 
 	RTE_LCORE_FOREACH_SLAVE(i) {
 
@@ -617,6 +619,11 @@  rte_eal_init(int argc, char **argv)
 	rte_eal_mp_remote_launch(sync_func, NULL, SKIP_MASTER);
 	rte_eal_mp_wait_lcore();
 
+#ifdef RTE_NEXT_ABI
+	if (rte_eal_dev_init() < 0)
+		rte_panic("Cannot probe vdev devices\n");
+#endif
+
 	/* Probe & Initialize PCI devices */
 	if (rte_eal_pci_probe())
 		rte_panic("Cannot probe PCI\n");
diff --git a/lib/librte_eal/common/include/rte_dev.h b/lib/librte_eal/common/include/rte_dev.h
index 88c1a19..df69e28 100644
--- a/lib/librte_eal/common/include/rte_dev.h
+++ b/lib/librte_eal/common/include/rte_dev.h
@@ -156,7 +156,7 @@  void rte_eal_driver_register(struct rte_driver *driver);
 void rte_eal_driver_unregister(struct rte_driver *driver);
 
 /**
- * Initalize all the registered drivers in this process
+ * Scan all devargs and attach to drivers if available
  */
 int rte_eal_dev_init(void);
 
diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c
index 62241ee..95313af 100644
--- a/lib/librte_eal/linuxapp/eal/eal.c
+++ b/lib/librte_eal/linuxapp/eal/eal.c
@@ -834,8 +834,10 @@  rte_eal_init(int argc, char **argv)
 		rte_config.master_lcore, (int)thread_id, cpuset,
 		ret == 0 ? "" : "...");
 
+#ifndef RTE_NEXT_ABI
 	if (rte_eal_dev_init() < 0)
 		rte_panic("Cannot init pmd devices\n");
+#endif
 
 	RTE_LCORE_FOREACH_SLAVE(i) {
 
@@ -873,6 +875,11 @@  rte_eal_init(int argc, char **argv)
 	rte_eal_mp_remote_launch(sync_func, NULL, SKIP_MASTER);
 	rte_eal_mp_wait_lcore();
 
+#ifdef RTE_NEXT_ABI
+	if (rte_eal_dev_init() < 0)
+		rte_panic("Cannot probe vdev devices\n");
+#endif
+
 	/* Probe & Initialize PCI devices */
 	if (rte_eal_pci_probe())
 		rte_panic("Cannot probe PCI\n");