public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Ramon Fried <rfried.dev@gmail.com>
Cc: U-Boot Mailing List <u-boot@lists.denx.de>,
	Marcel Ziswiler <marcel.ziswiler@toradex.com>
Subject: Re: TFTP hangs with fragmented IP packets
Date: Wed, 6 Apr 2022 02:11:15 +0300	[thread overview]
Message-ID: <YkzMk6SKrjDeiDMM@pendragon.ideasonboard.com> (raw)
In-Reply-To: <CAGi-RUKe8SDG9z7DHH4W6F1M7WScppTME2NDTHmtSODoY5ds3Q@mail.gmail.com>

Hi Ramon,

On Sun, Apr 03, 2022 at 02:17:26AM +0300, Ramon Fried wrote:
> On Thu, Mar 31, 2022 at 8:43 AM Ramon Fried wrote:
> > On Tue, Mar 29, 2022 at 11:28 PM Laurent Pinchart wrote:
> > >
> > > Hello,
> > >
> > > I've banged my head a few days ago trying to debug an issue with a TFTP
> > > transfer hanging in the middle.
> > >
> > > I'm testing U-Boot 2022-rc5 on a Toradex Verdin i.MX8MP module (using
> > > the verdin-imx8mp defconfig). My local network MTU is 1500 bytes, and
> > > the board uses the EQoS ethernet controller.
> > >
> > > The problem started occurring after rebuilding a kernel image. U-Boot
> > > started transferring the image, and stopped in the middle, eventually
> > > timing out. Capture network traffic showed that U-Boot was continuously
> > > asking for retransmit of the same block, and eventually timed out.
> > >
> > > U-Boot is configured with a default TFTP block size of 4096 bytes, which
> > > results in the TFTP blocks being sent in one UDP packet split in three
> > > IP packets. U-Boot is configured with IP fragmentation supprot enabled.
> > > This works fine for all TFTP blocks until a paticular one in the middle
> > > of the kernel image.
> > >
> > > I've narrowed it down to a file of 1472 that can't be transferred at
> > > all (I have attached the binary to this e-mail). Changing the value of
> > > any of the last two bytes of the file allows transferring it correctly,
> > > so I suspect a CRC issue, likely related to IP fragmentation. Lowering
> > > the TFTP block size to avoid fragmentation works around the problem.
> > >
> > > Arguably a TFTP block size of 4096 bytes should probably not be used
> > > with a 1500 bytes MTU network, but I thought it would be useful to fix
> > > the issue nonetheless.
> > >
> > > I can test patches.
> > >
> > Interesting.
> > I will try to reproduce.
> > Thanks for reporting.
> 
> Hi.
> I couldn't reproduce the issue with the file you provided.
> I used sandbox64, and changed the TFTP BLOCK size to 4096.
> I managed to TFTP the file successfully.
> 
> => setenv autoload no
> => setenv ethrotate no
> => setenv ethact eth0
> => setenv ipaddr
> => setenv serverip 172.23.1.137
> => env set ipaddr 172.23.1.100
> => tftpboot 0x100000 test.bin
> Using host_eno1 device
> TFTP from server 172.23.1.137; our IP address is 172.23.1.100
> Filename 'test.bin'.
> Load address: 0x100000
> Loading: #
>          718.8 KiB/s
> done
> Bytes transferred = 1472 (5c0 hex)
> =>

Hmmmm... I wonder if it could be specific to the EQoS ethernet
controller in the i.MX8, maybe caused by issues in hardware CRC
calculation ? I don't have any other board I can use for testing this at
the moment as I'm travelling.

> Can you perhaps send me a network PCAP of your device failing to
> digest the file ?

I'll try to do that tomorrow.

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2022-04-05 23:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-29 20:28 TFTP hangs with fragmented IP packets Laurent Pinchart
2022-03-31  5:43 ` Ramon Fried
2022-04-02 23:17   ` Ramon Fried
2022-04-05 23:11     ` Laurent Pinchart [this message]
2022-04-11 19:02       ` Tim Harvey

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=YkzMk6SKrjDeiDMM@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=marcel.ziswiler@toradex.com \
    --cc=rfried.dev@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox