[PATCH 2.6.21.1] nfs-root: added possibility to override default MTU (for UDP jumbo frames)

2007-07-02 Thread manio
To use a NFS-root for UDP jumbo frames the kernel on the client need to bring
up interface with MTU set to 9000 bytes - otherwise it cannot contact server
with jumbo frames enabled (nfs server not responding, still trying) and cannot
boot. Added a kernel parameter named 'ipmtu' which can be used to specify
initial MTU size when booting via nfsroot.

Signed-off-by: Mariusz Bialonczyk [EMAIL PROTECTED]

diff -Nru linux-2.6.21.1-orig/Documentation/kernel-parameters.txt 
linux-2.6.21.1/Documentation/kernel-parameters.txt
--- linux-2.6.21.1-orig/Documentation/kernel-parameters.txt 2007-04-27 
23:49:26.0 +0200
+++ linux-2.6.21.1/Documentation/kernel-parameters.txt  2007-07-01 
18:47:11.0 +0200
@@ -720,6 +720,9 @@
ip2=[HW] Set IO/IRQ pairs for up to 4 IntelliPort boards
See comment before ip2_setup() in drivers/char/ip2.c.
 
+   ipmtu=  [IP_PNP]
+   See Documentation/nfsroot.txt.
+
ips=[HW,SCSI] Adaptec / IBM ServeRAID controller
See header of drivers/scsi/ips.c.
 
diff -Nru linux-2.6.21.1-orig/Documentation/nfsroot.txt 
linux-2.6.21.1/Documentation/nfsroot.txt
--- linux-2.6.21.1-orig/Documentation/nfsroot.txt   2007-04-27 
23:49:26.0 +0200
+++ linux-2.6.21.1/Documentation/nfsroot.txt2007-07-01 19:02:40.0 
+0200
@@ -153,6 +153,16 @@
 Default: any
 
 
+ipmtu=mtu_value
+
+  This parameter tells the kernel to override default MTU size to specified
+  mtu_value. Useful in cases where NFS server have jumbo frames enabled and
+  client can't connect via UDP because of default MTU value (in ethernet
+  usually 1500 bytes). With this option before bringing interface up, kernel
+  will set the passed MTU size. In case of NFS-root booting server and client
+  can use UDP jumbo frames (NFS's rsize and wsize set to 8192 for instance).
+
+
 
 
 3.) Boot Loader
diff -Nru linux-2.6.21.1-orig/net/ipv4/ipconfig.c 
linux-2.6.21.1/net/ipv4/ipconfig.c
--- linux-2.6.21.1-orig/net/ipv4/ipconfig.c 2007-04-27 23:49:26.0 
+0200
+++ linux-2.6.21.1/net/ipv4/ipconfig.c  2007-07-01 15:44:44.0 +0200
@@ -113,6 +113,8 @@
  */
 int ic_set_manually __initdata = 0;/* IPconfig parameters set 
manually */
 
+unsigned int ic_mtu __initdata = 0;/* IPconfig MTU parameter: 0 - 
defaults, other - override */
+
 static int ic_enable __initdata = 0;   /* IP config enabled? */
 
 /* Protocol choice */
@@ -209,6 +211,11 @@
able = ic_proto_enabled;
if (ic_proto_enabled  !able)
continue;
+   if (ic_mtu  0)
+   {
+   printk(KERN_ERR IP-Config: Overriding %s MTU 
to %d bytes\n, dev-name, ic_mtu);
+   dev-mtu = ic_mtu;
+   }
oflags = dev-flags;
if (dev_change_flags(dev, oflags | IFF_UP)  0) {
printk(KERN_ERR IP-Config: Failed to open 
%s\n, dev-name);
@@ -1506,5 +1513,14 @@
return ip_auto_config_setup(addrs);
 }
 
+static int __init mtu_config_setup(char *str)
+{
+   if (!str)
+   return 0;
+   ic_mtu = simple_strtoul(str, str, 0);
+   return 1;
+}
+
 __setup(ip=, ip_auto_config_setup);
+__setup(ipmtu=, mtu_config_setup);
 __setup(nfsaddrs=, nfsaddrs_config_setup);
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2.6.21.1] nfs-root: added possibility to override default MTU (for UDP jumbo frames)

2007-07-02 Thread Peter Staubach

[EMAIL PROTECTED] wrote:

To use a NFS-root for UDP jumbo frames the kernel on the client need to bring
up interface with MTU set to 9000 bytes - otherwise it cannot contact server
with jumbo frames enabled (nfs server not responding, still trying) and cannot
boot. Added a kernel parameter named 'ipmtu' which can be used to specify
initial MTU size when booting via nfsroot.

  


Could you describe the problem better, please?  Something does not
sound right.  Both ends need to have jumbo frames enabled in order
to use jumbo frames, but if one end or the other does not, the systems
still should be able to exchange packets using normal sized ethernet
packets.  Isn't this a problem that mtu discovery should handle?

   Thanx...

  ps


Signed-off-by: Mariusz Bialonczyk [EMAIL PROTECTED]

diff -Nru linux-2.6.21.1-orig/Documentation/kernel-parameters.txt 
linux-2.6.21.1/Documentation/kernel-parameters.txt
--- linux-2.6.21.1-orig/Documentation/kernel-parameters.txt 2007-04-27 
23:49:26.0 +0200
+++ linux-2.6.21.1/Documentation/kernel-parameters.txt  2007-07-01 
18:47:11.0 +0200
@@ -720,6 +720,9 @@
ip2=[HW] Set IO/IRQ pairs for up to 4 IntelliPort boards
See comment before ip2_setup() in drivers/char/ip2.c.
 
+	ipmtu=		[IP_PNP]

+   See Documentation/nfsroot.txt.
+
ips=[HW,SCSI] Adaptec / IBM ServeRAID controller
See header of drivers/scsi/ips.c.
 
diff -Nru linux-2.6.21.1-orig/Documentation/nfsroot.txt linux-2.6.21.1/Documentation/nfsroot.txt

--- linux-2.6.21.1-orig/Documentation/nfsroot.txt   2007-04-27 
23:49:26.0 +0200
+++ linux-2.6.21.1/Documentation/nfsroot.txt2007-07-01 19:02:40.0 
+0200
@@ -153,6 +153,16 @@
 Default: any
 
 
+ipmtu=mtu_value

+
+  This parameter tells the kernel to override default MTU size to specified
+  mtu_value. Useful in cases where NFS server have jumbo frames enabled and
+  client can't connect via UDP because of default MTU value (in ethernet
+  usually 1500 bytes). With this option before bringing interface up, kernel
+  will set the passed MTU size. In case of NFS-root booting server and client
+  can use UDP jumbo frames (NFS's rsize and wsize set to 8192 for instance).
+
+
 
 
 3.) Boot Loader

diff -Nru linux-2.6.21.1-orig/net/ipv4/ipconfig.c 
linux-2.6.21.1/net/ipv4/ipconfig.c
--- linux-2.6.21.1-orig/net/ipv4/ipconfig.c 2007-04-27 23:49:26.0 
+0200
+++ linux-2.6.21.1/net/ipv4/ipconfig.c  2007-07-01 15:44:44.0 +0200
@@ -113,6 +113,8 @@
  */
 int ic_set_manually __initdata = 0;/* IPconfig parameters set 
manually */
 
+unsigned int ic_mtu __initdata = 0;		/* IPconfig MTU parameter: 0 - defaults, other - override */

+
 static int ic_enable __initdata = 0;   /* IP config enabled? */
 
 /* Protocol choice */

@@ -209,6 +211,11 @@
able = ic_proto_enabled;
if (ic_proto_enabled  !able)
continue;
+   if (ic_mtu  0)
+   {
+   printk(KERN_ERR IP-Config: Overriding %s MTU to %d 
bytes\n, dev-name, ic_mtu);
+   dev-mtu = ic_mtu;
+   }
oflags = dev-flags;
if (dev_change_flags(dev, oflags | IFF_UP)  0) {
printk(KERN_ERR IP-Config: Failed to open %s\n, 
dev-name);
@@ -1506,5 +1513,14 @@
return ip_auto_config_setup(addrs);
 }
 
+static int __init mtu_config_setup(char *str)

+{
+   if (!str)
+   return 0;
+   ic_mtu = simple_strtoul(str, str, 0);
+   return 1;
+}
+
 __setup(ip=, ip_auto_config_setup);
+__setup(ipmtu=, mtu_config_setup);
 __setup(nfsaddrs=, nfsaddrs_config_setup);
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
  


-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2.6.21.1] nfs-root: added possibility to override default MTU (for UDP jumbo frames)

2007-07-02 Thread Krzysztof Halasa
[EMAIL PROTECTED] writes:

 To use a NFS-root for UDP jumbo frames the kernel on the client need to bring
 up interface with MTU set to 9000 bytes - otherwise it cannot contact server
 with jumbo frames enabled (nfs server not responding, still trying) and
 cannot
 boot. Added a kernel parameter named 'ipmtu' which can be used to specify
 initial MTU size when booting via nfsroot.

Isn't the whole IP autoconfig and NFS root set to die?
Why not do it in initramfs?
-- 
Krzysztof Halasa
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2.6.21.1] nfs-root: added possibility to override default MTU (for UDP jumbo frames)

2007-07-02 Thread manio

Peter Staubach wrote:

[EMAIL PROTECTED] wrote:
To use a NFS-root for UDP jumbo frames the kernel on the client need 
to bring
up interface with MTU set to 9000 bytes - otherwise it cannot contact 
server
with jumbo frames enabled (nfs server not responding, still trying) 
and cannot
boot. Added a kernel parameter named 'ipmtu' which can be used to 
specify

initial MTU size when booting via nfsroot.

  


Could you describe the problem better, please?  Something does not
sound right.  Both ends need to have jumbo frames enabled in order
to use jumbo frames, but if one end or the other does not, the systems
still should be able to exchange packets using normal sized ethernet
packets.  Isn't this a problem that mtu discovery should handle?

   Thanx...

  ps
ok - first of all: yes you're right - if both ends have jumbo frames 
enabled
it is all working fine - the patch is just for enabling client's MTU to 
jumbo

because when booting via NFS-root client's MTU is set to default (1500
in ethernet case). I know that when server has MTU=9000 and client=1500
it should work - but it only work when nfs-root directory is mounted with
TCP protocol. But i mean using UDP frames (then nfs options: wsize and
rsize could be 8192 bytes).

If I'm not clear I'll give you simple example:
My server has jumbo frames enabled (it's not a problem to set it because
server has HDD - can set up MTU during run time).
The problem is when my diskless client need to boot via nfs-root.
With vanilla kernel it looks like this:
1. Client boots
2. PXE get address from DHCP
3. without problem PXE client get kernel from server (via tftpboot)
4. it stop when kernel is going to mount root filesystem from NFS
it still trying because server has jumbo enabled and client doesn't
(endless message: NFS server is not responding, still trying)

If I pass the ipmtu option with 9000 value to client's patched kernel then
all is working fine because both client and server has jumbo frames
enabled and client is able to mount root filesystem via NFS from server.

the problem was some time ago posted by Tupshin Harper:
http://www.ussg.iu.edu/hypermail/linux/kernel/0311.1/1055.html

... and is also described on my webpage:
http://manio.skyboo.net/nfsroot_jumbo/

i hope you know what's going on :)

best regards,
Mariusz Bialonczyk

-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html