Blame SOURCES/0183-efinet-retransmit-if-our-device-is-busy.patch

6b3c76
From 1b9767c1360827639927ab9bd337d1344d3b2d68 Mon Sep 17 00:00:00 2001
a85e8e
From: Josef Bacik <jbacik@fb.com>
a85e8e
Date: Mon, 31 Aug 2015 13:34:35 -0400
6b3c76
Subject: [PATCH 183/261] efinet: retransmit if our device is busy
a85e8e
a85e8e
When I fixed the txbuf handling I ripped out the retransmission code since it
a85e8e
was flooding our network when we had the buggy behavior.  Turns out this was too
a85e8e
heavy handed as we can still have transient tx timeouts.  So instead make sure
a85e8e
we retry our transmission once per timeout.  This way we can deal with transient
a85e8e
transmission problems without flooding the box.  This fixes an issue we were
a85e8e
seeing in production.  Thanks,
a85e8e
a85e8e
Signed-off-by: Josef Bacik <jbacik@fb.com>
a85e8e
---
a85e8e
 grub-core/net/drivers/efi/efinet.c | 10 ++++++++++
a85e8e
 1 file changed, 10 insertions(+)
a85e8e
a85e8e
diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c
6b3c76
index ea0e0ca36..c3a128cd1 100644
a85e8e
--- a/grub-core/net/drivers/efi/efinet.c
a85e8e
+++ b/grub-core/net/drivers/efi/efinet.c
a85e8e
@@ -38,6 +38,7 @@ send_card_buffer (struct grub_net_card *dev,
a85e8e
   grub_efi_simple_network_t *net = dev->efi_net;
a85e8e
   grub_uint64_t limit_time = grub_get_time_ms () + 4000;
a85e8e
   void *txbuf;
a85e8e
+  int retry = 0;
a85e8e
 
a85e8e
   if (dev->txbusy)
a85e8e
     while (1)
a85e8e
@@ -60,6 +61,15 @@ send_card_buffer (struct grub_net_card *dev,
a85e8e
 	    dev->txbusy = 0;
a85e8e
 	    break;
a85e8e
 	  }
a85e8e
+	if (!retry)
a85e8e
+	  {
a85e8e
+	    st = efi_call_7 (net->transmit, net, 0, dev->last_pkt_size,
a85e8e
+			     dev->txbuf, NULL, NULL, NULL);
a85e8e
+	    if (st != GRUB_EFI_SUCCESS)
a85e8e
+	      return grub_error (GRUB_ERR_IO,
a85e8e
+				 N_("couldn't send network packet"));
a85e8e
+	    retry = 1;
a85e8e
+	  }
a85e8e
 	if (limit_time < grub_get_time_ms ())
a85e8e
 	  return grub_error (GRUB_ERR_TIMEOUT,
a85e8e
 			     N_("couldn't send network packet"));
6b3c76
-- 
6b3c76
2.13.5
6b3c76