increase network try interval gradually
* grub-core/net/arp.c (grub_net_arp_send_request): Increase network try interval gradually. * grub-core/net/icmp6.c (grub_net_icmp6_send_request): Likewise. * grub-core/net/net.c (grub_net_fs_read_real): Likewise. * grub-core/net/tftp.c (tftp_open): Likewise. * include/grub/net.h (GRUB_NET_INTERVAL_ADDITION): New define.
This commit is contained in:
parent
d99d2f8416
commit
6f65e36cc4
6 changed files with 19 additions and 5 deletions
|
@ -1,3 +1,12 @@
|
|||
2014-01-21 Paulo Flabiano Smorigo <pfsmorigo@br.ibm.com>
|
||||
|
||||
* grub-core/net/arp.c (grub_net_arp_send_request): Increase network try
|
||||
interval gradually.
|
||||
* grub-core/net/icmp6.c (grub_net_icmp6_send_request): Likewise.
|
||||
* grub-core/net/net.c (grub_net_fs_read_real): Likewise.
|
||||
* grub-core/net/tftp.c (tftp_open): Likewise.
|
||||
* include/grub/net.h (GRUB_NET_INTERVAL_ADDITION): New define.
|
||||
|
||||
2014-01-21 Paulo Flabiano Smorigo <pfsmorigo@br.ibm.com>
|
||||
|
||||
* grub-core/net/net.c (receive_packets): Change stop condition to avoid
|
||||
|
|
|
@ -110,7 +110,8 @@ grub_net_arp_send_request (struct grub_net_network_level_interface *inf,
|
|||
return GRUB_ERR_NONE;
|
||||
pending_req = proto_addr->ipv4;
|
||||
have_pending = 0;
|
||||
grub_net_poll_cards (GRUB_NET_INTERVAL, &have_pending);
|
||||
grub_net_poll_cards (GRUB_NET_INTERVAL + (i * GRUB_NET_INTERVAL_ADDITION),
|
||||
&have_pending);
|
||||
if (grub_net_link_layer_resolve_check (inf, proto_addr))
|
||||
return GRUB_ERR_NONE;
|
||||
nb.data = nbd;
|
||||
|
|
|
@ -518,7 +518,8 @@ grub_net_icmp6_send_request (struct grub_net_network_level_interface *inf,
|
|||
{
|
||||
if (grub_net_link_layer_resolve_check (inf, proto_addr))
|
||||
break;
|
||||
grub_net_poll_cards (GRUB_NET_INTERVAL, 0);
|
||||
grub_net_poll_cards (GRUB_NET_INTERVAL + (i * GRUB_NET_INTERVAL_ADDITION),
|
||||
0);
|
||||
if (grub_net_link_layer_resolve_check (inf, proto_addr))
|
||||
break;
|
||||
nb->data = nbd;
|
||||
|
|
|
@ -1558,8 +1558,9 @@ grub_net_fs_read_real (grub_file_t file, char *buf, grub_size_t len)
|
|||
if (!net->eof)
|
||||
{
|
||||
try++;
|
||||
grub_net_poll_cards (GRUB_NET_INTERVAL, &net->stall);
|
||||
}
|
||||
grub_net_poll_cards (GRUB_NET_INTERVAL +
|
||||
(try * GRUB_NET_INTERVAL_ADDITION), &net->stall);
|
||||
}
|
||||
else
|
||||
return total;
|
||||
}
|
||||
|
|
|
@ -398,7 +398,8 @@ tftp_open (struct grub_file *file, const char *filename)
|
|||
destroy_pq (data);
|
||||
return err;
|
||||
}
|
||||
grub_net_poll_cards (GRUB_NET_INTERVAL, &data->have_oack);
|
||||
grub_net_poll_cards (GRUB_NET_INTERVAL + (i * GRUB_NET_INTERVAL_ADDITION),
|
||||
&data->have_oack);
|
||||
if (data->have_oack)
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -532,5 +532,6 @@ extern char *grub_net_default_server;
|
|||
|
||||
#define GRUB_NET_TRIES 40
|
||||
#define GRUB_NET_INTERVAL 400
|
||||
#define GRUB_NET_INTERVAL_ADDITION 20
|
||||
|
||||
#endif /* ! GRUB_NET_HEADER */
|
||||
|
|
Loading…
Reference in a new issue