grub-devel.gnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] fix ipv6 support
@ 2015-08-05 17:50 Josef Bacik
  2015-08-05 17:50 ` [PATCH 1/3] efinet: handle get_status() properly Josef Bacik
                   ` (3 more replies)
  0 siblings, 4 replies; 16+ messages in thread
From: Josef Bacik @ 2015-08-05 17:50 UTC (permalink / raw)
  To: grub-devel, mchang, pjones, kernel-team

These patches are on top of Michael Chang's bootp6 code (which we also really
need so it would be great if those could go in as well).  At Facebook we have
ipv6 only clusters that we need to be able to provision over the network.  The
current grub2 support for ipv6 is broken in a few ways.  The routing stuff
needed to be reworked to handle talking to an ipv6 router properly.  I tried to
not change the code too much in order to make sure I didn't regress the ipv4
support.

There is also a patch for the efinet driver, without it we are unable to do any
networking with our UEFI boxes.

I'd appreciate reviews on these patches, this is my first foray into grub2.
Facebook is going to be replacing ipxe with grub2 and so we are dedicated to
getting grub2 into shape in order to be used to do network based provisioning
well.  Thanks,

Josef


^ permalink raw reply	[flat|nested] 16+ messages in thread
* [PATCH 1/3] efinet: handle get_status() properly
@ 2015-08-05 18:36 Josef Bacik
  2015-08-05 20:04 ` Andrei Borzenkov
  0 siblings, 1 reply; 16+ messages in thread
From: Josef Bacik @ 2015-08-05 18:36 UTC (permalink / raw)
  To: grub-devel, mchang, pjones

The EFI SNP documentation isn't super clear on the value that is returned in
txbuf when calling into GetStatus.  The documentation says its the pointer to
the recycle buffer, but the documentation for Transmit() says that it should be
the pointer to the buffer that we transmitted.  On the boxes I'm using it's just
a random pointer (usually 0x1).  It is definitely transmitting stuff, but the
get_status call is not returning the pointer to the txbuf we passed in.  Looking
at a few EFI implementations and other SNP drivers it seems like there is
confusion everywhere on this.  So since we only transmit one buffer at a time,
just assume that a non-NULL txbuf means that our transmit happened properly.
With this patch I can now do networking on our EFI enabled boxes.  Thanks,

cc: Peter Jones <pjones@redhat.com>
Signed-off-by: Josef Bacik <jbacik@fb.com>
---
 grub-core/net/drivers/efi/efinet.c | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c
index f27a117..4d3f8aa 100644
--- a/grub-core/net/drivers/efi/efinet.c
+++ b/grub-core/net/drivers/efi/efinet.c
@@ -47,19 +47,11 @@ send_card_buffer (struct grub_net_card *dev,
 	if (st != GRUB_EFI_SUCCESS)
 	  return grub_error (GRUB_ERR_IO,
 			     N_("couldn't send network packet"));
-	if (txbuf == dev->txbuf)
+	if (txbuf)
 	  {
 	    dev->txbusy = 0;
 	    break;
 	  }
-	if (txbuf)
-	  {
-	    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"));
-	  }
 	if (limit_time < grub_get_time_ms ())
 	  return grub_error (GRUB_ERR_TIMEOUT,
 			     N_("couldn't send network packet"));
@@ -84,8 +76,9 @@ send_card_buffer (struct grub_net_card *dev,
      we run in the GRUB_ERR_TIMEOUT case above.
      Perhaps a timeout in the FW has discarded the recycle buffer.
    */
+  txbuf = NULL;
   st = efi_call_3 (net->get_status, net, 0, &txbuf);
-  dev->txbusy = !(st == GRUB_EFI_SUCCESS && txbuf == dev->txbuf);
+  dev->txbusy = !(st == GRUB_EFI_SUCCESS && txbuf);
 
   return GRUB_ERR_NONE;
 }
-- 
2.1.0



^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2015-08-06 14:26 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-05 17:50 [PATCH 0/3] fix ipv6 support Josef Bacik
2015-08-05 17:50 ` [PATCH 1/3] efinet: handle get_status() properly Josef Bacik
2015-08-05 17:50 ` [PATCH 2/3] net: add local route when creating link local ipv6 interface Josef Bacik
2015-08-05 17:50 ` [PATCH 3/3] net: fix ipv6 routing Josef Bacik
2015-08-06  4:06 ` [PATCH 0/3] fix ipv6 support Michael Chang
2015-08-06 14:23   ` Josef Bacik
  -- strict thread matches above, loose matches on Subject: below --
2015-08-05 18:36 [PATCH 1/3] efinet: handle get_status() properly Josef Bacik
2015-08-05 20:04 ` Andrei Borzenkov
2015-08-05 20:26   ` Josef Bacik
2015-08-05 20:32     ` Vladimir 'phcoder' Serbinenko
2015-08-05 20:39       ` Josef Bacik
2015-08-05 20:50         ` Josef Bacik
2015-08-05 20:52           ` Vladimir 'phcoder' Serbinenko
2015-08-06  3:42       ` Andrei Borzenkov
2015-08-06 14:26         ` Josef Bacik
2015-08-05 20:57     ` Seth Goldberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).