[gPXE] [Etherboot-developers] [PATCH] [tftp] Kick off TFTP RRQ from a process to avoid losing first packet
Thomas Horsten
thomas at horsten.com
Tue Jan 12 12:16:17 EST 2010
2010/1/12 Stefan Hajnoczi <stefanha at gmail.com>:
> On Tue, Jan 12, 2010 at 4:45 PM, Thomas Horsten <thomas at horsten.com> wrote:
>>> How big are the delays you are seeing?
>>
>> About 400ms for each TFTP transfer. This adds up when GRUB loads 10 or
>> more modules.
>
> That is huge. I think anything >100ms is going to be noticable.
>
> This large number surprises me because the numeric resolver needs 1
> round-robin dispatch and the retry timer should start very low (<10ms
> I think).
I'm guessing it's the timer that retransmits after 400ms. With my
patch, of course the timer only gets kicked off after the socket is
ready.
> Can you give details of the setup so I can reproduce and profile it?
I have two, one is with QEmu and one is with tftpd-hpa. In either case
I have built GRUB from upstream git and put pxegrub.img in the root of
the directory served by the TFTP, and it's modules in boot/grub/
My QEmu has the TFTP patch for error handling applied, otherwise the
delay is double:
http://git.savannah.gnu.org/cgit/qemu.git/commit/?id=bfe4e172421d711d1d5b049f90be0961451c8259
and also Milan Plzik's patch that doesn't seem to have been applied
upstream yet:
http://lists.gnu.org/archive/html/qemu-devel/2010-01/msg00449.html
Then simply do:
"qemu -option-rom ~/src/gpxe/gpxe/src/bin/8086100e.rom -tftp ~/tftp
-net nic -net user -net tap -bootp tftp://10.0.2.2/pxegrub.img"
or for the real setup, I chainload gPXE from my HP laptop's Intel PXE,
Ctrl+B it, and run:
> set filename tftp://10.80.248.52/pxegrub.img
> autoboot
> I wonder if there is something weird like unnecessary DNS resolution going on.
I guess it's sensible enough to wait 400ms for a response to the first
UDP packet we think we sent out.
Profiling it is easiest with QEmu but its TFTP server has so many
problems of its own that you need at least the above patches. I used
tcpdump to capture and inspected with Wireshark, and find the same
pattern with HP/gPXE/tftp-hpa and qemu/gPXE/qemu-tftp.
Thomas
More information about the gPXE
mailing list