Re: iPXE isnt able to get link status from my oprom driver, but PXE works.


Michael Brown <mcb30@...>
 

On 15/12/2020 06:48, udai sharma wrote:
net2: 00:07:43:29:46:40 using NII on NII-0000:02:00.0 (open)
This shows that you are using iPXE's "NII" driver, which uses the UEFI UNDI API. (Possible alternatives were the "SNP" driver which uses the UEFI SNP API, or a native PCI driver.)

[Link:down, TX:0 TXE:0 RX:0 RXE:0]
[Link status: Unknown (http://ipxe.org/1a086194)]
The link is reported as down in this initial banner because the UEFI UNDI API does not provide any way to retrieve the link state until after the interface has been opened. However...

Configuring (net2 00:07:43:29:46:40)............. ok
... the link is successfully up at this point, otherwise you would be seeing a "Waiting for link-up on net2" message from iPXE.

net0: fe80::ec4:7aff:fe6c:623e/64 (inaccessible)
net1: fe80::ec4:7aff:fe6c:623f/64 (inaccessible)
net2: 102.90.90.96/255.255.255.0 gw 102.90.90.1
net2: fe80::207:43ff:fe29:4640/64
net3: fe80::207:43ff:fe29:4658/64 (inaccessible)
Next server: 102.90.90.48
Filename: http://102.90.90.48/real_boot_script.php
http://102.90.90.48/real_boot_script.php.... [connecting].. ok
real_boot_script.php : 208 bytes [script]
http://102.90.90.48/iPXE/initrd.img...... 0%
Connection reset (http://ipxe.org/0f0a6095)
Could not boot image: Connection reset (http://ipxe.org/0f0a6095)
No more network devices
As you can see it is able to fetch 'real_boot_script.php' from http server, but Link remains Down.
So: there is no problem with the link state, and the fact that you were able to obtain a DHCPv4 address and download something from your HTTP server indicates that the link is very definitely up and functional.

The error that you are experiencing is described on the error page shown in your error message:

http://ipxe.org/0f0a6095

As you will see from that page, this error indicates a TCP RST being sent from your web server.

Since this appears to coincide with your first attempt to download anything larger than a single network packet, my first guess would be that you have a problem receiving full-sized packets.

iPXE will use the MTU as reported by your driver via PXE_OPCODE_GET_INIT_INFO. The values in FrameDataLen and MediaHeaderLen will be added together to create the receive buffer length as used by iPXE. This buffer length will be provided to your driver as BufferLen for subsequent calls to PXE_OPCODE_RECEIVE.

iPXE will also use the MTU to calculate the TCP MSS sent as part of the TCP SYN packet.

The DHCP server is allowed to override the MTU, up to the maximum supported by the hardware (which, in this case, is the value provided via PXE_OPCODE_GET_INIT_INFO).

You may want to check these various values. You may also want to check that the MTU is configured correctly on your HTTP server, if your network is using any kind of jumbo frames.

Thanks,

Michael

Join discuss@edk2.groups.io to automatically receive all group messages.