mbox series

[PATCHv4,0/5] net/lwip: add lwip library for the network stack

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

Message

Maxim Uvarov July 14, 2023, 2:19 p.m. UTC
changelog:
	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.

build:
	git submodule init
	git submodule update
	make 

I tested with qemu and ubuntu host for the server manually and with
./test/py/test -bd qemu_arm64 --build -k net.

Maxim Uvarov (5):
  net/lwip: add lwip-external submodule
  net/lwip: add lwip library for the network stack
  net/lwip: add doc/develop/net_lwip.rst
  net/lwip: add dns command
  net/lwip: apps/http: add dns support

 .gitignore                            |   9 +
 .gitmodules                           |   3 +
 boot/bootmeth_pxe.c                   |   2 +-
 cmd/net.c                             |  89 +-------
 cmd/pxe.c                             |   2 +-
 doc/develop/index.rst                 |   1 +
 doc/develop/net_lwip.rst              |  59 +++++
 include/net.h                         |   8 +-
 lib/Kconfig                           |   2 +
 lib/Makefile                          |   2 +
 lib/lwip/Kconfig                      |  63 ++++++
 lib/lwip/Makefile                     | 103 +++++++++
 lib/lwip/apps/dhcp/lwip-dhcp.c        |  52 +++++
 lib/lwip/apps/dns/lwip-dns.c          |  46 ++++
 lib/lwip/apps/dns/lwip-dns.h          |   3 +
 lib/lwip/apps/http/lwip-wget.c        | 121 ++++++++++
 lib/lwip/apps/ping/lwip_ping.c        |  37 ++++
 lib/lwip/apps/ping/lwip_ping.h        |  24 ++
 lib/lwip/apps/ping/ping.h             |  35 +++
 lib/lwip/apps/tftp/lwip-tftp.c        | 124 +++++++++++
 lib/lwip/cmd-lwip.c                   | 308 ++++++++++++++++++++++++++
 lib/lwip/lwip-external                |   1 +
 lib/lwip/lwipopts.h                   | 203 +++++++++++++++++
 lib/lwip/port/if.c                    | 260 ++++++++++++++++++++++
 lib/lwip/port/include/arch/cc.h       |  46 ++++
 lib/lwip/port/include/arch/sys_arch.h |  59 +++++
 lib/lwip/port/include/limits.h        |   0
 lib/lwip/port/sys-arch.c              |  20 ++
 lib/lwip/ulwip.h                      |   9 +
 net/Kconfig                           |   1 +
 net/net.c                             |  24 ++
 31 files changed, 1634 insertions(+), 82 deletions(-)
 create mode 100644 .gitmodules
 create mode 100644 doc/develop/net_lwip.rst
 create mode 100644 lib/lwip/Kconfig
 create mode 100644 lib/lwip/Makefile
 create mode 100644 lib/lwip/apps/dhcp/lwip-dhcp.c
 create mode 100644 lib/lwip/apps/dns/lwip-dns.c
 create mode 100644 lib/lwip/apps/dns/lwip-dns.h
 create mode 100644 lib/lwip/apps/http/lwip-wget.c
 create mode 100644 lib/lwip/apps/ping/lwip_ping.c
 create mode 100644 lib/lwip/apps/ping/lwip_ping.h
 create mode 100644 lib/lwip/apps/ping/ping.h
 create mode 100644 lib/lwip/apps/tftp/lwip-tftp.c
 create mode 100644 lib/lwip/cmd-lwip.c
 create mode 160000 lib/lwip/lwip-external
 create mode 100644 lib/lwip/lwipopts.h
 create mode 100644 lib/lwip/port/if.c
 create mode 100644 lib/lwip/port/include/arch/cc.h
 create mode 100644 lib/lwip/port/include/arch/sys_arch.h
 create mode 100644 lib/lwip/port/include/limits.h
 create mode 100644 lib/lwip/port/sys-arch.c
 create mode 100644 lib/lwip/ulwip.h

Comments

Ilias Apalodimas July 27, 2023, 12:22 p.m. UTC | #1
Hi Maxim, 

On Fri, Jul 14, 2023 at 08:19:55PM +0600, Maxim Uvarov wrote:
> changelog:
> 	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.
> 
> build:
> 	git submodule init
> 	git submodule update
> 	make 
> 
> I tested with qemu and ubuntu host for the server manually and with
> ./test/py/test -bd qemu_arm64 --build -k net.
> 
> Maxim Uvarov (5):
>   net/lwip: add lwip-external submodule
>   net/lwip: add lwip library for the network stack
>   net/lwip: add doc/develop/net_lwip.rst
>   net/lwip: add dns command

This dones't apply to master.  Can you rebase and resend it?

Thanks
/Ilias
>   net/lwip: apps/http: add dns support
> 
>  .gitignore                            |   9 +
>  .gitmodules                           |   3 +
>  boot/bootmeth_pxe.c                   |   2 +-
>  cmd/net.c                             |  89 +-------
>  cmd/pxe.c                             |   2 +-
>  doc/develop/index.rst                 |   1 +
>  doc/develop/net_lwip.rst              |  59 +++++
>  include/net.h                         |   8 +-
>  lib/Kconfig                           |   2 +
>  lib/Makefile                          |   2 +
>  lib/lwip/Kconfig                      |  63 ++++++
>  lib/lwip/Makefile                     | 103 +++++++++
>  lib/lwip/apps/dhcp/lwip-dhcp.c        |  52 +++++
>  lib/lwip/apps/dns/lwip-dns.c          |  46 ++++
>  lib/lwip/apps/dns/lwip-dns.h          |   3 +
>  lib/lwip/apps/http/lwip-wget.c        | 121 ++++++++++
>  lib/lwip/apps/ping/lwip_ping.c        |  37 ++++
>  lib/lwip/apps/ping/lwip_ping.h        |  24 ++
>  lib/lwip/apps/ping/ping.h             |  35 +++
>  lib/lwip/apps/tftp/lwip-tftp.c        | 124 +++++++++++
>  lib/lwip/cmd-lwip.c                   | 308 ++++++++++++++++++++++++++
>  lib/lwip/lwip-external                |   1 +
>  lib/lwip/lwipopts.h                   | 203 +++++++++++++++++
>  lib/lwip/port/if.c                    | 260 ++++++++++++++++++++++
>  lib/lwip/port/include/arch/cc.h       |  46 ++++
>  lib/lwip/port/include/arch/sys_arch.h |  59 +++++
>  lib/lwip/port/include/limits.h        |   0
>  lib/lwip/port/sys-arch.c              |  20 ++
>  lib/lwip/ulwip.h                      |   9 +
>  net/Kconfig                           |   1 +
>  net/net.c                             |  24 ++
>  31 files changed, 1634 insertions(+), 82 deletions(-)
>  create mode 100644 .gitmodules
>  create mode 100644 doc/develop/net_lwip.rst
>  create mode 100644 lib/lwip/Kconfig
>  create mode 100644 lib/lwip/Makefile
>  create mode 100644 lib/lwip/apps/dhcp/lwip-dhcp.c
>  create mode 100644 lib/lwip/apps/dns/lwip-dns.c
>  create mode 100644 lib/lwip/apps/dns/lwip-dns.h
>  create mode 100644 lib/lwip/apps/http/lwip-wget.c
>  create mode 100644 lib/lwip/apps/ping/lwip_ping.c
>  create mode 100644 lib/lwip/apps/ping/lwip_ping.h
>  create mode 100644 lib/lwip/apps/ping/ping.h
>  create mode 100644 lib/lwip/apps/tftp/lwip-tftp.c
>  create mode 100644 lib/lwip/cmd-lwip.c
>  create mode 160000 lib/lwip/lwip-external
>  create mode 100644 lib/lwip/lwipopts.h
>  create mode 100644 lib/lwip/port/if.c
>  create mode 100644 lib/lwip/port/include/arch/cc.h
>  create mode 100644 lib/lwip/port/include/arch/sys_arch.h
>  create mode 100644 lib/lwip/port/include/limits.h
>  create mode 100644 lib/lwip/port/sys-arch.c
>  create mode 100644 lib/lwip/ulwip.h
> 
> -- 
> 2.30.2
>
Simon Glass July 28, 2023, 1:51 a.m. UTC | #2
Hi Maxim,

On Fri, 14 Jul 2023 at 08:22, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:
>
> changelog:
>         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.
>
> build:
>         git submodule init
>         git submodule update
>         make
>
> I tested with qemu and ubuntu host for the server manually and with
> ./test/py/test -bd qemu_arm64 --build -k net.

If we are moving to a new stack we should take this oppty to create
unit tests that deal with error paths as well, as it done in
test/dm/eth.c

What unit tests does lwip have?

Regards,
Simon
Maxim Uvarov July 28, 2023, 11:24 a.m. UTC | #3
On Fri, 28 Jul 2023 at 07:52, Simon Glass <sjg@google.com> wrote:

> Hi Maxim,
>
> On Fri, 14 Jul 2023 at 08:22, Maxim Uvarov <maxim.uvarov@linaro.org>
> wrote:
> >
> > changelog:
> >         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.
> >
> > build:
> >         git submodule init
> >         git submodule update
> >         make
> >
> > I tested with qemu and ubuntu host for the server manually and with
> > ./test/py/test -bd qemu_arm64 --build -k net.
>
> If we are moving to a new stack we should take this oppty to create
> unit tests that deal with error paths as well, as it done in
> test/dm/eth.c
>
>
lwip itself has unit tests:
https://git.savannah.nongnu.org/cgit/lwip.git/tree/test

I first time look on what is test/dm/eth.c but to compare it to for example
https://git.savannah.nongnu.org/cgit/lwip.git/tree/test/unit/dhcp/test_dhcp.c
it's about the same.

BR,
Maxim.



> What unit tests does lwip have?
>
> Regards,
> Simon
>