All of lore.kernel.org
 help / color / mirror / Atom feed
From: Suneel Garapati <suneelglinux@gmail.com>
To: u-boot@lists.denx.de
Subject: [PATCH v5] net: tftp: Add client support for RFC 7440
Date: Sat, 30 Jan 2021 12:39:27 -0800	[thread overview]
Message-ID: <CAHPF-4LU7dSCoSRoy7hJZ-pLJRC_qAbuQdV33jLvPKVt8zEpBQ@mail.gmail.com> (raw)
In-Reply-To: <20200805202724.GY6965@bill-the-cat>

Hello Ramon,

With TFTP window size as default 1 and enabling TFTPPUT config option
results in tftpboot command failure.

Attached the pcap files for with and without TFTPPUT enabled.
Both captures are the same except that the TFTPPUT option enables ICMP handler
and for the response from the server triggers a restart of netloop
operation and eventually fails as below.

> tftpboot 0x30000000 192.168.1.1:Image
Waiting for RPM0 LMAC0 link status... 10G_R [10G]
Using rvu_pf#0 device
TFTP from server 192.168.1.1; our IP address is 192.168.1.16
Filename 'Image'. Load address: 0x30000000
Loading: ################################################## 15.8 MiB
787.1 KiB/s
done
TFTP server died; starting again
>

I see the code issue as below on net/tftp.c [v2020.10] ?
                /*
                 *      Acknowledge the block just received, which will prompt
                 *      the remote for the next one.
                 */
                if (tftp_cur_block == tftp_next_ack) {
                        tftp_send();
                        tftp_next_ack += tftp_windowsize;
                }

                if (len < tftp_block_size) {
                        //if (tftp_windowsize > 1) [Hack in use for
now to work around this issue]
                        tftp_send();                      [ This
causes extra ACK packet send with same block number and causes server
to respond with ICMP error]
                        tftp_complete();
                }

I couldn?t try with tftp_windowsize > 1 as the test servers don?t support.
I tried with all latest commits on net/tftp.c on top of v2020.10 and
still see the issue.

This change is introduced in
commit cc6b87ecaa96325577a8fafabc0d5972b816bc6c
Author: Ramon Fried <rfried.dev@gmail.com>
Date:   Sat Jul 18 23:31:46 2020 +0300

    net: tftp: Add client support for RFC 7440

    Add support for RFC 7440: "TFTP Windowsize Option".

Reverting this commit on v2020.10 also fixes the issue.

I would like to know if this extra tftp_send is needed at all or only
for window size > 1

Regards,
Suneel

On Wed, Aug 5, 2020 at 1:28 PM Tom Rini <trini@konsulko.com> wrote:
>
> On Sat, Jul 18, 2020 at 11:31:46PM +0300, Ramon Fried wrote:
>
> > Add support for RFC 7440: "TFTP Windowsize Option".
> >
> > This optional feature allows the client and server
> > to negotiate a window size of consecutive blocks to send as an
> > alternative for replacing the single-block lockstep schema.
> >
> > windowsize can be defined statically during compilation by
> > setting CONFIG_TFTP_WINDOWSIZE, or defined in runtime by
> > setting an environment variable: "tftpwindowsize"
> > If not defined, the windowsize is set to 1, meaning that it
> > behaves as it was never defined.
> >
> > Choosing the appropriate windowsize depends on the specific
> > network topology, underlying NIC.
> > You should test various windowsize scenarios and see which
> > best work for you.
> >
> > Setting a windowsize too big can actually decreases performance.
> >
> > Signed-off-by: Ramon Fried <rfried.dev@gmail.com>
> > Reviewed-by: Marek Vasut <marex@denx.de>
>
> Applied to u-boot/master, thanks!
>
> --
> Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tftp-1.pcapng
Type: application/x-pcapng
Size: 17324 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210130/7e4d3fc3/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tftp-tftpput-1.pcapng
Type: application/x-pcapng
Size: 17248 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210130/7e4d3fc3/attachment-0001.bin>

  reply	other threads:[~2021-01-30 20:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-18 20:31 [PATCH v5] net: tftp: Add client support for RFC 7440 Ramon Fried
2020-08-05 20:27 ` Tom Rini
2021-01-30 20:39   ` Suneel Garapati [this message]
2021-01-30 21:26     ` Ramon Fried
2021-02-01 22:27       ` Ramon Fried
2021-02-02 16:02         ` Suneel Garapati
2021-02-02 19:46           ` Ramon Fried
2021-02-02 22:23             ` Suneel Garapati
2021-02-03  8:01               ` Ramon Fried
2021-02-17  9:14 ` Oliver Graute
2021-02-17 10:00   ` Oliver Graute

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=CAHPF-4LU7dSCoSRoy7hJZ-pLJRC_qAbuQdV33jLvPKVt8zEpBQ@mail.gmail.com \
    --to=suneelglinux@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.