All of lore.kernel.org
 help / color / mirror / Atom feed
From: Josef Bacik <jbacik@fb.com>
To: grub-devel@gnu.org, kernel-team@fb.com
Cc: Josef Bacik <jbacik@fb.com>
Subject: [PATCH 07/14] efinet: retransmit if our device is busy
Date: Wed, 10 Feb 2016 13:21:01 -0800	[thread overview]
Message-ID: <1455139268-3241273-8-git-send-email-jbacik@fb.com> (raw)
In-Reply-To: <1455139268-3241273-1-git-send-email-jbacik@fb.com>

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 <jbacik@fb.com>
---
 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



  parent reply	other threads:[~2016-02-10 22:17 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-10 21:20 [PATCH 00/14] Facebook's netbooting patches Josef Bacik
2016-02-10 21:20 ` [PATCH 01/14] Added net_bootp6 command Josef Bacik
2016-02-10 21:20 ` [PATCH 02/14] UEFI IPv6 PXE support Josef Bacik
2016-02-10 21:20 ` [PATCH 03/14] Use UEFI MAC device as default configured by net_bootp6 Josef Bacik
2016-02-10 21:20 ` [PATCH 04/14] tcp: add window scaling and RTTM support Josef Bacik
2016-02-10 21:20 ` [PATCH 05/14] net: don't free uninitialized sockets in dns Josef Bacik
2016-02-13 17:59   ` Andrei Borzenkov
2016-02-16 16:13     ` Josef Bacik
2016-02-10 21:21 ` [PATCH 06/14] net: fix ipv6 routing Josef Bacik
2016-02-25 19:39   ` Andrei Borzenkov
2016-02-10 21:21 ` Josef Bacik [this message]
2016-02-10 21:21 ` [PATCH 08/14] efinet: filter multicast traffic based on addresses Josef Bacik
2016-02-10 21:21 ` [PATCH 09/14] efinet: clear the txbuffer before modifying the receive filters Josef Bacik
2016-02-10 21:21 ` [PATCH 10/14] dns: poll card between each dns request Josef Bacik
2016-02-15  6:45   ` Andrei Borzenkov
2016-02-16 16:16     ` Josef Bacik
2016-02-23 22:02     ` Josef Bacik
2016-02-24  3:25       ` Andrei Borzenkov
2016-02-10 21:21 ` [PATCH 11/14] dns: reset data->naddresses for every packet we receive Josef Bacik
2016-02-13 16:05   ` Andrei Borzenkov
2016-02-16 16:18     ` Josef Bacik
2016-02-10 21:21 ` [PATCH 12/14] icmp6: use default interface as the route interface Josef Bacik
2016-02-10 21:21 ` [PATCH 13/14] bootp: don't add multiple interfaces for the same address Josef Bacik
2016-02-10 21:21 ` [PATCH 14/14] net: add interfaces when we open a card Josef Bacik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1455139268-3241273-8-git-send-email-jbacik@fb.com \
    --to=jbacik@fb.com \
    --cc=grub-devel@gnu.org \
    --cc=kernel-team@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.