more notes about lib/efi_selftest/efi_selftest_http
1) test does not send HEAD request as stated in the
lib/efi_selftest/efi_selftest_http.c file header. It send GET request in
the  line 168 and read the response twice (line 203 and line 244). It
looks a bit wrong to read the response twice from the same request.

2) I replace "http://example.com/"; with my router page
"http://10.0.14.10/index.html"; to avoid DNS issue (discussed in the
previous mail), but  sandbox/sandbox64 produce  SIGABRT during a test run.


kl@laska:~/econet/bootloader/u-boot-current$ sudo gdb ./u-boot
GNU gdb (Debian 15.2-1) 15.2
Copyright (C) 2024 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./u-boot...
(gdb) run -D
Starting program: /home/kl/econet/bootloader/u-boot-current/u-boot -D
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Bloblist at b000 not found (err=-2)


U-Boot 2025.01-rc5-00387-gc390d0882c37-dirty (Dec 28 2024 - 12:19:19 +0300)

Reset Status: COLD
Model: sandbox
DRAM:  256 MiB

Warning: host_lo MAC addresses don't match:
Address in ROM is        12:f0:b0:f5:1b:36
Address in environment is    02:00:11:22:33:44
Core:  114 devices, 60 uclasses, devicetree: board, universal payload active
WDT:   Started alarm-wdt with servicing every 1000ms (5s timeout)
NAND:  0 MiB
MMC:   
Loading Environment from nowhere... OK
Warning: device tree node '/config/environment' not found
In:    serial
Out:   serial,vidconsole
Err:   serial,vidconsole
Model: sandbox
Net:   eth0: host_lo, eth1: host_enp1s0, eth2: host_wlp2s0, eth3:
host_enx00e04c6801f6
Error: eth@10002000 No valid MAC address found.


Hit any key to stop autoboot:  0
=> setenv autoload no;setenv ethrotate no;setenv ethact host_enp1s0; dhcp
BOOTP broadcast 1
BOOTP broadcast 2
BOOTP broadcast 3
BOOTP broadcast 4
DHCP client bound to address 10.0.0.146 (3407 ms)
=> setenv efi_selftest "http protocol"
=> bootefi selftest
     efi_var_to_file() Cannot persist EFI variables without system partition

Testing EFI API implementation

Selected test: 'http protocol'

Setting up 'http protocol'
HTTP Service Binding: child created successfully
Setting up 'http protocol' succeeded

Executing 'http protocol'
phys_to_virt: Cannot map sandbox address 18bc1010 (SDRAM from 0 to 10000000)

Program received signal SIGABRT, Aborted.
__pthread_kill_implementation (threadid=<optimized out>,
signo=signo@entry=6, no_tid=no_tid@entry=0)
    at ./nptl/pthread_kill.c:44
warning: 44    ./nptl/pthread_kill.c: No such file or directory
(gdb) bt
#0  __pthread_kill_implementation (threadid=<optimized out>,
signo=signo@entry=6, no_tid=no_tid@entry=0)
    at ./nptl/pthread_kill.c:44
#1  0x00007ffff7e2acef in __pthread_kill_internal (threadid=<optimized
out>, signo=6)
    at ./nptl/pthread_kill.c:78
#2  0x00007ffff7dd6c42 in __GI_raise (sig=sig@entry=6) at
../sysdeps/posix/raise.c:26
#3  0x00007ffff7dbf4f0 in __GI_abort () at ./stdlib/abort.c:79
#4  0x000055555559d450 in os_abort () at arch/sandbox/cpu/os.c:1054
#5  phys_to_virt (paddr=<optimized out>) at arch/sandbox/cpu/cpu.c:121
#6  phys_to_virt (paddr=<optimized out>) at arch/sandbox/cpu/cpu.c:96
#7  0x0000555555791444 in map_physmem.constprop.0
(paddr=paddr@entry=414978064, len=<optimized out>,
    len@entry=36, flags=0) at arch/sandbox/cpu/cpu.c:184
#8  0x00005555556d1587 in map_sysmem (paddr=414978064, len=36) at
./arch/sandbox/include/asm/io.h:225
#9  store_block (src=0x555555964462 <net_pkt_buf+1858> "HTTP/1.0 200
OK\r\nConnection: close\r\n",
    offset=<optimized out>, len=36) at net/wget.c:65
#10 tcp_stream_rx (tcp=<optimized out>, rx_offs=<optimized out>,
buf=0x555555964462 <net_pkt_buf+1858>,
    len=36) at net/wget.c:230
#11 0x00005555556d4e3c in tcp_rx_user_data (tcp=tcp@entry=0x55555595e700
<tcp_stream.lto_priv>,
    tcp_seq_num=tcp_seq_num@entry=3457615271,
    buf=buf@entry=0x555555964462 <net_pkt_buf+1858> "HTTP/1.0 200
OK\r\nConnection: close\r\n",
    len=len@entry=36) at net/tcp.c:943
#12 0x00005555556d630d in tcp_rx_state_machine (tcp=0x55555595e700
<tcp_stream.lto_priv>,
    b=0x55555596442e <net_pkt_buf+1806>, pkt_len=88) at net/tcp.c:1104
#13 rxhand_tcp_f (b=0x55555596442e <net_pkt_buf+1806>, pkt_len=88) at
net/tcp.c:1207
#14 net_process_received_packet (in_packet=<optimized out>,
len=<optimized out>) at net/net.c:1411
#15 eth_rx () at net/eth-uclass.c:459
#16 0x00005555556d7121 in net_loop (protocol=protocol@entry=WGET) at
net/net.c:656
#17 0x00005555556d7b87 in wget_do_request (dst_addr=414978064,
uri=<optimized out>) at net/wget.c:413
#18 0x00005555556875cb in wget_request (info=0x555555940e20
<efi_wget_info>, dst_addr=4166818,
    uri=0x7fffffffd618 "http://10.0.14.10/index.html";) at
net/net-common.c:26
#19 efi_net_do_request (url=0x7fffffffd618
"http://10.0.14.10/index.html";, method=HTTP_METHOD_GET,
    buffer=0x19c6b980, status_code=0x19c6b998, file_size=0x19c6b988,
headers_buffer=0x19c7b3a8 "")
    at lib/efi_loader/efi_net.c:1320
#20 efi_http_request (this=0x19c6b940, token=0x7fffffffdb70) at
lib/efi_loader/efi_http.c:242
#21 0x000055555568f3ec in execute () at
lib/efi_selftest/efi_selftest_http.c:168
#22 0x0000555555681687 in execute (test=0x5555559225f0
<_u_boot_list_2_efi_unit_test_2_http>,
    failures=0x7fffffffdd08) at lib/efi_selftest/efi_selftest.c:112
#23 efi_st_do_tests (testname=0x19c47df0, phase=1, steps=7,
failures=0x7fffffffdd08)
    at lib/efi_selftest/efi_selftest.c:229
#24 0x00005555555bdce6 in efi_selftest (systab=0x55555592ec20 <systab>,
image_handle=0x19c6b7a0,
    systab=0x55555592ec20 <systab>) at lib/efi_selftest/efi_selftest.c:313
#25 do_efi_selftest () at cmd/bootefi.c:109
#26 do_bootefi (cmdtp=<optimized out>, flag=<optimized out>,
argc=<optimized out>, argv=<optimized out>)
    at cmd/bootefi.c:176
#27 0x00005555555f2bb6 in cmd_call (cmdtp=0x5555559168b8
<_u_boot_list_2_cmd_2_bootefi>, flag=0, argc=2,
    argv=0x19c58a20, repeatable=0x7fffffffdd84) at common/command.c:582
#28 cmd_process (flag=<optimized out>, argc=2, argv=0x19c58a20,
repeatable=0x555555948c68 <flag_repeat>,
    ticks=0x0) at common/command.c:637
#29 0x00005555555ebdf6 in run_pipe_real (pi=0x19c586a0) at
common/cli_hush.c:1672
#30 run_list_real (pi=pi@entry=0x19c586a0) at common/cli_hush.c:1868
#31 0x00005555555ec100 in run_list (pi=0x19c586a0) at common/cli_hush.c:2017
#32 parse_stream_outer (inp=inp@entry=0x7fffffffdf28, flag=flag@entry=2)
at common/cli_hush.c:3207
#33 0x00005555555ed848 in parse_file_outer () at common/cli_hush.c:3299
#34 cli_loop () at common/cli.c:302
#35 main_loop () at common/main.c:82
--Type <RET> for more, q to quit, c to continue without paging--Quit

The incorrect image loading address comes to wget from the test or efi
subsystem, thus we get SIGABRT on map_sysmem() function call.

Mikhail Kshevetskiy



On 28.12.2024 00:00, Tom Rini wrote:
> On Mon, Dec 23, 2024 at 01:58:41PM +0300, Mikhail Kshevetskiy wrote:
>
>> Legacy TCP stack is bad. Here are 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 selective 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.
>>  * wget test generate bad tcp stream, test should fail but it passes instead
>>
>> This series of patches fixes all of the above issues.
>>
>> The benefits:
>>  * A lot of bug was fixed
>>  * Better and more reliable TCP state machine
>>  * Tcp clients becomes smaller/simpler
>>  * Data uploading was fixed (now it's possible to transmit a huge amount of
>>    data from the board to remote host)
>>
>> Modification was verified with
>>  * firmware downloading via u-boot wget command
>>  * fastboot over tcp
>>  * netcat linux client using test netcat implementation (not included
>>    to this patch series)
>>  * Firefox/Chrome/Edge using test web-server implementation (not included
>>    to this patch series)
> This fails on the EFI self test on qemu-arm64. You can see this with
> "bootefi selftest" on the platform, and the excerpt from the full
> failure log at:
> https://source.denx.de/u-boot/u-boot/-/jobs/984858
> https://dev.azure.com/u-boot/u-boot/_build/results?buildId=10224&view=logs&s=664d8594-b731-54d7-afc5-7167226e08f3&j=52970d71-9fb7-5005-2ae1-66817be903ba
> is:
> Setting up 'http protocol' succeeded
> Executing 'http protocol'
> 93.184.215.14
> Packets received 5, Transfer Successful
> lib/efi_selftest/efi_selftest_http.c(216):
> ERROR: File not found
> lib/efi_selftest/efi_selftest.c(114):
> ERROR: Executing 'http protocol' failed
> Tearing down 'http protocol'
>

Reply via email to