From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1ZaRVm-0003hg-W6 for mharc-grub-devel@gnu.org; Fri, 11 Sep 2015 12:49:19 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45039) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZaRVk-0003gy-4Y for grub-devel@gnu.org; Fri, 11 Sep 2015 12:49:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZaRVf-0002Sk-1n for grub-devel@gnu.org; Fri, 11 Sep 2015 12:49:16 -0400 Received: from mail-lb0-x22a.google.com ([2a00:1450:4010:c04::22a]:33617) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZaRVe-0002Se-Qf for grub-devel@gnu.org; Fri, 11 Sep 2015 12:49:10 -0400 Received: by lbcjc2 with SMTP id jc2so42736044lbc.0 for ; Fri, 11 Sep 2015 09:49:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type:content-transfer-encoding; bh=6S9zEQ9uC/EncRuRIJkm4nEqsUtCJNfjyLTGprxGVGU=; b=UyRf5vuogxlKGYzMqjQImiJBlMQth9F7fSIZDnje6EEXLRZeDUmg1MtV+/Rr8eTzOK MF+KHsk036iXxiDc/nMrHqOHNz26tIZGznIpppG06ggMDGIBP278+xqt+P39NPclvRzs u4s92SNzU8kusoxH3eBR04xoUM7s/O+s08MAm3DkcVSMCLATIxFoM37usmJNxNg7lPj/ JciiVCoWYF13sWTpH/SopiCmLhqVdr44tBrfmWbtYxvpO9mYVSWr92y1ciYguwMnmqNk K/PVaPu5+1JktvJNnaWVc1lnMUFFwQWvAMl9IENVgSNt2izuj1fCosaWjj2SyunNcSKe bIoQ== X-Received: by 10.152.20.134 with SMTP id n6mr43233504lae.108.1441990149974; Fri, 11 Sep 2015 09:49:09 -0700 (PDT) Received: from [192.168.1.43] (ppp91-76-134-130.pppoe.mtu-net.ru. [91.76.134.130]) by smtp.gmail.com with ESMTPSA id qu6sm166596lbb.27.2015.09.11.09.49.08 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 Sep 2015 09:49:09 -0700 (PDT) Subject: Re: [PATCH] efinet: retransmit if our device is busy To: The development of GNU GRUB , kernel-team@fb.com References: <1441042475-4916-1-git-send-email-jbacik@fb.com> From: Andrei Borzenkov Message-ID: <55F30604.90202@gmail.com> Date: Fri, 11 Sep 2015 19:49:08 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <1441042475-4916-1-git-send-email-jbacik@fb.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c04::22a 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: Fri, 11 Sep 2015 16:49:17 -0000 31.08.2015 20:34, Josef Bacik пишет: > 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, > You mean you get timeout in efi send_card_buffer, not higher level? That sounds like something steals completion status. Could you send lsefi after network interface was opened? > 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")); >