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

6b3c76
From 734177c57499142bbdad947e8671cf1fbf4285ad 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
6b3c76
Subject: [PATCH 037/261] 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
---
6b3c76
 ChangeLog             | 9 +++++++++
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 +
a85e8e
 6 files changed, 19 insertions(+), 5 deletions(-)
a85e8e
6b3c76
diff --git a/ChangeLog b/ChangeLog
6b3c76
index f69d8c7e0..f5618a6eb 100644
6b3c76
--- a/ChangeLog
6b3c76
+++ b/ChangeLog
6b3c76
@@ -1,5 +1,14 @@
6b3c76
 2014-01-21  Paulo Flabiano Smorigo  <pfsmorigo@br.ibm.com>
6b3c76
 
6b3c76
+	* grub-core/net/arp.c (grub_net_arp_send_request): Increase network try
6b3c76
+	interval gradually.
6b3c76
+	* grub-core/net/icmp6.c (grub_net_icmp6_send_request): Likewise.
6b3c76
+	* grub-core/net/net.c (grub_net_fs_read_real): Likewise.
6b3c76
+	* grub-core/net/tftp.c (tftp_open): Likewise.
6b3c76
+	* include/grub/net.h (GRUB_NET_INTERVAL_ADDITION): New define.
6b3c76
+
6b3c76
+2014-01-21  Paulo Flabiano Smorigo  <pfsmorigo@br.ibm.com>
6b3c76
+
6b3c76
 	* grub-core/net/net.c (receive_packets): Change stop condition to avoid
6b3c76
 	infinite loops.
6b3c76
 
a85e8e
diff --git a/grub-core/net/arp.c b/grub-core/net/arp.c
6b3c76
index e92c7e7da..d62d0cc1e 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
6b3c76
index 2741e6f11..bbc902014 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
6b3c76
index 56355f3c9..1521d8d2c 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
6b3c76
index 9c489f1fc..517361427 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
6b3c76
index de6259ee1..0e0a605c5 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 */
6b3c76
-- 
6b3c76
2.13.5
6b3c76