File 0001-increase-network-try-interval-gradually.patch of Package grub2.4793

From 6f65e36cc4f92fe40672181eccf12eac4afb6738 Mon Sep 17 00:00:00 2001
From: Paulo Flabiano Smorigo <pfsmorigo@br.ibm.com>
Date: Tue, 21 Jan 2014 11:03:51 -0200
Subject: [PATCH] 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.
---
 ChangeLog             | 9 +++++++++
 grub-core/net/arp.c   | 3 ++-
 grub-core/net/icmp6.c | 3 ++-
 grub-core/net/net.c   | 5 +++--
 grub-core/net/tftp.c  | 3 ++-
 include/grub/net.h    | 1 +
 6 files changed, 19 insertions(+), 5 deletions(-)

Index: grub-2.02~beta2/grub-core/net/arp.c
===================================================================
--- grub-2.02~beta2.orig/grub-core/net/arp.c
+++ grub-2.02~beta2/grub-core/net/arp.c
@@ -110,7 +110,8 @@ grub_net_arp_send_request (struct grub_n
 	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;
Index: grub-2.02~beta2/grub-core/net/icmp6.c
===================================================================
--- grub-2.02~beta2.orig/grub-core/net/icmp6.c
+++ grub-2.02~beta2/grub-core/net/icmp6.c
@@ -518,7 +518,8 @@ grub_net_icmp6_send_request (struct grub
     {
       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;
Index: grub-2.02~beta2/grub-core/net/net.c
===================================================================
--- grub-2.02~beta2.orig/grub-core/net/net.c
+++ grub-2.02~beta2/grub-core/net/net.c
@@ -1558,8 +1558,9 @@ grub_net_fs_read_real (grub_file_t file,
       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;
     }
Index: grub-2.02~beta2/grub-core/net/tftp.c
===================================================================
--- grub-2.02~beta2.orig/grub-core/net/tftp.c
+++ grub-2.02~beta2/grub-core/net/tftp.c
@@ -398,7 +398,8 @@ tftp_open (struct grub_file *file, const
 	  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;
     }
Index: grub-2.02~beta2/include/grub/net.h
===================================================================
--- grub-2.02~beta2.orig/include/grub/net.h
+++ grub-2.02~beta2/include/grub/net.h
@@ -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 */