Received: from list by lists.gnu.org with archive (Exim 4.71) id 1aTd50-0002Nm-Uu for mharc-grub-devel@gnu.org; Wed, 10 Feb 2016 17:17:46 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60610) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTd4y-0002LX-JM for grub-devel@gnu.org; Wed, 10 Feb 2016 17:17:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aTd4t-0003lk-JT for grub-devel@gnu.org; Wed, 10 Feb 2016 17:17:44 -0500 Received: from 66-220-144-178.intmgw.facebook.com ([66.220.144.178]:44639 helo=mx-out.facebook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTd4t-0003lf-D4 for grub-devel@gnu.org; Wed, 10 Feb 2016 17:17:39 -0500 Received: from facebook.com (2401:db00:2040:5012:face:0:9:0) by mx-out.facebook.com (10.102.107.99) with ESMTP id 0d127fe0d03c11e597940002c99293a0-ef6fc270 for ; Wed, 10 Feb 2016 13:20:04 -0800 Received: by devbig041.ash4.facebook.com (Postfix, from userid 8730) id 9DE644540A7F; Wed, 10 Feb 2016 13:21:10 -0800 (PST) From: Josef Bacik To: grub-devel@gnu.org, kernel-team@fb.com Subject: [PATCH 07/14] efinet: retransmit if our device is busy Date: Wed, 10 Feb 2016 13:21:01 -0800 Message-Id: <1455139268-3241273-8-git-send-email-jbacik@fb.com> X-Mailer: git-send-email 1.8.1 In-Reply-To: <1455139268-3241273-1-git-send-email-jbacik@fb.com> References: <1455139268-3241273-1-git-send-email-jbacik@fb.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 66.220.144.178 Cc: Josef Bacik 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: Wed, 10 Feb 2016 22:17:45 -0000 When I fixed the txbuf handling I ripped out the retransmission code since it was flooding our network when we had the buggy behavior. Turns out this was too heavy handed as we can still have transient tx timeouts. So instead make sure we retry our transmission once per timeout. This way we can deal with transient transmission problems without flooding the box. This fixes an issue we were seeing in production. Thanks, Signed-off-by: Josef Bacik --- grub-core/net/drivers/efi/efinet.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c index 692d5ad..c8f80a1 100644 --- a/grub-core/net/drivers/efi/efinet.c +++ b/grub-core/net/drivers/efi/efinet.c @@ -38,6 +38,7 @@ send_card_buffer (struct grub_net_card *dev, grub_efi_simple_network_t *net = dev->efi_net; grub_uint64_t limit_time = grub_get_time_ms () + 4000; void *txbuf; + int retry = 0; if (dev->txbusy) while (1) @@ -60,6 +61,15 @@ send_card_buffer (struct grub_net_card *dev, dev->txbusy = 0; break; } + if (!retry) + { + st = efi_call_7 (net->transmit, net, 0, dev->last_pkt_size, + dev->txbuf, NULL, NULL, NULL); + if (st != GRUB_EFI_SUCCESS) + return grub_error (GRUB_ERR_IO, + N_("couldn't send network packet")); + retry = 1; + } if (limit_time < grub_get_time_ms ()) return grub_error (GRUB_ERR_TIMEOUT, N_("couldn't send network packet")); -- 1.8.1