Skip to content

Net fix and improvements

Glenn Washburn grub-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3net: Unset grub_net_poll_cards_idle when net module has been unloadedgrub-core/net/net.c+1 -10 replies
2/3net: Avoid unnecessary calls to grub_net_tcp_retransmitgrub-core/net/net.c+2 -10 replies
3/3net/tcp: Only call grub_get_time_ms when there are sockets to potentially retransmit forgrub-core/net/tcp.c+7 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] Net fix and improvements

The first patch looks like it was a copy/paste error. If the net module is unloaded, grub_net_poll_cards_idle should be NULL so that a function in the net module which now doesn't exist.

The second and third patches are for performance and were helpful when debugging GRUB. When the net module is loaded, even if there are no net cards found, grub_net_poll_cards_idle will call grub_net_tcp_retransmit() unconditionally. But there's no need to go through tcp retransmit logic if there aren't any cards that we could be retransmitting on.

As for the third patch, if the machine has network cards found, but there are no tcp open sockets (because the user doesn't use the network to boot), then grub_net_tcp_retransmit() should be a noop. Thus is doesn't need to call grub_get_time_ms(), which does a call into firmware on powerpc-ieee1275. So only call grub_get_time_ms() if there are tcp sockets.

Calls to grub_net_poll_cards_idle can happen a lot when GRUB is waiting for a keypress (grub_getkey_noblock calls grub_net_poll_cards_idle). I found this annoying when debugging an issue in GRUB with GDB and I found that nearly every time I interrupted GRUB with the GDB I was landing in OpenBIOS's milliseconds call and then I had to step out back into GRUB which could be a hundred or more instructions. This reduces the probability that interrupting GRUB lands in the firmware when GRUB is blocked waiting on a keypress.

Glenn

Glenn Washburn (3):
net: Unset grub_net_poll_cards_idle when net module has been unloaded
net: Avoid unnecessary calls to grub_net_tcp_retransmit net/tcp: Only call grub_get_time_ms when there are sockets to
potentially retransmit for

 grub-core/net/net.c | 5 +++--
 grub-core/net/tcp.c | 9 +++++++--
 2 files changed, 10 insertions(+), 4 deletions(-)
Signature · 1 line
2.27.0