Blame SOURCES/0037-increase-network-try-interval-gradually.patch

d41074
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
a85e8e
From: Paulo Flabiano Smorigo <pfsmorigo@br.ibm.com>
a85e8e
Date: Tue, 21 Jan 2014 11:03:51 -0200
d41074
Subject: [PATCH] increase network try interval gradually
a85e8e
a85e8e
* grub-core/net/arp.c (grub_net_arp_send_request): Increase network try
a85e8e
interval gradually.
a85e8e
* grub-core/net/icmp6.c (grub_net_icmp6_send_request): Likewise.
a85e8e
* grub-core/net/net.c (grub_net_fs_read_real): Likewise.
a85e8e
* grub-core/net/tftp.c (tftp_open): Likewise.
a85e8e
* include/grub/net.h (GRUB_NET_INTERVAL_ADDITION): New define.
a85e8e
---
a85e8e
 grub-core/net/arp.c   | 3 ++-
a85e8e
 grub-core/net/icmp6.c | 3 ++-
a85e8e
 grub-core/net/net.c   | 5 +++--
a85e8e
 grub-core/net/tftp.c  | 3 ++-
a85e8e
 include/grub/net.h    | 1 +
d41074
 ChangeLog             | 9 +++++++++
a85e8e
 6 files changed, 19 insertions(+), 5 deletions(-)
a85e8e
a85e8e
diff --git a/grub-core/net/arp.c b/grub-core/net/arp.c
d41074
index e92c7e7daec..d62d0cc1e01 100644
a85e8e
--- a/grub-core/net/arp.c
a85e8e
+++ b/grub-core/net/arp.c
a85e8e
@@ -110,7 +110,8 @@ grub_net_arp_send_request (struct grub_net_network_level_interface *inf,
a85e8e
 	return GRUB_ERR_NONE;
a85e8e
       pending_req = proto_addr->ipv4;
a85e8e
       have_pending = 0;
a85e8e
-      grub_net_poll_cards (GRUB_NET_INTERVAL, &have_pending);
a85e8e
+      grub_net_poll_cards (GRUB_NET_INTERVAL + (i * GRUB_NET_INTERVAL_ADDITION),
a85e8e
+                           &have_pending);
a85e8e
       if (grub_net_link_layer_resolve_check (inf, proto_addr))
a85e8e
 	return GRUB_ERR_NONE;
a85e8e
       nb.data = nbd;
a85e8e
diff --git a/grub-core/net/icmp6.c b/grub-core/net/icmp6.c
d41074
index 2741e6f11fb..bbc902014fe 100644
a85e8e
--- a/grub-core/net/icmp6.c
a85e8e
+++ b/grub-core/net/icmp6.c
a85e8e
@@ -518,7 +518,8 @@ grub_net_icmp6_send_request (struct grub_net_network_level_interface *inf,
a85e8e
     {
a85e8e
       if (grub_net_link_layer_resolve_check (inf, proto_addr))
a85e8e
 	break;
a85e8e
-      grub_net_poll_cards (GRUB_NET_INTERVAL, 0);
a85e8e
+      grub_net_poll_cards (GRUB_NET_INTERVAL + (i * GRUB_NET_INTERVAL_ADDITION),
a85e8e
+                           0);
a85e8e
       if (grub_net_link_layer_resolve_check (inf, proto_addr))
a85e8e
 	break;
a85e8e
       nb->data = nbd;
a85e8e
diff --git a/grub-core/net/net.c b/grub-core/net/net.c
d41074
index 56355f3c98c..1521d8d2c87 100644
a85e8e
--- a/grub-core/net/net.c
a85e8e
+++ b/grub-core/net/net.c
a85e8e
@@ -1558,8 +1558,9 @@ grub_net_fs_read_real (grub_file_t file, char *buf, grub_size_t len)
a85e8e
       if (!net->eof)
a85e8e
 	{
a85e8e
 	  try++;
a85e8e
-	  grub_net_poll_cards (GRUB_NET_INTERVAL, &net->stall);
a85e8e
-	}
a85e8e
+	  grub_net_poll_cards (GRUB_NET_INTERVAL +
a85e8e
+                               (try * GRUB_NET_INTERVAL_ADDITION), &net->stall);
a85e8e
+        }
a85e8e
       else
a85e8e
 	return total;
a85e8e
     }
a85e8e
diff --git a/grub-core/net/tftp.c b/grub-core/net/tftp.c
d41074
index 9c489f1fc94..51736142764 100644
a85e8e
--- a/grub-core/net/tftp.c
a85e8e
+++ b/grub-core/net/tftp.c
a85e8e
@@ -398,7 +398,8 @@ tftp_open (struct grub_file *file, const char *filename)
a85e8e
 	  destroy_pq (data);
a85e8e
 	  return err;
a85e8e
 	}
a85e8e
-      grub_net_poll_cards (GRUB_NET_INTERVAL, &data->have_oack);
a85e8e
+      grub_net_poll_cards (GRUB_NET_INTERVAL + (i * GRUB_NET_INTERVAL_ADDITION),
a85e8e
+                           &data->have_oack);
a85e8e
       if (data->have_oack)
a85e8e
 	break;
a85e8e
     }
a85e8e
diff --git a/include/grub/net.h b/include/grub/net.h
d41074
index de6259ee1a0..0e0a605c5a6 100644
a85e8e
--- a/include/grub/net.h
a85e8e
+++ b/include/grub/net.h
a85e8e
@@ -532,5 +532,6 @@ extern char *grub_net_default_server;
a85e8e
 
a85e8e
 #define GRUB_NET_TRIES 40
a85e8e
 #define GRUB_NET_INTERVAL 400
a85e8e
+#define GRUB_NET_INTERVAL_ADDITION 20
a85e8e
 
a85e8e
 #endif /* ! GRUB_NET_HEADER */
d41074
diff --git a/ChangeLog b/ChangeLog
d41074
index f69d8c7e042..f5618a6eb70 100644
d41074
--- a/ChangeLog
d41074
+++ b/ChangeLog
d41074
@@ -1,3 +1,12 @@
d41074
+2014-01-21  Paulo Flabiano Smorigo  <pfsmorigo@br.ibm.com>
d41074
+
d41074
+	* grub-core/net/arp.c (grub_net_arp_send_request): Increase network try
d41074
+	interval gradually.
d41074
+	* grub-core/net/icmp6.c (grub_net_icmp6_send_request): Likewise.
d41074
+	* grub-core/net/net.c (grub_net_fs_read_real): Likewise.
d41074
+	* grub-core/net/tftp.c (tftp_open): Likewise.
d41074
+	* include/grub/net.h (GRUB_NET_INTERVAL_ADDITION): New define.
d41074
+
d41074
 2014-01-21  Paulo Flabiano Smorigo  <pfsmorigo@br.ibm.com>
d41074
 
d41074
 	* grub-core/net/net.c (receive_packets): Change stop condition to avoid