inconsistent wget behavior

Greetings,
I've recently given wget/tcp a try and find the results inconsistent.
Transferring the same file 15 times in a row will eventually give me an incomplete transfer with packet/byte count wrong but showing 'Transfer Successful'.
Here is current master on an imx8mp-venice-gw74xx board using IMX8MP EQOS enet dev:
u-boot=> time wget $loadaddr /tftpboot/venice/core-image-minimal.ext4.gz && md5sum $loadaddr $filesize HTTP/1.0 200 OK| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Packets received 64368, Transfer Successful Bytes transferred = 93198937 (58e1a59 hex)
time: 3.099 seconds md5 for 48200000 ... 4dae1a58 ==> 69bedfe899148c43c09a98ac950dd0ed u-boot=> time wget $loadaddr /tftpboot/venice/core-image-minimal.ext4.gz && md5sum $loadaddr $filesize HTTP/1.0 200 OK| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Packets received 64368, Transfer Successful Bytes transferred = 93198937 (58e1a59 hex)
time: 3.103 seconds md5 for 48200000 ... 4dae1a58 ==> 69bedfe899148c43c09a98ac950dd0ed u-boot=> time wget $loadaddr /tftpboot/venice/core-image-minimal.ext4.gz && md5sum $loadaddr $filesize HTTP/1.0 200 OK| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Packets received 64368, Transfer Successful Bytes transferred = 93198937 (58e1a59 hex)
time: 3.091 seconds md5 for 48200000 ... 4dae1a58 ==> 69bedfe899148c43c09a98ac950dd0ed u-boot=> time wget $loadaddr /tftpboot/venice/core-image-minimal.ext4.gz && md5sum $loadaddr $filesize HTTP/1.0 200 OK| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Packets received 64368, Transfer Successful Bytes transferred = 93198937 (58e1a59 hex)
time: 3.083 seconds md5 for 48200000 ... 4dae1a58 ==> 69bedfe899148c43c09a98ac950dd0ed u-boot=> time wget $loadaddr /tftpboot/venice/core-image-minimal.ext4.gz && md5sum $loadaddr $filesize HTTP/1.0 200 OK| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Packets received 64368, Transfer Successful Bytes transferred = 93198937 (58e1a59 hex)
time: 3.131 seconds md5 for 48200000 ... 4dae1a58 ==> 69bedfe899148c43c09a98ac950dd0ed u-boot=> time wget $loadaddr /tftpboot/venice/core-image-minimal.ext4.gz && md5sum $loadaddr $filesize HTTP/1.0 200 OK| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Packets received 64368, Transfer Successful Bytes transferred = 93198937 (58e1a59 hex)
time: 3.071 seconds md5 for 48200000 ... 4dae1a58 ==> 69bedfe899148c43c09a98ac950dd0ed u-boot=> time wget $loadaddr /tftpboot/venice/core-image-minimal.ext4.gz && md5sum $loadaddr $filesize HTTP/1.0 200 OK| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Packets received 64368, Transfer Successful Bytes transferred = 93198937 (58e1a59 hex)
time: 3.079 seconds md5 for 48200000 ... 4dae1a58 ==> 69bedfe899148c43c09a98ac950dd0ed u-boot=> time wget $loadaddr /tftpboot/venice/core-image-minimal.ext4.gz && md5sum $loadaddr $filesize HTTP/1.0 200 OK| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Packets received 64368, Transfer Successful Bytes transferred = 93198937 (58e1a59 hex)
time: 3.083 seconds md5 for 48200000 ... 4dae1a58 ==> 69bedfe899148c43c09a98ac950dd0ed u-boot=> time wget $loadaddr /tftpboot/venice/core-image-minimal.ext4.gz && md5sum $loadaddr $filesize HTTP/1.0 200 OK| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Packets received 64368, Transfer Successful Bytes transferred = 93198937 (58e1a59 hex)
time: 3.087 seconds md5 for 48200000 ... 4dae1a58 ==> 69bedfe899148c43c09a98ac950dd0ed u-boot=> time wget $loadaddr /tftpboot/venice/core-image-minimal.ext4.gz && md5sum $loadaddr $filesize HTTP/1.0 200 OK| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Packets received 64368, Transfer Successful Bytes transferred = 93198937 (58e1a59 hex)
time: 3.074 seconds md5 for 48200000 ... 4dae1a58 ==> 69bedfe899148c43c09a98ac950dd0ed u-boot=> time wget $loadaddr /tftpboot/venice/core-image-minimal.ext4.gz && md5sum $loadaddr $filesize HTTP/1.0 200 OK| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Packets received 64368, Transfer Successful Bytes transferred = 26984682 (19bc0ea hex)
time: 3.011 seconds md5 for 48200000 ... 49bbc0e9 ==> c9978ff116605a7729a1cb14ef51fc20
Anyone else seeing this?
Best Regards
Tim

[Adding Tom and Marek]
On Wed, Nov 8, 2023 at 7:22 PM Tim Harvey tharvey@gateworks.com wrote:
Greetings,
I've recently given wget/tcp a try and find the results inconsistent.
Transferring the same file 15 times in a row will eventually give me an incomplete transfer with packet/byte count wrong but showing 'Transfer Successful'.
Here is current master on an imx8mp-venice-gw74xx board using IMX8MP EQOS enet dev:
u-boot=> time wget $loadaddr /tftpboot/venice/core-image-minimal.ext4.gz && md5sum $loadaddr $filesize HTTP/1.0 200 OK| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Packets received 64368, Transfer Successful Bytes transferred = 93198937 (58e1a59 hex)
time: 3.103 seconds md5 for 48200000 ... 4dae1a58 ==> 69bedfe899148c43c09a98ac950dd0ed
....
u-boot=> time wget $loadaddr /tftpboot/venice/core-image-minimal.ext4.gz && md5sum $loadaddr $filesize HTTP/1.0 200 OK| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Packets received 64368, Transfer Successful Bytes transferred = 26984682 (19bc0ea hex)
time: 3.011 seconds md5 for 48200000 ... 49bbc0e9 ==> c9978ff116605a7729a1cb14ef51fc20
Anyone else seeing this?
Yes, I am seeing the same behavior on an imx8mn board using the FEC driver.
I am transferring a 412MB file. Doing the wget transfers several times in a row, I also see the incorrect number of bytes transferred:
u-boot=> wget test HTTP/1.0 200 OK| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Packets received 298387, Transfer Successful Bytes transferred = 432013312 (19c00000 hex)
u-boot=> wget test HTTP/1.0 200 OK| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Packets received 298375, Transfer Successful Bytes transferred = 58355848 (37a7088 hex)

On Wed, Nov 08, 2023 at 09:00:23PM -0300, Fabio Estevam wrote:
[Adding Tom and Marek]
On Wed, Nov 8, 2023 at 7:22 PM Tim Harvey tharvey@gateworks.com wrote:
Greetings,
I've recently given wget/tcp a try and find the results inconsistent.
Transferring the same file 15 times in a row will eventually give me an incomplete transfer with packet/byte count wrong but showing 'Transfer Successful'.
Here is current master on an imx8mp-venice-gw74xx board using IMX8MP EQOS enet dev:
u-boot=> time wget $loadaddr /tftpboot/venice/core-image-minimal.ext4.gz && md5sum $loadaddr $filesize HTTP/1.0 200 OK| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Packets received 64368, Transfer Successful Bytes transferred = 93198937 (58e1a59 hex)
time: 3.103 seconds md5 for 48200000 ... 4dae1a58 ==> 69bedfe899148c43c09a98ac950dd0ed
....
u-boot=> time wget $loadaddr /tftpboot/venice/core-image-minimal.ext4.gz && md5sum $loadaddr $filesize HTTP/1.0 200 OK| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Packets received 64368, Transfer Successful Bytes transferred = 26984682 (19bc0ea hex)
time: 3.011 seconds md5 for 48200000 ... 49bbc0e9 ==> c9978ff116605a7729a1cb14ef51fc20
Anyone else seeing this?
Yes, I am seeing the same behavior on an imx8mn board using the FEC driver.
I am transferring a 412MB file. Doing the wget transfers several times in a row, I also see the incorrect number of bytes transferred:
Interesting. What if you take wget out of the equation and use "tftp" to grab a large file with a known checksum, repeatedly (note that "rhash -C" will give a crc32 in Linux so you can confirm the correct value and loop a get, crc32, compare, repeat loop with a little work) ? I ask because I was reminded today that for me at least, the RPi ethernet isn't reliable in U-Boot for me if you stress it too hard. So I'd like to try see if this is "wget bug" or "network driver/related bug".

Hi Tom,
On Wed, Nov 8, 2023 at 9:17 PM Tom Rini trini@konsulko.com wrote:
Interesting. What if you take wget out of the equation and use "tftp" to grab a large file with a known checksum, repeatedly (note that "rhash -C" will give a crc32 in Linux so you can confirm the correct value and loop a get, crc32, compare, repeat loop with a little work) ? I ask because I was reminded today that for me at least, the RPi ethernet isn't reliable in U-Boot for me if you stress it too hard. So I'd like to try see if this is "wget bug" or "network driver/related bug".
I was not able to see a failure when using "tftp" to transfer the same 420MB file.
The number of bytes transferred and md5sum always match, so this is a wget bug.

Hi Paul,
On Wed, Nov 8, 2023 at 10:24 PM Fabio Estevam festevam@gmail.com wrote:
I was not able to see a failure when using "tftp" to transfer the same 420MB file.
The number of bytes transferred and md5sum always match, so this is a wget bug.
There was another user who confirmed the same issue:
https://lore.kernel.org/u-boot/CADQ0-X_cj1ECn67U3sefcZ-Jm4OBSYmZkA+JaZRCa3ek...
Could you please take a look at this bug?
wget is not reliable at the moment.
Thanks

Hi Fabio,
Yes. I'll look into this problem.
Yours, Paul
On Thu, 16 Nov 2023 at 08:34, Fabio Estevam festevam@gmail.com wrote:
Hi Paul,
On Wed, Nov 8, 2023 at 10:24 PM Fabio Estevam festevam@gmail.com wrote:
I was not able to see a failure when using "tftp" to transfer the same 420MB file.
The number of bytes transferred and md5sum always match, so this is a
wget bug.
There was another user who confirmed the same issue:
https://lore.kernel.org/u-boot/CADQ0-X_cj1ECn67U3sefcZ-Jm4OBSYmZkA+JaZRCa3ek...
Could you please take a look at this bug?
wget is not reliable at the moment.
Thanks

Hi Paul,
On Thu, Nov 16, 2023 at 6:41 AM Paul Liu paul.liu@linaro.org wrote:
Hi Fabio,
Yes. I'll look into this problem.
Did you have a chance to investigate this problem?
Thanks

Hi Fabio,
I tried to investigate this by U-boot sandbox. But it seems to me that I cannot reproduce this issue. I put a file on localhost apache server and tried to download it from localhost. I might need a more persistent way to reproduce this bug.
Yours, Paul
On Sat, 6 Jan 2024 at 00:17, Fabio Estevam festevam@gmail.com wrote:
Hi Paul,
On Thu, Nov 16, 2023 at 6:41 AM Paul Liu paul.liu@linaro.org wrote:
Hi Fabio,
Yes. I'll look into this problem.
Did you have a chance to investigate this problem?
Thanks

Hi
On Fri, Jan 5, 2024 at 7:57 PM Paul Liu paul.liu@linaro.org wrote:
Hi Fabio,
I tried to investigate this by U-boot sandbox. But it seems to me that I cannot reproduce this issue. I put a file on localhost apache server and tried to download it from localhost. I might need a more persistent way to reproduce this bug.
Can you reproduce with dcache off?
Where are the patches to test?
Michael

Hi Michael,
On Fri, Jan 5, 2024 at 4:12 PM Michael Nazzareno Trimarchi michael@amarulasolutions.com wrote:
Can you reproduce with dcache off?
I haven't tried it.
Where are the patches to test?
The wget issue can be reproduced with U-Boot master.
No need for extra patches. Please see the first message of this thread where Tim explains how to reproduce it.

Hi Fabio
On Fri, Jan 5, 2024 at 8:32 PM Fabio Estevam festevam@gmail.com wrote:
Hi Michael,
On Fri, Jan 5, 2024 at 4:12 PM Michael Nazzareno Trimarchi michael@amarulasolutions.com wrote:
Can you reproduce with dcache off?
I haven't tried it.
Where are the patches to test?
The wget issue can be reproduced with U-Boot master.
No need for extra patches. Please see the first message of this thread where Tim explains how to reproduce it.
I was thinking that was lwip integration
Michael

On Fri, Jan 5, 2024 at 4:49 PM Michael Nazzareno Trimarchi michael@amarulasolutions.com wrote:
I was thinking that was lwip integration
That's a different issue.
If you want to test lwip integration, you can try it from: https://github.com/muvarov/u-boot/tree/master_lwip_test_v10

Hi
Is this code correct?
if (tcp_seq_num >= initial_data_seq_num && store_block(pkt, tcp_seq_num - initial_data_seq_num, len) != 0) { wget_fail("wget: store error\n", tcp_seq_num, tcp_ack_num, action); return; }
Can not be seq_num wrap around? Another point seems that is not guarantee packet reassembly
Michael
On Fri, Jan 5, 2024 at 8:53 PM Fabio Estevam festevam@gmail.com wrote:
On Fri, Jan 5, 2024 at 4:49 PM Michael Nazzareno Trimarchi michael@amarulasolutions.com wrote:
I was thinking that was lwip integration
That's a different issue.
If you want to test lwip integration, you can try it from: https://github.com/muvarov/u-boot/tree/master_lwip_test_v10

Hi
On Sat, Jan 6, 2024 at 9:49 AM Michael Nazzareno Trimarchi michael@amarulasolutions.com wrote:
Hi
Is this code correct?
if (tcp_seq_num >= initial_data_seq_num && store_block(pkt, tcp_seq_num - initial_data_seq_num, len) != 0) { wget_fail("wget: store error\n", tcp_seq_num, tcp_ack_num, action); return; }
Can not be seq_num wrap around? Another point seems that is not guarantee packet reassembly
And what happen if you are going to generate out of sequence packet and with large seq_number on purpose?
I think that lwip has much more sense
Michael
Michael
On Fri, Jan 5, 2024 at 8:53 PM Fabio Estevam festevam@gmail.com wrote:
On Fri, Jan 5, 2024 at 4:49 PM Michael Nazzareno Trimarchi michael@amarulasolutions.com wrote:
I was thinking that was lwip integration
That's a different issue.
If you want to test lwip integration, you can try it from: https://github.com/muvarov/u-boot/tree/master_lwip_test_v10
-- Michael Nazzareno Trimarchi Co-Founder & Chief Executive Officer M. +39 347 913 2170 michael@amarulasolutions.com __________________________________
Amarula Solutions BV Joop Geesinkweg 125, 1114 AB, Amsterdam, NL T. +31 (0)85 111 9172 info@amarulasolutions.com www.amarulasolutions.com

Hi Michael,
On Sat, Jan 6, 2024 at 5:49 AM Michael Nazzareno Trimarchi michael@amarulasolutions.com wrote:
Hi
Is this code correct?
if (tcp_seq_num >= initial_data_seq_num && store_block(pkt, tcp_seq_num - initial_data_seq_num, len) != 0) { wget_fail("wget: store error\n", tcp_seq_num, tcp_ack_num, action); return; }
Can not be seq_num wrap around? Another point seems that is not guarantee packet reassembly
If you submit a patch, I will be glad to test it.
Cheers

Hi
Il dom 7 gen 2024, 17:08 Fabio Estevam festevam@gmail.com ha scritto:
Hi Michael,
On Sat, Jan 6, 2024 at 5:49 AM Michael Nazzareno Trimarchi michael@amarulasolutions.com wrote:
Hi
Is this code correct?
if (tcp_seq_num >= initial_data_seq_num && store_block(pkt, tcp_seq_num - initial_data_seq_num, len) != 0) { wget_fail("wget: store error\n", tcp_seq_num, tcp_ack_num, action); return; }
Can not be seq_num wrap around? Another point seems that is not guarantee packet reassembly
If you submit a patch, I will be glad to test it.
Cheers
I have already wrote something but I can not test. Will send tonight. My feeling is that sometime the initial sequence number of TCP ip is next to wrap around but not sure.
Michael

Hi Fabio
On Sun, Jan 7, 2024 at 5:19 PM Michael Nazzareno Trimarchi michael@amarulasolutions.com wrote:
Hi
Il dom 7 gen 2024, 17:08 Fabio Estevam festevam@gmail.com ha scritto:
Hi Michael,
On Sat, Jan 6, 2024 at 5:49 AM Michael Nazzareno Trimarchi michael@amarulasolutions.com wrote:
Hi
Is this code correct?
if (tcp_seq_num >= initial_data_seq_num && store_block(pkt, tcp_seq_num - initial_data_seq_num, len) != 0) { wget_fail("wget: store error\n", tcp_seq_num, tcp_ack_num, action); return; }
Can not be seq_num wrap around? Another point seems that is not guarantee packet reassembly
If you submit a patch, I will be glad to test it.
Cheers
I have already wrote something but I can not test. Will send tonight. My feeling is that sometime the initial sequence number of TCP ip is next to wrap around but not sure.
I have sent but not sure about it, just compile for now ;)
Michael

Hi Michael,
On Sun, Jan 7, 2024 at 1:36 PM Michael Nazzareno Trimarchi michael@amarulasolutions.com wrote:
I have sent but not sure about it, just compile for now ;)
It didn't work:
u-boot=> wget 192.168.0.16:/test HTTP/1.0 200 OK| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Packets received 298384, Transfer Successful Bytes transferred = 1448 (5a8 hex) u-boot=> wget 192.168.0.16:/Image HTTP/1.0 200 OK| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Packets received 13692, Transfer Successful Bytes transferred = 1448 (5a8 hex) u-boot=>
Sent two different files, with different sizes, but Bytes transferred reports 1448 in both cases.

Hi Paul,
On Fri, Jan 5, 2024 at 3:57 PM Paul Liu paul.liu@linaro.org wrote:
Hi Fabio,
I tried to investigate this by U-boot sandbox. But it seems to me that I cannot reproduce this issue. I put a file on localhost apache server and tried to download it from localhost. I might need a more persistent way to reproduce this bug.
Do you still have access to the imx8mm-cl-iot-gate board?
I am sure you would be able to reproduce it with it.
Thanks

Hi Paul,
On Fri, Jan 5, 2024 at 4:19 PM Fabio Estevam festevam@gmail.com wrote:
I tried to investigate this by U-boot sandbox. But it seems to me that I cannot reproduce this issue. I put a file on localhost apache server and tried to download it from localhost. I might need a more persistent way to reproduce this bug.
Do you still have access to the imx8mm-cl-iot-gate board?
I am sure you would be able to reproduce it with it.
One colleague from you at Linaro was able to reproduce the bug:
https://lore.kernel.org/u-boot/CADQ0-X_cj1ECn67U3sefcZ-Jm4OBSYmZkA+JaZRCa3ek...
It is not specific to i.MX.
Thanks

Hi Paul,
On Wed, Jan 10, 2024 at 9:20 AM Fabio Estevam festevam@gmail.com wrote:
One colleague from you at Linaro was able to reproduce the bug:
https://lore.kernel.org/u-boot/CADQ0-X_cj1ECn67U3sefcZ-Jm4OBSYmZkA+JaZRCa3ek...
It is not specific to i.MX.
Have you had a chance to look into this wget problem?

Hi Fabio,
I'm on vacation now (Chinese new year). I hope I'll find some time to revive my imx8 board. I've tried sandbox and qemu. Both of them are not reproducible. I'm wondering if it could be some packet loss that causes the issue. Because sandbox and qemu there won't be any missing packets because of loopback devices.
Yours, Paul
On Thu, 8 Feb 2024 at 02:00, Fabio Estevam festevam@gmail.com wrote:
Hi Paul,
On Wed, Jan 10, 2024 at 9:20 AM Fabio Estevam festevam@gmail.com wrote:
One colleague from you at Linaro was able to reproduce the bug:
https://lore.kernel.org/u-boot/CADQ0-X_cj1ECn67U3sefcZ-Jm4OBSYmZkA+JaZRCa3ek...
It is not specific to i.MX.
Have you had a chance to look into this wget problem?

Hi Paul,
On Sun, Feb 11, 2024 at 4:42 PM Paul Liu paul.liu@linaro.org wrote:
Hi Fabio,
I'm on vacation now (Chinese new year). I hope I'll find some time to revive my imx8 board. I've tried sandbox and qemu. Both of them are not reproducible. I'm wondering if it could be some packet loss that causes the issue. Because sandbox and qemu there won't be any missing packets because of loopback devices.
Have you had a chance to reproduce the issue on your imx8mm board?

Hi,
I send a patch fixing the wget issue. There is a wrap around issue as already mentioned in [1].
The log in [2] indicates the following packets.
- Success packet Packets received 64368, Transfer Successful Bytes transferred = 93198937 (58e1a59 hex)
- Failed packet Packets received 64368, Transfer Successful Bytes transferred = 26984682 (19bc0ea hex)
"Bytes transferred" are different, but "Packets received" are same. First one output by net_boot_file_size that is assigned at store_block(). Second one output by packets that is incremented at wget_handler(). Those differences are caused by the following line. If tcp_seq_num is wrap around, store_block() isn't called.
``` static void wget_handler(uchar *pkt, u16 dport, ... if (tcp_seq_num >= initial_data_seq_num && store_block(pkt, tcp_seq_num - initial_data_seq_num, len) != 0) { wget_fail("wget: store error\n", tcp_seq_num, tcp_ack_num, action); net_set_state(NETLOOP_FAIL); return; } ```
I reproduced the issue and fixed it with the following patch. Please check this patch. I will recommend to apply patch in [3] with this patch, if packets may drop.
[1]: https://lore.kernel.org/u-boot/CAOf5uwmb0vJOwSj81KvfWpK6yobyz0Ozm5vDGCa9K0rZ... [2]: https://lore.kernel.org/u-boot/CAJ+vNU2U9W2NRT6hf1CAEQ_56SDQviUEzuDD1iYOpdf1... [3]: https://lore.kernel.org/u-boot/20240414104607.5966-1-yasuharu.shibata@gmail....
Yasuharu Shibata (1): net: wget: fix TCP sequence number wrap around issue
net/wget.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)

If tcp_seq_num is wrap around, tcp_seq_num >= initial_data_seq_num isn't satisfied and store_block() isn't called. The condition has a wrap around issue, so it is fixed in this patch.
Signed-off-by: Yasuharu Shibata yasuharu.shibata@gmail.com --- net/wget.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/net/wget.c b/net/wget.c index 71bac92d84..abab371e58 100644 --- a/net/wget.c +++ b/net/wget.c @@ -404,9 +404,7 @@ static void wget_handler(uchar *pkt, u16 dport, } next_data_seq_num = tcp_seq_num + len;
- if (tcp_seq_num >= initial_data_seq_num && - store_block(pkt, tcp_seq_num - initial_data_seq_num, - len) != 0) { + if (store_block(pkt, tcp_seq_num - initial_data_seq_num, len) != 0) { wget_fail("wget: store error\n", tcp_seq_num, tcp_ack_num, action); net_set_state(NETLOOP_FAIL);

Hi
On Mon, Apr 15, 2024 at 3:01 PM Yasuharu Shibata yasuharu.shibata@gmail.com wrote:
If tcp_seq_num is wrap around, tcp_seq_num >= initial_data_seq_num isn't satisfied and store_block() isn't called. The condition has a wrap around issue, so it is fixed in this patch.
Signed-off-by: Yasuharu Shibata yasuharu.shibata@gmail.com
net/wget.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/net/wget.c b/net/wget.c index 71bac92d84..abab371e58 100644 --- a/net/wget.c +++ b/net/wget.c @@ -404,9 +404,7 @@ static void wget_handler(uchar *pkt, u16 dport, } next_data_seq_num = tcp_seq_num + len;
if (tcp_seq_num >= initial_data_seq_num &&
store_block(pkt, tcp_seq_num - initial_data_seq_num,
len) != 0) {
if (store_block(pkt, tcp_seq_num - initial_data_seq_num, len) != 0) { wget_fail("wget: store error\n", tcp_seq_num, tcp_ack_num, action); net_set_state(NETLOOP_FAIL);
I think I have sent some time ago ;)
Anyway look sane. I was having the same feeling on code inspection
Reviewed-by: Michael Trimarchi michael@amarulasolutions.com
-- 2.25.1

Hi Michael,
On Mon, 15 Apr 2024 at 22:03, Michael Nazzareno Trimarchi michael@amarulasolutions.com wrote:
I think I have sent some time ago ;)
Anyway look sane. I was having the same feeling on code inspection
Reviewed-by: Michael Trimarchi michael@amarulasolutions.com
Thank you for your review. I already checked the thread, sorry I couldn't find your patch and I couldn't see whether it is the same. In any case, I consider there is a potential issue about wrap around, so I submitted a patch.
-- Best regards, Yasuharu Shibata

Hi
On Mon, Apr 15, 2024 at 3:48 PM Yasuharu Shibata yasuharu.shibata@gmail.com wrote:
Hi Michael,
On Mon, 15 Apr 2024 at 22:03, Michael Nazzareno Trimarchi michael@amarulasolutions.com wrote:
I think I have sent some time ago ;)
Anyway look sane. I was having the same feeling on code inspection
Reviewed-by: Michael Trimarchi michael@amarulasolutions.com
Thank you for your review. I already checked the thread, sorry I couldn't find your patch and I couldn't see whether it is the same. In any case, I consider there is a potential issue about wrap around, so I submitted a patch.
Very good job ;) to fix it. Just add Suggest-by: ;)
Michael
-- Best regards, Yasuharu Shibata

Hi
On Mon, Apr 15, 2024 at 3:55 PM Michael Nazzareno Trimarchi michael@amarulasolutions.com wrote:
Hi
On Mon, Apr 15, 2024 at 3:48 PM Yasuharu Shibata yasuharu.shibata@gmail.com wrote:
Hi Michael,
On Mon, 15 Apr 2024 at 22:03, Michael Nazzareno Trimarchi michael@amarulasolutions.com wrote:
I think I have sent some time ago ;)
Anyway look sane. I was having the same feeling on code inspection
Reviewed-by: Michael Trimarchi michael@amarulasolutions.com
Thank you for your review. I already checked the thread, sorry I couldn't find your patch and I couldn't see whether it is the same. In any case, I consider there is a potential issue about wrap around, so I submitted a patch.
Very good job ;) to fix it. Just add Suggest-by: ;)
https://lore.kernel.org/all/CAOMZO5AO5X3aHR0AyriijYa309USuA0HJ6oKrHTqQvhW7i8...
Mine was here
Michael
Michael
-- Best regards, Yasuharu Shibata
-- Michael Nazzareno Trimarchi Co-Founder & Chief Executive Officer M. +39 347 913 2170 michael@amarulasolutions.com __________________________________
Amarula Solutions BV Joop Geesinkweg 125, 1114 AB, Amsterdam, NL T. +31 (0)85 111 9172 info@amarulasolutions.com www.amarulasolutions.com

Hi Michael,
On Mon, 15 Apr 2024 at 22:55, Michael Nazzareno Trimarchi michael@amarulasolutions.com wrote:
Very good job ;) to fix it. Just add Suggest-by: ;)
Thank you for your advice. I sent following v2 patch. https://lore.kernel.org/u-boot/20240416002624.1909-1-yasuharu.shibata@gmail....

Hi Yasuharu,
On Mon, Apr 15, 2024 at 10:01 AM Yasuharu Shibata yasuharu.shibata@gmail.com wrote:
If tcp_seq_num is wrap around, tcp_seq_num >= initial_data_seq_num isn't satisfied and store_block() isn't called. The condition has a wrap around issue, so it is fixed in this patch.
Signed-off-by: Yasuharu Shibata yasuharu.shibata@gmail.com
Great work!
I applied your previous patch: https://lore.kernel.org/u-boot/20240414104607.5966-1-yasuharu.shibata@gmail....
and this one against top-of-tree U-Boot and I no longer observe the wget corruption.
Reported-by: Tim Harvey tharvey@gateworks.com Tested-by: Fabio Estevam festevam@denx.de
Thanks a lot for fixing this long-standing wget bug.
Cheers,
Fabio Estevam
participants (6)
-
Fabio Estevam
-
Michael Nazzareno Trimarchi
-
Paul Liu
-
Tim Harvey
-
Tom Rini
-
Yasuharu Shibata