Received: from list by lists.gnu.org with archive (Exim 4.71) id 1ZWSym-00016c-7G for mharc-grub-devel@gnu.org; Mon, 31 Aug 2015 13:34:48 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45214) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWSyj-00015S-Rd for grub-devel@gnu.org; Mon, 31 Aug 2015 13:34:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZWSyg-00071f-HT for grub-devel@gnu.org; Mon, 31 Aug 2015 13:34:45 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:37443) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWSyg-0006zK-A7 for grub-devel@gnu.org; Mon, 31 Aug 2015 13:34:42 -0400 Received: from pps.filterd (m0044012 [127.0.0.1]) by mx0a-00082601.pphosted.com (8.14.5/8.14.5) with SMTP id t7VHWAPr019561 for ; Mon, 31 Aug 2015 10:34:40 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fb.com; h=from : to : subject : date : message-id : mime-version : content-type; s=facebook; bh=ZpOxfRyIiGj/XHUJYse4GCrj4NknYfJ5g++uUcLyi58=; b=L5uJcCoP/u3fmf9YytCxgPS7SWe6ABB9O+goZdg5fYssAVkXQLAFNrJI7CYhRxJK4X84 pBDDyhCtjdNlecuimGxuC/ISvd+S9n+b4dII40sWloZxUIgQCcOHv1t+jCBTr4ypEb6U OHVl2ETMvQoEJTxV5O28j0wXNvfgi0DZf3U= Received: from mail.thefacebook.com ([199.201.64.23]) by mx0a-00082601.pphosted.com with ESMTP id 1wmqta8gnw-1 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT) for ; Mon, 31 Aug 2015 10:34:40 -0700 Received: from localhost (192.168.52.123) by mail.TheFacebook.com (192.168.16.17) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 31 Aug 2015 10:34:35 -0700 From: Josef Bacik To: , Subject: [PATCH] efinet: retransmit if our device is busy Date: Mon, 31 Aug 2015 13:34:35 -0400 Message-ID: <1441042475-4916-1-git-send-email-jbacik@fb.com> X-Mailer: git-send-email 2.1.0 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [192.168.52.123] X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.14.151, 1.0.33, 0.0.0000 definitions=2015-08-31_02:2015-08-31, 2015-08-31, 1970-01-01 signatures=0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x X-Received-From: 67.231.145.42 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, 31 Aug 2015 17:34:46 -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")); -- 2.1.0