u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
* TFTP hangs with fragmented IP packets
@ 2022-03-29 20:28 Laurent Pinchart
  2022-03-31  5:43 ` Ramon Fried
  0 siblings, 1 reply; 5+ messages in thread
From: Laurent Pinchart @ 2022-03-29 20:28 UTC (permalink / raw)
  To: u-boot; +Cc: Ramon Fried, Marcel Ziswiler

[-- Attachment #1: Type: text/plain, Size: 1458 bytes --]

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.

-- 
Regards,

Laurent Pinchart

[-- Attachment #2: test.bin --]
[-- Type: application/octet-stream, Size: 1472 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: TFTP hangs with fragmented IP packets
  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
  0 siblings, 1 reply; 5+ messages in thread
From: Ramon Fried @ 2022-03-31  5:43 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: U-Boot Mailing List, Marcel Ziswiler

On Tue, Mar 29, 2022 at 11:28 PM Laurent Pinchart
<laurent.pinchart@ideasonboard.com> 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.
>
> --
> Regards,
>
> Laurent Pinchart
Interesting.
I will try to reproduce.
Thanks for reporting.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: TFTP hangs with fragmented IP packets
  2022-03-31  5:43 ` Ramon Fried
@ 2022-04-02 23:17   ` Ramon Fried
  2022-04-05 23:11     ` Laurent Pinchart
  0 siblings, 1 reply; 5+ messages in thread
From: Ramon Fried @ 2022-04-02 23:17 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: U-Boot Mailing List, Marcel Ziswiler

On Thu, Mar 31, 2022 at 8:43 AM Ramon Fried <rfried.dev@gmail.com> wrote:
>
> On Tue, Mar 29, 2022 at 11:28 PM Laurent Pinchart
> <laurent.pinchart@ideasonboard.com> 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.
> >
> > --
> > Regards,
> >
> > Laurent Pinchart
> 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)
=>

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

Thanks,
Ramon

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: TFTP hangs with fragmented IP packets
  2022-04-02 23:17   ` Ramon Fried
@ 2022-04-05 23:11     ` Laurent Pinchart
  2022-04-11 19:02       ` Tim Harvey
  0 siblings, 1 reply; 5+ messages in thread
From: Laurent Pinchart @ 2022-04-05 23:11 UTC (permalink / raw)
  To: Ramon Fried; +Cc: U-Boot Mailing List, Marcel Ziswiler

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: TFTP hangs with fragmented IP packets
  2022-04-05 23:11     ` Laurent Pinchart
@ 2022-04-11 19:02       ` Tim Harvey
  0 siblings, 0 replies; 5+ messages in thread
From: Tim Harvey @ 2022-04-11 19:02 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: Ramon Fried, U-Boot Mailing List, Marcel Ziswiler

On Tue, Apr 5, 2022 at 4:11 PM Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
>
> 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

Laurent,

I'm working with a imx8mp-venice-gw74xx [1] board with EQoS<->RGMII
PHY and am able to transfer your test file with
CONFIG_TFTP_BLOCKSIZE=4096 fine. I haven't had any issues transferring
files in general and routinely transfer files up to 513MB.

Are you running into an issue perhaps with your loadaddr position? I'm
using CONFIG_SYS_LOAD_ADDR=0x40480000.

Best Regards,

Tim
[1] https://patchwork.ozlabs.org/project/uboot/list/?series=294275

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-04-11 19:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2022-04-11 19:02       ` Tim Harvey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).