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

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