public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Shane Hathaway <shane@hathawaymix.org>
To: Hans-Peter Jansen <hpj@urpla.net>
Cc: Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Configure MTU via kernel DHCP
Date: Fri, 04 Feb 2005 13:02:09 -0700	[thread overview]
Message-ID: <4203D4C1.1080007@hathawaymix.org> (raw)
In-Reply-To: <200502041755.41288.hpj@urpla.net>

Hans-Peter Jansen wrote:
> On Thursday 03 February 2005 05:47, Shane Hathaway wrote:
> 
>>The attached patch enhances the kernel's DHCP client support (in
>>net/ipv4/ipconfig.c) to set the interface MTU if provided by the
>>DHCP server. Without this patch, it's difficult to netboot on a
>>network that uses jumbo frames.  The patch is based on 2.6.10, but
>>I'll update it to the latest testing kernel if that would expedite
>>its inclusion in the kernel.
> 
> 
> Well, I've been there before, and asked for exact the same back in 
> June 2003, but had much less luck, nobody of kernel fame even 
> responded:
> http://marc.theaimsgroup.com/?l=linux-kernel&m=105624464918574&w=4

I wish I had found your patch before I went to the trouble of writing my 
own!  Yours is just as good as mine.

> For what is worth it, I ported my patch to current 2.6, which raised 
> some comments compared to yours:
> 
>  - Is it really necessary to protect the dev_set_mtu call, since it is
>    just setting up the device?

Without rtnl_shlock(), something complains about RTNL not being locked. 
I don't know much beyond that.

>  - I prefer to call dev_set_mtu only, if a change mtu request is
>    sent.. 

Yes, I can see that.  Either way is fine by me.

>  - Are you sure, you got the endianess right? 

On the MTU parameter?  Yes, it's network byte order, big-endian.

> Here's the "cost": ipconfig.o without my patch on x86:
> 
>   3 .init.data    0000005a  00000000  00000000  00000220  2**2
>                   CONTENTS, ALLOC, LOAD, RELOC, DATA
>   4 .rodata.str1.1 000001a2  00000000  00000000  0000027a  2**0
>                   CONTENTS, ALLOC, LOAD, READONLY, DATA
>   5 .rodata.str1.4 000003ad  00000000  00000000  0000041c  2**2
>                   CONTENTS, ALLOC, LOAD, READONLY, DATA
>   6 .init.text    00001a45  00000000  00000000  000007d0  2**4
>                   CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
> 
> With patch:
> 
>   3 .init.data    0000005e  00000000  00000000  00000220  2**2
>                   CONTENTS, ALLOC, LOAD, RELOC, DATA
>   4 .rodata.str1.1 000001ab  00000000  00000000  0000027e  2**0
>                   CONTENTS, ALLOC, LOAD, READONLY, DATA
>   5 .rodata.str1.4 000003e5  00000000  00000000  0000042c  2**2
>                   CONTENTS, ALLOC, LOAD, READONLY, DATA
>   6 .init.text    00001ab5  00000000  00000000  00000820  2**4
>                   CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
> 
> Difference: 181 Bytes (padding ignored)
> 
> The whole module takes about 9K, compared to dhcp in initrd, which 
> takes a few hundred K! Hmm.

It's probably better to compare your patch with its apparent successor, 
however.  The tiny DHCP client in the klibc package already supports 
setting the MTU.

> May the linux gods indulge on this topic one day or remove the 
> ipconfig module completely.

A friend of mine just had the misfortune of running into the exact same 
problem, but then he had the fortune of finding your patch.  So at least 
the curse has a temporary remedy. :-)  The long-term solution is klibc, 
I hope.  klibc in initramfs could ease a lot of pain.

Shane

  parent reply	other threads:[~2005-02-04 20:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-03  4:47 [PATCH] Configure MTU via kernel DHCP Shane Hathaway
2005-02-03 11:45 ` Herbert Xu
2005-02-03 16:57   ` Shane Hathaway
2005-02-03 21:14   ` H. Peter Anvin
2005-02-04  8:06 ` Denis Vlasenko
2005-02-04 16:55 ` Hans-Peter Jansen
2005-02-04 18:22   ` Richard A Nelson
2005-02-04 19:54     ` Hans-Peter Jansen
2005-02-04 20:02   ` Shane Hathaway [this message]
2005-02-05 23:23   ` Eric W. Biederman

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=4203D4C1.1080007@hathawaymix.org \
    --to=shane@hathawaymix.org \
    --cc=hpj@urpla.net \
    --cc=linux-kernel@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox