Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shim always uses 512 byte block size to fetch grub EFI binary #618

Open
mtniehaus opened this issue Oct 12, 2023 · 2 comments
Open

Shim always uses 512 byte block size to fetch grub EFI binary #618

mtniehaus opened this issue Oct 12, 2023 · 2 comments

Comments

@mtniehaus
Copy link

Shim uses a hard-coded 512 byte block size for the TFTP (netboot) request to download the grub EFI file:

https://github.com/rhboot/shim/blob/main/netboot.c#L325

This results in very poor performance transferring the file, especially over high-latency network connections (and compared to iPXE). It would be better to use the block size that was negotiated and used to transfer the shim EFI binary itself, which is often bigger (e.g. 1482 on a typical Ethernet segment).

@mtniehaus
Copy link
Author

image In this Wireshark capture, you can see the original firmware-driven request specifies a 1482 block size, but Shim specifies 512 when fetching Grub (and Grub is using a 1024 block size, which isn't quite optimal either).

@kukrimate
Copy link

According to the UEFI specification, there is nothing stopping you from passing NULL for the block size, then the firmware theoretically should use the largest block size it can.

However it is entirely possible that there is a reason for the hard-coded block size, perhaps that functionality doesnt work correctly on a large enough number of production firmwares to warrant this workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants