public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Ilias Apalodimas <ilias.apalodimas@linaro.org>
To: Maxim Uvarov <maxim.uvarov@linaro.org>
Cc: u-boot@lists.denx.de, pbrobinson@gmail.com,
	joe.hershberger@ni.com, rfried.dev@gmail.com, trini@konsulko.com,
	goldsimon@gmx.de, Simon Glass <sjg@chromium.org>
Subject: Re: [PATCHv8 01/15] net/lwip: add doc/develop/net_lwip.rst
Date: Tue, 12 Sep 2023 10:40:59 +0300	[thread overview]
Message-ID: <ZQAWCzDN2dGLq2FK@hades> (raw)
In-Reply-To: <20230908135320.7066-2-maxim.uvarov@linaro.org>

On Fri, Sep 08, 2023 at 07:53:06PM +0600, Maxim Uvarov wrote:
> Add initial documentation of lwIP network IP stack integration
> to the U-Boot (net_lwip.rst).
> 
> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
> Reviewed-by: Simon Glass <sjg@chromium.org>
> ---
>  doc/develop/index.rst    |  1 +
>  doc/develop/net_lwip.rst | 75 ++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 76 insertions(+)
>  create mode 100644 doc/develop/net_lwip.rst
> 
> diff --git a/doc/develop/index.rst b/doc/develop/index.rst
> index 5b230d0321..4764990f25 100644
> --- a/doc/develop/index.rst
> +++ b/doc/develop/index.rst
> @@ -48,6 +48,7 @@ Implementation
>     spl
>     falcon
>     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..a77ab60d0f
> --- /dev/null
> +++ b/doc/develop/net_lwip.rst
> @@ -0,0 +1,75 @@
> +.. SPDX-License-Identifier: GPL-2.0+
> +
> +lwIP IP stack integration for U-Boot
> +====================================
> +
> +Intro
> +-----
> +
> +lwIP is a library implementing network protocols, which is commonly used
> +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 second variant was selected: lwIP is very customizable
> +   with defines for features, memory size, types of allocation, some internal
> +   types and platform specific code. It turned out easier to enable/disable
> +   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.
> +
> +In raw IP mode a callback function for RX path is registered and will be called
> +when packet is passed to the IP stack and is ready for the application.
> +
> +One example is the unmodified working ping example from lwip sources which
> +registered 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)
> +
> +3.  Input and output
> +
> +RX packet path is injected to U-Boot eth_rx() polling loop and TX patch is in
> +eth_send() accordingly. That way we can leave the driver code unmodified and
> +consume packets once they are ready. So we do not touch any drivers code and
> +just eat packets when they are ready.
> +
> +U-Boot lwIP Applications
> +========================
> +
> +.. kernel-doc:: include/net/lwip.h
> +   :internal:
> +
> +lwIP API to control polling loop
> +================================
> +
> +.. kernel-doc:: include/net/ulwip.h
> +   :internal:
> -- 
> 2.30.2
> 
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


  reply	other threads:[~2023-09-12  7:41 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-08 13:53 [PATCHv8 00/15] net/lwip: add lwip library for the network stack Maxim Uvarov
2023-09-08 13:53 ` [PATCHv8 01/15] net/lwip: add doc/develop/net_lwip.rst Maxim Uvarov
2023-09-12  7:40   ` Ilias Apalodimas [this message]
2023-09-08 13:53 ` [PATCHv8 02/15] net/lwip: integrate lwIP library Maxim Uvarov
2023-09-08 13:53 ` [PATCHv8 03/15] net/lwip: implement dns cmd Maxim Uvarov
2023-09-13  5:56   ` Ilias Apalodimas
2023-09-13  8:32     ` Simon Goldschmidt
2023-09-13 13:46       ` Maxim Uvarov
2023-09-08 13:53 ` [PATCHv8 04/15] net/lwip: implement dhcp cmd Maxim Uvarov
2023-09-13  6:07   ` Ilias Apalodimas
2023-09-13  8:35     ` Simon Goldschmidt
2023-09-08 13:53 ` [PATCHv8 05/15] net/lwip: implement tftp cmd Maxim Uvarov
2023-09-13  6:15   ` Ilias Apalodimas
2023-09-13  8:38     ` Simon Goldschmidt
2023-09-13 13:38       ` Maxim Uvarov
2023-09-08 13:53 ` [PATCHv8 06/15] net/lwip: implement wget cmd Maxim Uvarov
2023-09-13  6:25   ` Ilias Apalodimas
2023-09-08 13:53 ` [PATCHv8 07/15] net/lwip: implement ping cmd Maxim Uvarov
2023-09-13  6:28   ` Ilias Apalodimas
2023-09-08 13:53 ` [PATCHv8 08/15] net/lwip: add lwIP configuration Maxim Uvarov
2023-09-08 13:53 ` [PATCHv8 09/15] net/lwip: implement lwIP port to U-Boot Maxim Uvarov
2023-09-08 13:53 ` [PATCHv8 10/15] net/lwip: update .gitignore with lwIP Maxim Uvarov
2023-09-08 13:53 ` [PATCHv8 11/15] net/lwip: connection between cmd and lwip apps Maxim Uvarov
2023-09-08 13:53 ` [PATCHv8 12/15] net/lwip: replace original net commands with lwip Maxim Uvarov
2023-09-08 13:53 ` [PATCHv8 13/15] net/lwip: split net.h to net.h, arp.h and eth.h Maxim Uvarov
2023-09-08 13:53 ` [PATCHv8 14/15] net/lwip: drop old net/wget Maxim Uvarov
2023-09-08 13:53 ` [PATCHv8 15/15] net/lwip/wget add port selection Maxim Uvarov
2023-09-13  6:30   ` Ilias Apalodimas
2023-09-08 13:59 ` [PATCHv8 00/15] net/lwip: add lwip library for the network stack Tom Rini
2023-09-12 11:41   ` Maxim Uvarov
2023-09-12 19:26     ` Simon Glass
2023-09-13  7:31       ` Maxim Uvarov
2023-09-13  7:53         ` Ilias Apalodimas
2023-09-13  8:43           ` Simon Goldschmidt
2023-09-13 10:06             ` Peter Robinson
2023-09-13 13:14               ` Tom Rini
2023-09-13 13:34                 ` Maxim Uvarov
2023-09-21 16:29                   ` Simon Glass
2023-09-22 10:56                     ` Simon Goldschmidt
2023-09-22 16:13                       ` 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=ZQAWCzDN2dGLq2FK@hades \
    --to=ilias.apalodimas@linaro.org \
    --cc=goldsimon@gmx.de \
    --cc=joe.hershberger@ni.com \
    --cc=maxim.uvarov@linaro.org \
    --cc=pbrobinson@gmail.com \
    --cc=rfried.dev@gmail.com \
    --cc=sjg@chromium.org \
    --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