From: Ilias Apalodimas <ilias.apalodimas@linaro.org>
To: Maxim Uvarov <maxim.uvarov@linaro.org>
Cc: u-boot@lists.denx.de, pbrobinson@redhat.com,
joe.hershberger@ni.com, rfried.dev@gmail.com, trini@konsulko.com,
goldsimon@gmx.de, lwip-devel@nongnu.org
Subject: Re: [PATCHv4 3/5] net/lwip: add doc/develop/net_lwip.rst
Date: Thu, 27 Jul 2023 15:33:51 +0300 [thread overview]
Message-ID: <ZMJkLzRGyI5xVVKL@hades> (raw)
In-Reply-To: <20230714142000.5534-4-maxim.uvarov@linaro.org>
Hi Maxim,
On Fri, Jul 14, 2023 at 08:19:58PM +0600, Maxim Uvarov wrote:
> Just add inital doc.
>
> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
> ---
> doc/develop/index.rst | 1 +
> doc/develop/net_lwip.rst | 59 ++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 60 insertions(+)
> create mode 100644 doc/develop/net_lwip.rst
>
> diff --git a/doc/develop/index.rst b/doc/develop/index.rst
> index 97c526e997..a092c33df0 100644
> --- a/doc/develop/index.rst
> +++ b/doc/develop/index.rst
> @@ -43,6 +43,7 @@ Implementation
> smbios
> spl
> uefi/index
> + net_lwip
> vbe
> version
>
> diff --git a/doc/develop/net_lwip.rst b/doc/develop/net_lwip.rst
> new file mode 100644
> index 0000000000..567234fff2
> --- /dev/null
> +++ b/doc/develop/net_lwip.rst
> @@ -0,0 +1,59 @@
> +.. SPDX-License-Identifier: GPL-2.0+
> +
> +LWIP IP stack intergation for U-Boot
> +====================================
> +
> +Intro
> +-----
> +
> +LWIP is a library for implementation network protocols, which is commonly used
s/for implementation/implementing/
> +on embedded devices.
> +
> +https://savannah.nongnu.org/projects/lwip/
> +
> +LwIP license:
> +LwIP is licensed under a BSD-style license: http://lwip.wikia.com/wiki/License.
> +
> +Main features include:
> +
> +* Protocols: IP, IPv6, ICMP, ND, MLD, UDP, TCP, IGMP, ARP, PPPoS, PPPoE
> +
> +* DHCP client, DNS client (incl. mDNS hostname resolver), AutoIP/APIPA (Zeroconf), SNMP agent (v1, v2c, v3, private MIB support & MIB compiler)
> +
> +* APIs: specialized APIs for enhanced performance, optional Berkeley-alike socket API
> +
> +* Extended features: IP forwarding over multiple network interfaces, TCP congestion control, RTT estimation and fast recovery/fast retransmit
> +
> +* Addon applications: HTTP(S) server, SNTP client, SMTP(S) client, ping, NetBIOS nameserver, mDNS responder, MQTT client, TFTP server
> +
> +U-Boot implementation details
> +-----------------------------
> +
> +1. In general we can build lwIP as .a library and link it against u-boot or compile it in
> +the U-Boot tree in the same way as other U-Boot files. There are few reasons why I selected
> +the second variant: LwIP is very customizable with defines for features, memory size, types of
> +allocation, some internal types and platform specific code. And it was more easy to enable/disable
s/And it was more easy/it turned out easier to/
> +debug which is also done with defines, and is needed periodically.
> +
> +2. lwIP has 2 APIs - raw mode and sequential (as lwIP names it, or socket API as we name it in Linux).
> +For now only raw API is supported.
> +
> +Raw IP means that the call back function for RX path is registered and will be called when packet
s/Raw IP IP means/In raw IP mode a callback function etc
> +data passes the IP stack and is ready for the application.
is passed to the ip stack?
> +
> +Example is unmodified working ping example from lwip sources which registeres the callback:
> +
> +.. code-block:: c
> +
> + ping_pcb = raw_new(IP_PROTO_ICMP);
> + raw_recv(ping_pcb, ping_recv, NULL); <- ping_recv is app callback.
> + raw_bind(ping_pcb, IP_ADDR_ANY)
> +
> +Socket API also gives nice advantages due it will be easy to port linux socket applications to u-boot.
> +I.e. LwIP sockets compatible with the linux ones. But that will require RX thread running in the background.
> +So that means we need some kind of scheduler, locking and threading support or find some other solution.
I think you can drop this entirely and we can add it if we ever want to
support sockets
> +
> +3. Input and output
> +
> +RX packet path is injected to U-Boot eth_rx() polling loop and TX patch is in eth_send() accordingly.
> +So we do not touch any drivers code and just eat packets when they are ready.
> --
> 2.30.2
>
Thanks
/Ilias
next prev parent reply other threads:[~2023-07-27 12:34 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-14 14:19 [PATCHv4 0/5] net/lwip: add lwip library for the network stack Maxim Uvarov
2023-07-14 14:19 ` [PATCHv4 1/5] net/lwip: add lwip-external submodule Maxim Uvarov
2023-07-27 12:34 ` Ilias Apalodimas
2023-07-28 18:08 ` Tom Rini
2023-07-28 22:17 ` Simon Glass
2023-07-30 22:06 ` Peter Robinson
2023-08-02 8:03 ` Maxim Uvarov
2023-08-02 16:32 ` Tom Rini
2023-07-14 14:19 ` [PATCHv4 2/5] net/lwip: add lwip library for the network stack Maxim Uvarov
2023-07-27 13:29 ` Ilias Apalodimas
2023-07-27 14:23 ` Maxim Uvarov
2023-07-28 14:26 ` Maxim Uvarov
2023-07-14 14:19 ` [PATCHv4 3/5] net/lwip: add doc/develop/net_lwip.rst Maxim Uvarov
2023-07-27 12:33 ` Ilias Apalodimas [this message]
2023-07-14 14:19 ` [PATCHv4 4/5] net/lwip: add dns command Maxim Uvarov
2023-07-14 14:20 ` [PATCHv4 5/5] net/lwip: apps/http: add dns support Maxim Uvarov
2023-07-27 12:59 ` Ilias Apalodimas
2023-07-27 12:22 ` [PATCHv4 0/5] net/lwip: add lwip library for the network stack Ilias Apalodimas
2023-07-28 1:51 ` Simon Glass
2023-07-28 11:24 ` Maxim Uvarov
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=ZMJkLzRGyI5xVVKL@hades \
--to=ilias.apalodimas@linaro.org \
--cc=goldsimon@gmx.de \
--cc=joe.hershberger@ni.com \
--cc=lwip-devel@nongnu.org \
--cc=maxim.uvarov@linaro.org \
--cc=pbrobinson@redhat.com \
--cc=rfried.dev@gmail.com \
--cc=trini@konsulko.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox