[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Minios-devel] [UNIKRAFT PATCH] lib/ukboot: Split liblwip_init in netdev and netif init



This patch must be applied after the lwIP interface configurations.

On Tue, Jul 24, 2018, 19:36 Razvan Cojocaru <razvan.cojocaru93@xxxxxxxxx> wrote:
Split the generit init function liblwip_init in two separate
ones: liblwip_init_netdev, which performs network device and
driver configuration and liblwip_init_netif which does lwIP
network interface set up.

Signed-off-by: Razvan Cojocaru <razvan.cojocaru93@xxxxxxxxx>
---
 lib/ukboot/boot.c | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/lib/ukboot/boot.c b/lib/ukboot/boot.c
index 93f3371..d1b5cd3 100644
--- a/lib/ukboot/boot.c
+++ b/lib/ukboot/boot.c
@@ -61,9 +61,6 @@
 #endif /* CONFIG_LIBUKBUS */

 int main(int argc, char *argv[]) __weak;
-#ifdef CONFIG_LIBLWIP
-extern int liblwip_init(void);
-#endif /* CONFIG_LIBLWIP */

 static void main_thread_func(void *arg) __noreturn;

@@ -91,17 +88,26 @@ static void main_thread_func(void *arg)
        uk_bus_init_all(uk_alloc_get_default());
        uk_printd(DLVL_INFO, "Probe buses...\n");
        uk_bus_probe_all();
-#endif /* CONFIG_LIBUKBUS */

-#ifdef CONFIG_LIBLWIP
        /*
         * TODO: This is an initial implementation where we call the
         * initialization of lwip directly. We will remove this call
         * as soon as we introduced a more generic scheme for
         * (external) library initializations.
         */
-       liblwip_init();
-#endif /* CONFIG_LIBLWIP */
+#ifdef CONFIG_LIBLWIP
+       /* Start networking */
+       uk_printd(DLVL_INFO, "Initialize network devices...\n");
+       ret = liblwip_init_netdev();
+       if (ret)
+               uk_printd(DLVL_WARN, "Failed to initialize network devices\n");
+
+       uk_printd(DLVL_INFO, "Initialize lwIP stack...\n");
+       ret = liblwip_init_netif();
+       if (ret)
+               uk_printd(DLVL_WARN, "Failed to initialize lwIP stack\n");
+#endif
+#endif

        /* call main */
        ret = main(tma->argc, tma->argv);
--
2.7.4

_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.