[RESEND PATCH v3 0/9] net: tcp: improve tcp support

Mikhail Kshevetskiy mikhail.kshevetskiy at iopsys.eu
Wed Aug 14 12:31:36 CEST 2024


U-Boot support of LWIP is not ready for a moment, but we already have
some kind of tcp support. Unfrotunately this support is really bad.

Some of the known issues:
 * tcp packet from other connection can break a current one
 * tcp send sequence always starts from zero
 * bad tcp options processing
 * strange assumptions on packet size for selectiv acknowledge
 * tcp interface assumes one of the two scenarios:
     - data downloading from remote host to a board
     - request-response exchange with a small packets
   so it's not possible to upload large amount of data from the
   board to remote host.

This series of patches fixes all of the above issuess.

The benefits:
 * A lot of bug was fixed
 * Better and more reliable TCP state machine
 * Tcp cliens becomes smaller/simpler
 * Data uploading was fixed (now it's possible to transmit a huge amount of
   data from the board to remote host)
 * Netcat over tcp was implemented. Netcat supports data downloading/uploading
   from/to remote host in client/server mode.

On the base of this changes a HTTPD/1.1 server for firmware upgrade was
implemented (not included in this patch series).

Modification was verified with
 * firmware downloading via u-boot wget command
 * fastboot over tcp
 * netcat linux client
 * Firefox/Chrome/Edge during web-based firmware upgrade

Changes v2:
 * cover letter was added
 * some patches were removed

Changes v3:
 * better cover letter

Mikhail Kshevetskiy (9):
  net/tcp: fix TCP options processing
  net/tcp: fix selective acknowledge
  net/tcp: put connection specific data into a tcp_stream structure
  net/tcp: add connection info to tcp_stream structure
  net/tcp: rename ack_edge and seq_init to more common rcv_nxt and irs
  net/tcp: improve tcp framework, use better state machine
  net/tcp: simplify tcp header filling code
  net/tcp: define a fallback value for rcv_wnd size
  net/netcat: add netcat over tcp support

 cmd/Kconfig          |    7 +
 cmd/net.c            |   34 +-
 include/net.h        |    7 +-
 include/net/netcat.h |   20 +
 include/net/tcp.h    |  227 +++++++-
 include/net/wget.h   |    8 -
 net/Makefile         |    1 +
 net/fastboot_tcp.c   |  190 +++----
 net/net.c            |   30 +-
 net/netcat.c         |  159 ++++++
 net/tcp.c            | 1253 +++++++++++++++++++++++++++++-------------
 net/wget.c           |  479 +++++-----------
 12 files changed, 1538 insertions(+), 877 deletions(-)
 create mode 100644 include/net/netcat.h
 create mode 100644 net/netcat.c

-- 
2.39.2



More information about the U-Boot mailing list