From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1W5KXn-0005Ab-FP for mharc-grub-devel@gnu.org; Mon, 20 Jan 2014 14:29:59 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47675) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W5KXd-0004yW-1A for grub-devel@gnu.org; Mon, 20 Jan 2014 14:29:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W5KXU-00047c-2w for grub-devel@gnu.org; Mon, 20 Jan 2014 14:29:48 -0500 Received: from e24smtp01.br.ibm.com ([32.104.18.85]:58645) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W5KXT-00047K-NN for grub-devel@gnu.org; Mon, 20 Jan 2014 14:29:40 -0500 Received: from /spool/local by e24smtp01.br.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 20 Jan 2014 17:29:36 -0200 Received: from d24dlp01.br.ibm.com (9.18.248.204) by e24smtp01.br.ibm.com (10.172.0.143) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 20 Jan 2014 17:29:35 -0200 Received: from d24relay02.br.ibm.com (d24relay02.br.ibm.com [9.13.184.26]) by d24dlp01.br.ibm.com (Postfix) with ESMTP id 54F593520064 for ; Mon, 20 Jan 2014 14:29:33 -0500 (EST) Received: from d24av05.br.ibm.com (d24av05.br.ibm.com [9.18.232.44]) by d24relay02.br.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s0KJSxfD20447268 for ; Mon, 20 Jan 2014 17:29:00 -0200 Received: from d24av05.br.ibm.com (localhost [127.0.0.1]) by d24av05.br.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s0KJTOGM012030 for ; Mon, 20 Jan 2014 14:29:24 -0500 Received: from beren.lan ([9.78.137.63]) by d24av05.br.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id s0KJT9Pq011306 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 20 Jan 2014 14:29:22 -0500 Date: Mon, 20 Jan 2014 17:29:09 -0200 From: Paulo Flabiano Smorigo To: grub-devel@gnu.org Subject: [PATCH] increase network try interval gradually Message-ID: <20140120192907.GA18265@beren.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/null+5621 (d3096e8796e7) (2012-12-30) X-TM-AS-MML: No X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14012019-1524-0000-0000-0000089471D4 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 32.104.18.85 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jan 2014 19:29:58 -0000 Hi all, This patch changes GRUB net interval gradually over time to avoid timeout problems. I'm currently doing tests in a network with heavy traffic. In this network GRUB fails with the original timeout value. --- 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 + 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/grub-core/net/arp.c b/grub-core/net/arp.c index 3076b18..248bd4b 100644 --- a/grub-core/net/arp.c +++ b/grub-core/net/arp.c @@ -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; diff --git a/grub-core/net/icmp6.c b/grub-core/net/icmp6.c index 2741e6f..bbc9020 100644 --- a/grub-core/net/icmp6.c +++ b/grub-core/net/icmp6.c @@ -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; diff --git a/grub-core/net/net.c b/grub-core/net/net.c index 8f9d183..683ab28 100644 --- a/grub-core/net/net.c +++ b/grub-core/net/net.c @@ -1596,8 +1596,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; } diff --git a/grub-core/net/tftp.c b/grub-core/net/tftp.c index 9c489f1..5173614 100644 --- a/grub-core/net/tftp.c +++ b/grub-core/net/tftp.c @@ -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; } diff --git a/include/grub/net.h b/include/grub/net.h index 843f74f..538baa3 100644 --- a/include/grub/net.h +++ b/include/grub/net.h @@ -536,5 +536,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 */ -- 1.8.2.1 -- Paulo Flabiano Smorigo IBM Linux Technology Center