All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bug fix for efi network
@ 2012-04-29  8:22 Bean
  2012-04-29  8:25 ` Bean
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Bean @ 2012-04-29  8:22 UTC (permalink / raw)
  To: The development of GRUB 2

[-- Attachment #1: Type: text/plain, Size: 455 bytes --]

Hi,

This patch fix a few bugs in efinet.

It also change the tftp block size from 1024 to 8192, which would
result in HUGE speed difference. In my previous testing, the larger
the block size, the faster the speed. It can reach up to 60-70MB/s in
1Gb ethernet when block size is about 60K, therefore it would be a
good idea to allow user to configure this parameter. The native tftp
service in UEFI use a default block size of 8192.

-- 
Best wishes
Bean

[-- Attachment #2: efinet.txt --]
[-- Type: text/plain, Size: 1189 bytes --]

=== modified file 'grub-core/net/drivers/efi/efinet.c'
--- grub-core/net/drivers/efi/efinet.c	2012-03-10 19:41:28 +0000
+++ grub-core/net/drivers/efi/efinet.c	2012-04-29 08:12:12 +0000
@@ -63,14 +63,13 @@
   grub_efi_uintn_t bufsize = 1536;
   struct grub_net_buff *nb;
 
-  nb = grub_netbuff_alloc (bufsize);
+  nb = grub_netbuff_alloc (bufsize + 2);
   if (!nb)
     return NULL;
 
   /* Reserve 2 bytes so that 2 + 14/18 bytes of ethernet header is divisible
      by 4. So that IP header is aligned on 4 bytes. */
-  grub_netbuff_reserve (nb, 2);
-  if (!nb)
+  if (grub_netbuff_reserve (nb, 2))
     {
       grub_netbuff_free (nb);
       return NULL;

=== modified file 'grub-core/net/tftp.c'
--- grub-core/net/tftp.c	2012-02-12 18:11:06 +0000
+++ grub-core/net/tftp.c	2012-04-29 08:10:29 +0000
@@ -320,9 +320,9 @@
   rrqlen += grub_strlen ("blksize") + 1;
   rrq += grub_strlen ("blksize") + 1;
 
-  grub_strcpy (rrq, "1024");
-  rrqlen += grub_strlen ("1024") + 1;
-  rrq += grub_strlen ("1024") + 1;
+  grub_strcpy (rrq, "8192");
+  rrqlen += grub_strlen ("8192") + 1;
+  rrq += grub_strlen ("8192") + 1;
 
   grub_strcpy (rrq, "tsize");
   rrqlen += grub_strlen ("tsize") + 1;


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

end of thread, other threads:[~2012-05-03 17:24 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-29  8:22 [PATCH] bug fix for efi network Bean
2012-04-29  8:25 ` Bean
2012-04-29 15:05 ` Bean
2012-05-03 15:38   ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-05-03 17:24     ` Bean
2012-04-29 16:41 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-04-29 18:19   ` Bean
2012-05-03 15:34     ` Vladimir 'φ-coder/phcoder' Serbinenko

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.