mbox series

[PATCHv7,00/15] net/lwip: add lwip library for the network stack

Message ID 20230822093614.4717-1-maxim.uvarov@linaro.org
Headers show
Series net/lwip: add lwip library for the network stack | expand

Message

Maxim Uvarov Aug. 22, 2023, 9:35 a.m. UTC
Hello,

I'm sending v7, with all v6 comments getting fixed. The only thing left is a pointer
to timeout callback which 2 applications use. I will rework this timeout
in next v8. I started take a look at it, and want to fix this together
with background applications support in v8.

changelog:
	v7: - more review fixes.
	    - support of multiply eth devices, were "ethact" selects the
	      active device.
	v6: - fixed review comments for v5 (thanks Ilias and Simon).
	    - lwip is not under /net, so prior applying patch following
	      commit is needed to create lwIP merge into U-Boot:
	      git subtree add --prefix net/lwip/lwip-external https://git.savannah.nongnu.org/git/lwip.git master --squash

	v5: - fixed Iliases comments and split big patch on the small
		ones.
	    You also need to issue command:
    	git subtree add --prefix lib/lwip/lwip-external https://git.savannah.nongnu.org/git/lwip.git master --squash
	Which will create merge commit of lwip library placing sources
	into lib/lwip/lwip-external directory. I do not send it a patch
	due to 1. merges are not friendly with git format-patch and 2.
	the source code of lwip is 78kb. 
	v4: - tested with tests/py/ did some minor fixes (out of tree
		build, variables set after downloads).
	    - accounted review comments for documentation.
	    - implemented dns command
            - corrected wget command to not use serverip variable and use just
		url string.
	v3: - use lwip commands for ping,tftp,wget,dhcp if this patch
	      applied. Drop CONFIG_LIB_LWIP_REPLACE_<COMMAND> option.
	    - docs: use rst variant and drop references to RFC.

Maxim Uvarov (15):
  net/lwip: add doc/develop/net_lwip.rst
  net/lwip: integrate lwIP library
  net/lwip: implement dns cmd
  net/lwip: implement dhcp cmd
  net/lwip: implement tftp cmd
  net/lwip: implement wget cmd
  net/lwip: implement ping cmd
  net/lwip: add lwIP configuration
  net/lwip: implement lwIP port to U-Boot
  net/lwip: update .gitignore with lwIP
  net/lwip: connection between cmd and lwip apps
  net/lwip: replace original net commands with lwip
  net/lwip: split net.h to net.h, arp.h and eth.h
  net/lwip: drop old net/wget
  net/lwip/wget add port selection

 boot/bootmeth_efi.c                   |  18 +-
 boot/bootmeth_pxe.c                   |  21 +-
 cmd/Makefile                          |   1 +
 cmd/net-lwip.c                        | 306 ++++++++++++++++++
 cmd/net.c                             |  86 +----
 cmd/pxe.c                             |  19 +-
 doc/develop/index.rst                 |   1 +
 doc/develop/net_lwip.rst              |  76 +++++
 include/net.h                         | 197 +-----------
 include/net/arp.h                     |   7 +
 include/net/eth.h                     | 190 +++++++++++
 include/net/lwip.h                    |  73 +++++
 include/net/ulwip.h                   |  76 +++++
 include/net/wget.h                    |  22 --
 net/Kconfig                           |   3 +
 net/Makefile                          |   2 +-
 net/eth-uclass.c                      |   8 +
 net/lwip/.gitignore                   |   8 +
 net/lwip/Kconfig                      |  55 ++++
 net/lwip/Makefile                     |  72 +++++
 net/lwip/apps/dhcp/lwip-dhcp.c        |  62 ++++
 net/lwip/apps/dns/lwip-dns.c          |  46 +++
 net/lwip/apps/http/Makefile           |  13 +
 net/lwip/apps/http/lwip-wget.c        | 134 ++++++++
 net/lwip/apps/ping/Makefile           |  11 +
 net/lwip/apps/ping/lwip_ping.c        |  37 +++
 net/lwip/apps/ping/lwip_ping.h        |  15 +
 net/lwip/apps/ping/ping.h             |  19 ++
 net/lwip/apps/tftp/Makefile           |  16 +
 net/lwip/apps/tftp/lwip-tftp.c        | 124 ++++++++
 net/lwip/lwipopts.h                   | 197 ++++++++++++
 net/lwip/port/if.c                    | 343 ++++++++++++++++++++
 net/lwip/port/include/arch/cc.h       |  38 +++
 net/lwip/port/include/arch/sys_arch.h |  10 +
 net/lwip/port/include/limits.h        |   0
 net/lwip/port/sys-arch.c              |  13 +
 net/net.c                             |  26 +-
 net/wget.c                            | 440 --------------------------
 38 files changed, 2028 insertions(+), 757 deletions(-)
 create mode 100644 cmd/net-lwip.c
 create mode 100644 doc/develop/net_lwip.rst
 create mode 100644 include/net/arp.h
 create mode 100644 include/net/eth.h
 create mode 100644 include/net/lwip.h
 create mode 100644 include/net/ulwip.h
 delete mode 100644 include/net/wget.h
 create mode 100644 net/lwip/.gitignore
 create mode 100644 net/lwip/Kconfig
 create mode 100644 net/lwip/Makefile
 create mode 100644 net/lwip/apps/dhcp/lwip-dhcp.c
 create mode 100644 net/lwip/apps/dns/lwip-dns.c
 create mode 100644 net/lwip/apps/http/Makefile
 create mode 100644 net/lwip/apps/http/lwip-wget.c
 create mode 100644 net/lwip/apps/ping/Makefile
 create mode 100644 net/lwip/apps/ping/lwip_ping.c
 create mode 100644 net/lwip/apps/ping/lwip_ping.h
 create mode 100644 net/lwip/apps/ping/ping.h
 create mode 100644 net/lwip/apps/tftp/Makefile
 create mode 100644 net/lwip/apps/tftp/lwip-tftp.c
 create mode 100644 net/lwip/lwipopts.h
 create mode 100644 net/lwip/port/if.c
 create mode 100644 net/lwip/port/include/arch/cc.h
 create mode 100644 net/lwip/port/include/arch/sys_arch.h
 create mode 100644 net/lwip/port/include/limits.h
 create mode 100644 net/lwip/port/sys-arch.c
 delete mode 100644 net/wget.c

Comments

Michal Simek Sept. 7, 2023, 3:21 p.m. UTC | #1
Hi,

út 22. 8. 2023 v 11:38 odesílatel Maxim Uvarov <maxim.uvarov@linaro.org> napsal:
>
> Hello,
>
> I'm sending v7, with all v6 comments getting fixed. The only thing left is a pointer
> to timeout callback which 2 applications use. I will rework this timeout
> in next v8. I started take a look at it, and want to fix this together
> with background applications support in v8.
>
> changelog:
>         v7: - more review fixes.
>             - support of multiply eth devices, were "ethact" selects the
>               active device.
>         v6: - fixed review comments for v5 (thanks Ilias and Simon).
>             - lwip is not under /net, so prior applying patch following
>               commit is needed to create lwIP merge into U-Boot:
>               git subtree add --prefix net/lwip/lwip-external https://git.savannah.nongnu.org/git/lwip.git master --squash

I think you should integrate it via .gitmodules as is done for example in qemu.

The next part. I tried to use buildmain to build the whole series and
I am getting a lot of errors.
You should fix pretty much all of these errors to make sure that the
tree is bisectable.

Thanks,
Michal

[u-boot](lwip)$ ./tools/buildman/buildman -C -b `git rev-parse
--abbrev-ref HEAD` xilinx_zynqmp_virt -o /run/shm/ -sSed
Summary of 18 commits for 1 boards (1 thread, 12 jobs per thread)
01: Merge branch 'master' of https://gitlab.denx.de/u-boot/custodians/u-boot-usb
   aarch64:  w+   xilinx_zynqmp_virt
+===================== WARNING ======================
+This board uses CONFIG_SPL_FIT_GENERATOR. Please migrate
+to binman instead, to avoid the proliferation of
+arch-specific scripts with no tests.
+====================================================
02: net/lwip: add doc/develop/net_lwip.rst
03: net/lwip: integrate lwIP library
   aarch64:  +   xilinx_zynqmp_virt
-===================== WARNING ======================
-This board uses CONFIG_SPL_FIT_GENERATOR. Please migrate
-to binman instead, to avoid the proliferation of
-arch-specific scripts with no tests.
-====================================================
+make[3]: *** No rule to make target
'net/lwip/lwip-external/src/core/init.o', needed by
'net/lwip/built-in.o'.  Stop.
+make[2]: *** [../scripts/Makefile.build:397: net/lwip] Error 2
+../net/net.c:128:23: fatal error: net/ulwip.h: No such file or directory
+ #include <net/ulwip.h>
+                       ^
+compilation terminated.
+make[2]: *** [../scripts/Makefile.build:256: net/net.o] Error 1
+make[1]: *** [Makefile:1857: net] Error 2
+make: *** [Makefile:177: sub-make] Error 2
04: net/lwip: implement dns cmd
-make[2]: *** [../scripts/Makefile.build:256: net/net.o] Error 1
+make[2]: *** [../scripts/Makefile.build:257: net/net.o] Error 1
05: net/lwip: implement dhcp cmd
06: net/lwip: implement tftp cmd
+cp: cannot stat '../net/lwip/lwip-external/src/apps/tftp/tftp.c': No
such file or directory
+make[4]: *** [../net/lwip/apps/tftp/Makefile:9:
net/lwip/apps/tftp/tftp.c] Error 1
+../net/lwip/apps/tftp/lwip-tftp.c:12:35: fatal error:
lwip/apps/tftp_client.h: No such file or directory
+ #include "lwip/apps/tftp_client.h"
+                                   ^
+make[4]: *** [../scripts/Makefile.build:257:
net/lwip/apps/tftp/lwip-tftp.o] Error 1
+make[3]: *** [../scripts/Makefile.build:397: net/lwip/apps/tftp] Error 2
07: net/lwip: implement wget cmd
08: net/lwip: implement ping cmd
+cp: cannot stat '../net/lwip/lwip-external/contrib/apps/ping/ping.c':
No such file or directory
+make[4]: *** [../net/lwip/apps/ping/Makefile:8:
net/lwip/apps/ping/ping.c] Error 1
+../net/lwip/apps/ping/lwip_ping.c:7:22: fatal error: lwip/opt.h: No
such file or directory
+ #include "lwip/opt.h"
+                      ^
+make[4]: *** [../scripts/Makefile.build:257:
net/lwip/apps/ping/lwip_ping.o] Error 1
+make[3]: *** [../scripts/Makefile.build:397: net/lwip/apps/ping] Error 2
09: net/lwip: add lwIP configuration
10: net/lwip: implement lwIP port to U-Boot
-../net/lwip/apps/ping/lwip_ping.c:7:22: fatal error: lwip/opt.h: No
such file or directory
- #include "lwip/opt.h"
-                      ^
-make[4]: *** [../scripts/Makefile.build:257:
net/lwip/apps/ping/lwip_ping.o] Error 1
-../net/lwip/apps/tftp/lwip-tftp.c:12:35: fatal error:
lwip/apps/tftp_client.h: No such file or directory
- #include "lwip/apps/tftp_client.h"
-                                   ^
-make[4]: *** [../scripts/Makefile.build:257:
net/lwip/apps/tftp/lwip-tftp.o] Error 1
+../net/eth-uclass.c:35:2: error: unknown type name ‘ulwip’
+  ulwip ulwip;
+  ^~~~~
+  return &priv->ulwip;
+         ^~~~~~~~~~~~
+make[2]: *** [../scripts/Makefile.build:257: net/eth-uclass.o] Error 1
w+../net/eth-uclass.c: In function ‘eth_lwip_priv’:
w+../net/eth-uclass.c:355:9: warning: return from incompatible pointer
type [-Wincompatible-pointer-types]
11: net/lwip: update .gitignore with lwIP
+../net/lwip/apps/ping/lwip_ping.c:7:22: fatal error: lwip/opt.h: No
such file or directory
+ #include "lwip/opt.h"
+                      ^
+make[4]: *** [../scripts/Makefile.build:257:
net/lwip/apps/ping/lwip_ping.o] Error 1
+../net/lwip/apps/tftp/lwip-tftp.c:12:35: fatal error:
lwip/apps/tftp_client.h: No such file or directory
+ #include "lwip/apps/tftp_client.h"
+                                   ^
+make[4]: *** [../scripts/Makefile.build:257:
net/lwip/apps/tftp/lwip-tftp.o] Error 1
12: net/lwip: connection between cmd and lwip apps
-../net/lwip/apps/ping/lwip_ping.c:7:22: fatal error: lwip/opt.h: No
such file or directory
- #include "lwip/opt.h"
-                      ^
-make[4]: *** [../scripts/Makefile.build:257:
net/lwip/apps/ping/lwip_ping.o] Error 1
-../net/lwip/apps/tftp/lwip-tftp.c:12:35: fatal error:
lwip/apps/tftp_client.h: No such file or directory
- #include "lwip/apps/tftp_client.h"
-                                   ^
-make[4]: *** [../scripts/Makefile.build:257:
net/lwip/apps/tftp/lwip-tftp.o] Error 1
+../cmd/net-lwip.c:16:23: fatal error: net/ulwip.h: No such file or directory
+ #include "net/ulwip.h"
+make[2]: *** [../scripts/Makefile.build:257: cmd/net-lwip.o] Error 1
+make[1]: *** [Makefile:1857: cmd] Error 2
13: net/lwip: replace original net commands with lwip
-make[3]: *** No rule to make target
'net/lwip/lwip-external/src/core/init.o', needed by
'net/lwip/built-in.o'.  Stop.
-cp: cannot stat '../net/lwip/lwip-external/src/apps/tftp/tftp.c': No
such file or directory
-make[4]: *** [../net/lwip/apps/tftp/Makefile:9:
net/lwip/apps/tftp/tftp.c] Error 1
-make[3]: *** [../scripts/Makefile.build:397: net/lwip/apps/tftp] Error 2
-../cmd/net-lwip.c:16:23: fatal error: net/ulwip.h: No such file or directory
- #include "net/ulwip.h"
-                       ^
-compilation terminated.
-make[2]: *** [../scripts/Makefile.build:257: cmd/net-lwip.o] Error 1
-make[1]: *** [Makefile:1857: cmd] Error 2
-make[2]: *** [../scripts/Makefile.build:257: net/eth-uclass.o] Error 1
-../net/net.c:128:23: fatal error: net/ulwip.h: No such file or directory
- #include <net/ulwip.h>
-make[2]: *** [../scripts/Makefile.build:257: net/net.o] Error 1
+make[2]: *** [../scripts/Makefile.build:256: net/eth-uclass.o] Error 1
14: net/lwip: split net.h to net.h, arp.h and eth.h
-../net/eth-uclass.c:35:2: error: unknown type name ‘ulwip’
-  ulwip ulwip;
-  ^~~~~
-  return &priv->ulwip;
-         ^~~~~~~~~~~~
-make[2]: *** [../scripts/Makefile.build:256: net/eth-uclass.o] Error 1
w-../net/eth-uclass.c: In function ‘eth_lwip_priv’:
w-../net/eth-uclass.c:355:9: warning: return from incompatible pointer
type [-Wincompatible-pointer-types]
15: net/lwip: drop old net/wget
+make[3]: *** No rule to make target
'net/lwip/lwip-external/src/core/init.o', needed by
'net/lwip/built-in.o'.  Stop.
+cp: cannot stat '../net/lwip/lwip-external/src/apps/tftp/tftp.c': No
such file or directory
+make[4]: *** [../net/lwip/apps/tftp/Makefile:9:
net/lwip/apps/tftp/tftp.c] Error 1
+../net/lwip/apps/ping/lwip_ping.c:7:22: fatal error: lwip/opt.h: No
such file or directory
+ #include "lwip/opt.h"
+                      ^
+compilation terminated.
+make[4]: *** [../scripts/Makefile.build:257:
net/lwip/apps/ping/lwip_ping.o] Error 1
+../net/lwip/apps/tftp/lwip-tftp.c:12:35: fatal error:
lwip/apps/tftp_client.h: No such file or directory
+ #include "lwip/apps/tftp_client.h"
+                                   ^
+make[4]: *** [../scripts/Makefile.build:257:
net/lwip/apps/tftp/lwip-tftp.o] Error 1
+make[3]: *** [../scripts/Makefile.build:397: net/lwip/apps/tftp] Error 2
16: net/lwip/wget add port selection
17: Squashed 'net/lwip/lwip-external/' content from commit 84fde1ebbfe3
-make[3]: *** No rule to make target
'net/lwip/lwip-external/src/core/init.o', needed by
'net/lwip/built-in.o'.  Stop.
-cp: cannot stat '../net/lwip/lwip-external/contrib/apps/ping/ping.c':
No such file or directory
-make[4]: *** [../net/lwip/apps/ping/Makefile:8:
net/lwip/apps/ping/ping.c] Error 1
-cp: cannot stat '../net/lwip/lwip-external/src/apps/tftp/tftp.c': No
such file or directory
-make[4]: *** [../net/lwip/apps/tftp/Makefile:9:
net/lwip/apps/tftp/tftp.c] Error 1
-../net/lwip/apps/ping/lwip_ping.c:7:22: fatal error: lwip/opt.h: No
such file or directory
- #include "lwip/opt.h"
-                      ^
-compilation terminated.
-make[4]: *** [../scripts/Makefile.build:257:
net/lwip/apps/ping/lwip_ping.o] Error 1
-make[3]: *** [../scripts/Makefile.build:397: net/lwip/apps/ping] Error 2
-../net/lwip/apps/tftp/lwip-tftp.c:12:35: fatal error:
lwip/apps/tftp_client.h: No such file or directory
- #include "lwip/apps/tftp_client.h"
-                                   ^
-make[4]: *** [../scripts/Makefile.build:257:
net/lwip/apps/tftp/lwip-tftp.o] Error 1
-make[3]: *** [../scripts/Makefile.build:397: net/lwip/apps/tftp] Error 2
-make[2]: *** [../scripts/Makefile.build:397: net/lwip] Error 2
-make[1]: *** [Makefile:1857: net] Error 2
-make: *** [Makefile:177: sub-make] Error 2
+make: *** No rule to make target 'xilinx_zynqmp_virt_defconfig'.  Stop.
18: Merge commit 'c773d79082011e8d77cd4b125c07a84b8348af39' as
'net/lwip/lwip-external'
   aarch64:  w+   xilinx_zynqmp_virt
-make: *** No rule to make target 'xilinx_zynqmp_virt_defconfig'.  Stop.
+===================== WARNING ======================
+This board uses CONFIG_SPL_FIT_GENERATOR. Please migrate
+to binman instead, to avoid the proliferation of
+arch-specific scripts with no tests.
+====================================================
Maxim Uvarov Sept. 7, 2023, 3:44 p.m. UTC | #2
On Thu, 7 Sept 2023 at 21:21, Michal Simek <monstr@monstr.eu> wrote:

> Hi,
>
> út 22. 8. 2023 v 11:38 odesílatel Maxim Uvarov <maxim.uvarov@linaro.org>
> napsal:
> >
> > Hello,
> >
> > I'm sending v7, with all v6 comments getting fixed. The only thing left
> is a pointer
> > to timeout callback which 2 applications use. I will rework this timeout
> > in next v8. I started take a look at it, and want to fix this together
> > with background applications support in v8.
> >
> > changelog:
> >         v7: - more review fixes.
> >             - support of multiply eth devices, were "ethact" selects the
> >               active device.
> >         v6: - fixed review comments for v5 (thanks Ilias and Simon).
> >             - lwip is not under /net, so prior applying patch following
> >               commit is needed to create lwIP merge into U-Boot:
> >               git subtree add --prefix net/lwip/lwip-external
> https://git.savannah.nongnu.org/git/lwip.git master --squash
>
> I think you should integrate it via .gitmodules as is done for example in
> qemu.
>
> The next part. I tried to use buildmain to build the whole series and
> I am getting a lot of errors.
> You should fix pretty much all of these errors to make sure that the
> tree is bisectable.
>
> Thanks,
> Michal
>
>
Hello Michal, the first version was with .gitmodules. To  run  buildman you
need to create a subtree commit with the above line first, and only then
run buildman for patches.
And I think these series of patches are not friendly with sequential per
patch builds. It's split into logical pieces for easier review.

From the log below I can say that subtree commit was not created. lwIP
library files are missing in your set up.

BR,
Maxim.


> [u-boot](lwip)$ ./tools/buildman/buildman -C -b `git rev-parse
> --abbrev-ref HEAD` xilinx_zynqmp_virt -o /run/shm/ -sSed
> Summary of 18 commits for 1 boards (1 thread, 12 jobs per thread)
> 01: Merge branch 'master' of
> https://gitlab.denx.de/u-boot/custodians/u-boot-usb
>    aarch64:  w+   xilinx_zynqmp_virt
> +===================== WARNING ======================
> +This board uses CONFIG_SPL_FIT_GENERATOR. Please migrate
> +to binman instead, to avoid the proliferation of
> +arch-specific scripts with no tests.
> +====================================================
> 02: net/lwip: add doc/develop/net_lwip.rst
> 03: net/lwip: integrate lwIP library
>    aarch64:  +   xilinx_zynqmp_virt
> -===================== WARNING ======================
> -This board uses CONFIG_SPL_FIT_GENERATOR. Please migrate
> -to binman instead, to avoid the proliferation of
> -arch-specific scripts with no tests.
> -====================================================
> +make[3]: *** No rule to make target
> 'net/lwip/lwip-external/src/core/init.o', needed by
> 'net/lwip/built-in.o'.  Stop.
> +make[2]: *** [../scripts/Makefile.build:397: net/lwip] Error 2
> +../net/net.c:128:23: fatal error: net/ulwip.h: No such file or directory
> + #include <net/ulwip.h>
> +                       ^
> +compilation terminated.
> +make[2]: *** [../scripts/Makefile.build:256: net/net.o] Error 1
> +make[1]: *** [Makefile:1857: net] Error 2
> +make: *** [Makefile:177: sub-make] Error 2
> 04: net/lwip: implement dns cmd
> -make[2]: *** [../scripts/Makefile.build:256: net/net.o] Error 1
> +make[2]: *** [../scripts/Makefile.build:257: net/net.o] Error 1
> 05: net/lwip: implement dhcp cmd
> 06: net/lwip: implement tftp cmd
> +cp: cannot stat '../net/lwip/lwip-external/src/apps/tftp/tftp.c': No
> such file or directory
> +make[4]: *** [../net/lwip/apps/tftp/Makefile:9:
> net/lwip/apps/tftp/tftp.c] Error 1
> +../net/lwip/apps/tftp/lwip-tftp.c:12:35: fatal error:
> lwip/apps/tftp_client.h: No such file or directory
> + #include "lwip/apps/tftp_client.h"
> +                                   ^
> +make[4]: *** [../scripts/Makefile.build:257:
> net/lwip/apps/tftp/lwip-tftp.o] Error 1
> +make[3]: *** [../scripts/Makefile.build:397: net/lwip/apps/tftp] Error 2
> 07: net/lwip: implement wget cmd
> 08: net/lwip: implement ping cmd
> +cp: cannot stat '../net/lwip/lwip-external/contrib/apps/ping/ping.c':
> No such file or directory
> +make[4]: *** [../net/lwip/apps/ping/Makefile:8:
> net/lwip/apps/ping/ping.c] Error 1
> +../net/lwip/apps/ping/lwip_ping.c:7:22: fatal error: lwip/opt.h: No
> such file or directory
> + #include "lwip/opt.h"
> +                      ^
> +make[4]: *** [../scripts/Makefile.build:257:
> net/lwip/apps/ping/lwip_ping.o] Error 1
> +make[3]: *** [../scripts/Makefile.build:397: net/lwip/apps/ping] Error 2
> 09: net/lwip: add lwIP configuration
> 10: net/lwip: implement lwIP port to U-Boot
> -../net/lwip/apps/ping/lwip_ping.c:7:22: fatal error: lwip/opt.h: No
> such file or directory
> - #include "lwip/opt.h"
> -                      ^
> -make[4]: *** [../scripts/Makefile.build:257:
> net/lwip/apps/ping/lwip_ping.o] Error 1
> -../net/lwip/apps/tftp/lwip-tftp.c:12:35: fatal error:
> lwip/apps/tftp_client.h: No such file or directory
> - #include "lwip/apps/tftp_client.h"
> -                                   ^
> -make[4]: *** [../scripts/Makefile.build:257:
> net/lwip/apps/tftp/lwip-tftp.o] Error 1
> +../net/eth-uclass.c:35:2: error: unknown type name ‘ulwip’
> +  ulwip ulwip;
> +  ^~~~~
> +  return &priv->ulwip;
> +         ^~~~~~~~~~~~
> +make[2]: *** [../scripts/Makefile.build:257: net/eth-uclass.o] Error 1
> w+../net/eth-uclass.c: In function ‘eth_lwip_priv’:
> w+../net/eth-uclass.c:355:9: warning: return from incompatible pointer
> type [-Wincompatible-pointer-types]
> 11: net/lwip: update .gitignore with lwIP
> +../net/lwip/apps/ping/lwip_ping.c:7:22: fatal error: lwip/opt.h: No
> such file or directory
> + #include "lwip/opt.h"
> +                      ^
> +make[4]: *** [../scripts/Makefile.build:257:
> net/lwip/apps/ping/lwip_ping.o] Error 1
> +../net/lwip/apps/tftp/lwip-tftp.c:12:35: fatal error:
> lwip/apps/tftp_client.h: No such file or directory
> + #include "lwip/apps/tftp_client.h"
> +                                   ^
> +make[4]: *** [../scripts/Makefile.build:257:
> net/lwip/apps/tftp/lwip-tftp.o] Error 1
> 12: net/lwip: connection between cmd and lwip apps
> -../net/lwip/apps/ping/lwip_ping.c:7:22: fatal error: lwip/opt.h: No
> such file or directory
> - #include "lwip/opt.h"
> -                      ^
> -make[4]: *** [../scripts/Makefile.build:257:
> net/lwip/apps/ping/lwip_ping.o] Error 1
> -../net/lwip/apps/tftp/lwip-tftp.c:12:35: fatal error:
> lwip/apps/tftp_client.h: No such file or directory
> - #include "lwip/apps/tftp_client.h"
> -                                   ^
> -make[4]: *** [../scripts/Makefile.build:257:
> net/lwip/apps/tftp/lwip-tftp.o] Error 1
> +../cmd/net-lwip.c:16:23: fatal error: net/ulwip.h: No such file or
> directory
> + #include "net/ulwip.h"
> +make[2]: *** [../scripts/Makefile.build:257: cmd/net-lwip.o] Error 1
> +make[1]: *** [Makefile:1857: cmd] Error 2
> 13: net/lwip: replace original net commands with lwip
> -make[3]: *** No rule to make target
> 'net/lwip/lwip-external/src/core/init.o', needed by
> 'net/lwip/built-in.o'.  Stop.
> -cp: cannot stat '../net/lwip/lwip-external/src/apps/tftp/tftp.c': No
> such file or directory
> -make[4]: *** [../net/lwip/apps/tftp/Makefile:9:
> net/lwip/apps/tftp/tftp.c] Error 1
> -make[3]: *** [../scripts/Makefile.build:397: net/lwip/apps/tftp] Error 2
> -../cmd/net-lwip.c:16:23: fatal error: net/ulwip.h: No such file or
> directory
> - #include "net/ulwip.h"
> -                       ^
> -compilation terminated.
> -make[2]: *** [../scripts/Makefile.build:257: cmd/net-lwip.o] Error 1
> -make[1]: *** [Makefile:1857: cmd] Error 2
> -make[2]: *** [../scripts/Makefile.build:257: net/eth-uclass.o] Error 1
> -../net/net.c:128:23: fatal error: net/ulwip.h: No such file or directory
> - #include <net/ulwip.h>
> -make[2]: *** [../scripts/Makefile.build:257: net/net.o] Error 1
> +make[2]: *** [../scripts/Makefile.build:256: net/eth-uclass.o] Error 1
> 14: net/lwip: split net.h to net.h, arp.h and eth.h
> -../net/eth-uclass.c:35:2: error: unknown type name ‘ulwip’
> -  ulwip ulwip;
> -  ^~~~~
> -  return &priv->ulwip;
> -         ^~~~~~~~~~~~
> -make[2]: *** [../scripts/Makefile.build:256: net/eth-uclass.o] Error 1
> w-../net/eth-uclass.c: In function ‘eth_lwip_priv’:
> w-../net/eth-uclass.c:355:9: warning: return from incompatible pointer
> type [-Wincompatible-pointer-types]
> 15: net/lwip: drop old net/wget
> +make[3]: *** No rule to make target
> 'net/lwip/lwip-external/src/core/init.o', needed by
> 'net/lwip/built-in.o'.  Stop.
> +cp: cannot stat '../net/lwip/lwip-external/src/apps/tftp/tftp.c': No
> such file or directory
> +make[4]: *** [../net/lwip/apps/tftp/Makefile:9:
> net/lwip/apps/tftp/tftp.c] Error 1
> +../net/lwip/apps/ping/lwip_ping.c:7:22: fatal error: lwip/opt.h: No
> such file or directory
> + #include "lwip/opt.h"
> +                      ^
> +compilation terminated.
> +make[4]: *** [../scripts/Makefile.build:257:
> net/lwip/apps/ping/lwip_ping.o] Error 1
> +../net/lwip/apps/tftp/lwip-tftp.c:12:35: fatal error:
> lwip/apps/tftp_client.h: No such file or directory
> + #include "lwip/apps/tftp_client.h"
> +                                   ^
> +make[4]: *** [../scripts/Makefile.build:257:
> net/lwip/apps/tftp/lwip-tftp.o] Error 1
> +make[3]: *** [../scripts/Makefile.build:397: net/lwip/apps/tftp] Error 2
> 16: net/lwip/wget add port selection
> 17: Squashed 'net/lwip/lwip-external/' content from commit 84fde1ebbfe3
> -make[3]: *** No rule to make target
> 'net/lwip/lwip-external/src/core/init.o', needed by
> 'net/lwip/built-in.o'.  Stop.
> -cp: cannot stat '../net/lwip/lwip-external/contrib/apps/ping/ping.c':
> No such file or directory
> -make[4]: *** [../net/lwip/apps/ping/Makefile:8:
> net/lwip/apps/ping/ping.c] Error 1
> -cp: cannot stat '../net/lwip/lwip-external/src/apps/tftp/tftp.c': No
> such file or directory
> -make[4]: *** [../net/lwip/apps/tftp/Makefile:9:
> net/lwip/apps/tftp/tftp.c] Error 1
> -../net/lwip/apps/ping/lwip_ping.c:7:22: fatal error: lwip/opt.h: No
> such file or directory
> - #include "lwip/opt.h"
> -                      ^
> -compilation terminated.
> -make[4]: *** [../scripts/Makefile.build:257:
> net/lwip/apps/ping/lwip_ping.o] Error 1
> -make[3]: *** [../scripts/Makefile.build:397: net/lwip/apps/ping] Error 2
> -../net/lwip/apps/tftp/lwip-tftp.c:12:35: fatal error:
> lwip/apps/tftp_client.h: No such file or directory
> - #include "lwip/apps/tftp_client.h"
> -                                   ^
> -make[4]: *** [../scripts/Makefile.build:257:
> net/lwip/apps/tftp/lwip-tftp.o] Error 1
> -make[3]: *** [../scripts/Makefile.build:397: net/lwip/apps/tftp] Error 2
> -make[2]: *** [../scripts/Makefile.build:397: net/lwip] Error 2
> -make[1]: *** [Makefile:1857: net] Error 2
> -make: *** [Makefile:177: sub-make] Error 2
> +make: *** No rule to make target 'xilinx_zynqmp_virt_defconfig'.  Stop.
> 18: Merge commit 'c773d79082011e8d77cd4b125c07a84b8348af39' as
> 'net/lwip/lwip-external'
>    aarch64:  w+   xilinx_zynqmp_virt
> -make: *** No rule to make target 'xilinx_zynqmp_virt_defconfig'.  Stop.
> +===================== WARNING ======================
> +This board uses CONFIG_SPL_FIT_GENERATOR. Please migrate
> +to binman instead, to avoid the proliferation of
> +arch-specific scripts with no tests.
> +====================================================
>
Tom Rini Sept. 7, 2023, 7:23 p.m. UTC | #3
On Thu, Sep 07, 2023 at 05:21:18PM +0200, Michal Simek wrote:
> Hi,
> 
> út 22. 8. 2023 v 11:38 odesílatel Maxim Uvarov <maxim.uvarov@linaro.org> napsal:
> >
> > Hello,
> >
> > I'm sending v7, with all v6 comments getting fixed. The only thing left is a pointer
> > to timeout callback which 2 applications use. I will rework this timeout
> > in next v8. I started take a look at it, and want to fix this together
> > with background applications support in v8.
> >
> > changelog:
> >         v7: - more review fixes.
> >             - support of multiply eth devices, were "ethact" selects the
> >               active device.
> >         v6: - fixed review comments for v5 (thanks Ilias and Simon).
> >             - lwip is not under /net, so prior applying patch following
> >               commit is needed to create lwIP merge into U-Boot:
> >               git subtree add --prefix net/lwip/lwip-external https://git.savannah.nongnu.org/git/lwip.git master --squash
> 
> I think you should integrate it via .gitmodules as is done for example in qemu.

I _think_ I am leaning towards subtree, but it sounds like we need to
make the initial build easier, perhaps some Makefile logic to see we
haven't added, and then do what's needed?
Michal Simek Sept. 8, 2023, 6:30 a.m. UTC | #4
On 9/7/23 21:23, Tom Rini wrote:
> On Thu, Sep 07, 2023 at 05:21:18PM +0200, Michal Simek wrote:
>> Hi,
>>
>> út 22. 8. 2023 v 11:38 odesílatel Maxim Uvarov <maxim.uvarov@linaro.org> napsal:
>>>
>>> Hello,
>>>
>>> I'm sending v7, with all v6 comments getting fixed. The only thing left is a pointer
>>> to timeout callback which 2 applications use. I will rework this timeout
>>> in next v8. I started take a look at it, and want to fix this together
>>> with background applications support in v8.
>>>
>>> changelog:
>>>          v7: - more review fixes.
>>>              - support of multiply eth devices, were "ethact" selects the
>>>                active device.
>>>          v6: - fixed review comments for v5 (thanks Ilias and Simon).
>>>              - lwip is not under /net, so prior applying patch following
>>>                commit is needed to create lwIP merge into U-Boot:
>>>                git subtree add --prefix net/lwip/lwip-external https://git.savannah.nongnu.org/git/lwip.git master --squash
>>
>> I think you should integrate it via .gitmodules as is done for example in qemu.
> 
> I _think_ I am leaning towards subtree, but it sounds like we need to
> make the initial build easier, perhaps some Makefile logic to see we
> haven't added, and then do what's needed?
> 

Definitely it has to solved without any manual step. And this is enabled by 
default for all platforms. I pretty much think that it should be disabled now 
and when tested properly it can become default y.

Thanks,
Michal