All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jerome Forissier <jerome.forissier@linaro.org>
To: u-boot@lists.denx.de
Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	Javier Tia <javier.tia@linaro.org>,
	Maxim Uvarov <muvarov@gmail.com>,
	Jerome Forissier <jerome.forissier@linaro.org>
Subject: [PATCH v2 00/14] Introduce the lwIP network stack
Date: Fri, 24 May 2024 18:19:54 +0200	[thread overview]
Message-ID: <cover.1716566960.git.jerome.forissier@linaro.org> (raw)

This is a rework of a patch series by Maxim Uvarov: "net/lwip: add lwip
library for the network stack" [1]. The goal is to introduce the lwIP TCP/IP
stack [2] [3] as an alternative to the current implementation in net/,
selectable with Kconfig, and ultimately keep only lwIP if possible. Some
reasons for doing so are:
- Make the support of HTTPS in the wget command easier. Javier T. (CC'd)
has some additional lwIP and Mbed TLS patches to do so. With that it
becomes possible to fetch and launch a distro installer such as Debian
etc. directly from the U-Boot shell.
- Possibly benefit from additional features implemented in lwIP
- Less code to maintain in U-Boot

The first patch introduces a new Kconfig symbol: NET_LWIP, which selects
the lwIP implementation instead of the current one (NET). Contrary to the
approach chosen by Maxim in [1], NET_LWIP and NET cannot be enabled
simultaneously. The rationale is we want to start from a clean state and
not pull potentially duplicated functionality from both stacks. Note
however that a few files are still built in net/, they are the ones
related to ethernet device management and the ethernet bootflow.

The second patch imports the lwIP code as a Git subtree under
lib/lwip/lwip. Some glue code is added under lib/lwip/u-boot.

The third patch introduces the Makefile to build lwIP when
CONFIG_NET_LWIP=y.

The subsequent patches implement various network-oriented commands and
features: dhcp, dns, ping, tftpboot, wget.

NET_LWIP is not enabled by default because it lacks functionality compared
to NET and many CI tests would fail to run or even build.

Some tests (dm dsa/eth) are disabled when NET_LWIP is selected because
they make strong assumptions on how the network stack is implemented and
how the packet flow occurs. For example, an ARP exchange is expected
when an ICMP packet goes out, but with lwIP no exchange will occur if the
host IP is already in the the ARP cache.

Due to the above and in order to provide some level of testing, a new QEMU
configuration is introduced (qemu_arm64_lwip_defconfig) which is the same
as qemu_arm64_lwip_defconfig but with NET_LWIP and CMD_*_LWIP enabled.
Tests are added to test/py/tests/test_net.py for that configuration.

Changes in v2:

** Address comments from Ilias A.

- "net-lwip: add wget command"
Implement the wget_with_dns() function to do most of the wget work and
call it from do_wget(). This allows to simplify patch "net-lwip: add
support for EFI_HTTP_BOOT".

- "net-lwip: import net command from cmd/net.c"
Move a few functions from cmd/net.c to a new file cmd/net-common.c
rather than duplicating then in cmd/net-lwip.c.

- "net-lwip: add support for EFI_HTTP_BOOT"
Since wget_with_dns() is now implemented in "net-lwip: add wget command",
just enable the wget command when the lwIP stack is enabled and
EFI_HTTP_BOOT is requested.

** Address comments from Tom R.

- "net-lwip: add DHCP support and dhcp commmand",
  "net-lwip: add TFTP support and tftpboot command",
  "net-lwip: add ping command",
  "net-lwip: add dns command",
  "net-lwip: add wget command"
Do not introduce new CMD_XXX_LWIP symbols and use existing CMD_XXX
instead.

- "configs: add qemu_arm64_lwip_defconfig"
Use #include <configs/qemu_arm64_defconfig>.

- "net-lwip: import lwIP library under lib/lwip"
Patch removed and replaced by the introduction of a Git subtree:
"Squashed 'lib/lwip/lwip/' content from commit 0a0452b2c3".

Note that I have not yet addressed your comments on "test: dm: dsa,
eth: disable tests when CONFIG_NET_LWIP=y"). I need some more time
for that and I think running CI on this v2 will help better understand
what is needed for v3.

** Miscellaneous improvements

- "net: introduce alternative implementation as net-lwip/":

* Make DFU_OVER_TFTP not DFU_TFTP incompatible with NET_LWIP. It seems
quite natural to supplement "depends on NET" with "&& !NET_LWIP".
* Make PROT_*_LWIP not visible by removing the Kconfig prompt.


[1] https://lore.kernel.org/all/20231127125726.3735-1-maxim.uvarov@linaro.org/
[2] https://www.nongnu.org/lwip/
[3] https://en.wikipedia.org/wiki/LwIP

CC: Javier Tia <javier.tia@linaro.org>

Jerome Forissier (14):
  net: introduce alternative implementation as net-lwip/
  Squashed 'lib/lwip/lwip/' content from commit 0a0452b2c39
  net-lwip: build lwIP
  net-lwip: add DHCP support and dhcp commmand
  net-lwip: add TFTP support and tftpboot command
  net-lwip: add ping command
  net-lwip: add dns command
  net-lwip: add wget command
  test: dm: dsa, eth: disable tests when CONFIG_NET_LWIP=y
  cmd: bdinfo: enable -e when CONFIG_CMD_NET_LWIP=y
  configs: add qemu_arm64_lwip_defconfig
  test/py: net: add _lwip variants of dhcp, ping and tftpboot tests
  MAINTAINERS: net-lwip: add myself as a maintainer
  CI: add qemu_arm64_lwip to the test matrix

-- 
2.40.1

             reply	other threads:[~2024-05-24 16:21 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-24 16:19 Jerome Forissier [this message]
2024-05-24 16:19 ` [PATCH v2 01/14] net: introduce alternative implementation as net-lwip/ Jerome Forissier
2024-05-27 15:34   ` Tom Rini
2024-05-28 11:53     ` Ilias Apalodimas
2024-06-05 17:48     ` Jerome Forissier
2024-05-24 16:19 ` [PATCH v2 02/14] Squashed 'lib/lwip/lwip/' content from commit 0a0452b2c39 Jerome Forissier
2024-05-24 16:19 ` [PATCH v2 03/14] net-lwip: build lwIP Jerome Forissier
2024-05-24 16:19 ` [PATCH v2 04/14] net-lwip: add DHCP support and dhcp commmand Jerome Forissier
2024-05-24 16:19 ` [PATCH v2 05/14] net-lwip: add TFTP support and tftpboot command Jerome Forissier
2024-05-24 16:20 ` [PATCH v2 06/14] net-lwip: add ping command Jerome Forissier
2024-06-06  9:10   ` Ilias Apalodimas
2024-06-06 12:04     ` Jerome Forissier
2024-05-24 16:20 ` [PATCH v2 07/14] net-lwip: add dns command Jerome Forissier
2024-06-06  6:29   ` Ilias Apalodimas
2024-06-06  8:51     ` Maxim Uvarov
2024-06-06 12:19     ` Jerome Forissier
2024-05-24 16:20 ` [PATCH v2 08/14] net-lwip: add wget command Jerome Forissier
2024-05-28 13:39   ` Maxim Uvarov
2024-06-06  9:56     ` Jerome Forissier
2024-06-06 10:16       ` Maxim Uvarov
2024-06-06 12:14         ` Jerome Forissier
2024-06-06  9:38   ` Ilias Apalodimas
2024-05-24 16:20 ` [PATCH v2 09/14] test: dm: dsa, eth: disable tests when CONFIG_NET_LWIP=y Jerome Forissier
2024-05-24 16:20 ` [PATCH v2 10/14] cmd: bdinfo: enable -e when CONFIG_CMD_NET_LWIP=y Jerome Forissier
2024-05-24 16:20 ` [PATCH v2 11/14] configs: add qemu_arm64_lwip_defconfig Jerome Forissier
2024-05-24 16:20 ` [PATCH v2 12/14] test/py: net: add _lwip variants of dhcp, ping and tftpboot tests Jerome Forissier
2024-05-28  9:41   ` Love Kumar
2024-05-28  9:53   ` Maxim Uvarov
2024-05-30 14:11     ` Jerome Forissier
2024-05-30 14:22       ` Maxim Uvarov
2024-06-06  9:18         ` Jerome Forissier
2024-05-24 16:20 ` [PATCH v2 13/14] MAINTAINERS: net-lwip: add myself as a maintainer Jerome Forissier
2024-05-24 16:20 ` [PATCH v2 14/14] CI: add qemu_arm64_lwip to the test matrix Jerome Forissier
2024-05-27  9:23 ` [PATCH v2 00/14] Introduce the lwIP network stack Francesco Dolcini
2024-05-27  9:36   ` Jerome Forissier
2024-05-27  9:45     ` Martin Husemann
2024-05-27 12:45       ` Jerome Forissier
2024-05-27 12:47         ` Martin Husemann
2024-05-28 11:50           ` Ilias Apalodimas
2024-06-04 23:13   ` Peter Robinson
2024-05-27 15:34 ` Tom Rini
2024-06-06  9:15   ` Jerome Forissier
2024-06-06 14:25     ` Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1716566960.git.jerome.forissier@linaro.org \
    --to=jerome.forissier@linaro.org \
    --cc=ilias.apalodimas@linaro.org \
    --cc=javier.tia@linaro.org \
    --cc=muvarov@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.