Re: Minimum MTU Mess

2016-09-12 Thread Jarod Wilson
On Mon, Sep 12, 2016 at 11:59:41AM +0900, YOSHIFUJI Hideaki wrote: > > > Jarod Wilson wrote: > > On Tue, Sep 06, 2016 at 04:55:29PM -0700, David Miller wrote: > >> From: Jarod Wilson > >> Date: Fri, 2 Sep 2016 13:07:42 -0400 > >> > >>> In any case, the number of "mtu < 68" and

Re: Minimum MTU Mess

2016-09-12 Thread Jarod Wilson
On Mon, Sep 12, 2016 at 04:41:40AM +0200, Andrew Lunn wrote: > > Actually breaking this up into easily digestable/mergeable chunks is going > > to be kind of entertaining... Suggestions welcomed on that. First up is > > obviously the core change, which touches just net/ethernet/eth.c, > >

Re: Minimum MTU Mess

2016-09-11 Thread YOSHIFUJI Hideaki
Jarod Wilson wrote: > On Tue, Sep 06, 2016 at 04:55:29PM -0700, David Miller wrote: >> From: Jarod Wilson >> Date: Fri, 2 Sep 2016 13:07:42 -0400 >> >>> In any case, the number of "mtu < 68" and "#define FOO_MIN_MTU 68", or >>> variations thereof, under drivers/net/ is kind of

Re: Minimum MTU Mess

2016-09-11 Thread Andrew Lunn
> Actually breaking this up into easily digestable/mergeable chunks is going > to be kind of entertaining... Suggestions welcomed on that. First up is > obviously the core change, which touches just net/ethernet/eth.c, > net/core/dev.c, include/linux/netdevice.h and >

Re: Minimum MTU Mess

2016-09-09 Thread Jarod Wilson
On Thu, Sep 08, 2016 at 03:24:13AM +0200, Andrew Lunn wrote: > > This is definitely going to require a few passes... (Working my way > > through every driver with an ndo_change_mtu wired up right now to > > see just how crazy this might get). > > It might be something Coccinelle can help you

Re: Minimum MTU Mess

2016-09-07 Thread Andrew Lunn
> This is definitely going to require a few passes... (Working my way > through every driver with an ndo_change_mtu wired up right now to > see just how crazy this might get). It might be something Coccinelle can help you with. Try describing the transformation you want to do, to their mailing

Re: Minimum MTU Mess

2016-09-07 Thread Jarod Wilson
On Wed, Sep 07, 2016 at 01:35:35PM -0700, Stephen Hemminger wrote: > On Wed, 7 Sep 2016 15:53:56 -0400 > Jarod Wilson wrote: > > > --- a/net/core/dev.c > > +++ b/net/core/dev.c > > @@ -6466,9 +6466,17 @@ int dev_set_mtu(struct net_device *dev, int new_mtu) > > if (new_mtu

Re: Minimum MTU Mess

2016-09-07 Thread Jarod Wilson
On Wed, Sep 07, 2016 at 10:31:12PM +0200, Andrew Lunn wrote: > Hi Jarod > > > - /* MTU must be positive.*/ > > - if (new_mtu < 0) > > + if (new_mtu < dev->min_mtu) { > > + netdev_err(dev, "Invalid MTU %d requested, hw min %d\n", > > + new_mtu,

Re: Minimum MTU Mess

2016-09-07 Thread Stephen Hemminger
On Wed, 7 Sep 2016 15:53:56 -0400 Jarod Wilson wrote: > --- a/net/core/dev.c > +++ b/net/core/dev.c > @@ -6466,9 +6466,17 @@ int dev_set_mtu(struct net_device *dev, int new_mtu) > if (new_mtu == dev->mtu) > return 0; > > - /* MTU must be positive.

Re: Minimum MTU Mess

2016-09-07 Thread Andrew Lunn
Hi Jarod > - /* MTU must be positive.*/ > - if (new_mtu < 0) > + if (new_mtu < dev->min_mtu) { > + netdev_err(dev, "Invalid MTU %d requested, hw min %d\n", > +new_mtu, dev->min_mtu); > return -EINVAL; > + } > + > + if

Re: Minimum MTU Mess

2016-09-07 Thread Jarod Wilson
On Tue, Sep 06, 2016 at 04:55:29PM -0700, David Miller wrote: > From: Jarod Wilson > Date: Fri, 2 Sep 2016 13:07:42 -0400 > > > In any case, the number of "mtu < 68" and "#define FOO_MIN_MTU 68", or > > variations thereof, under drivers/net/ is kind of crazy. > > Agreed, we

Re: Minimum MTU Mess

2016-09-06 Thread David Miller
From: Jarod Wilson Date: Fri, 2 Sep 2016 13:07:42 -0400 > In any case, the number of "mtu < 68" and "#define FOO_MIN_MTU 68", or > variations thereof, under drivers/net/ is kind of crazy. Agreed, we can have a default and let the different cases provide overrides. Mostly what

Minimum MTU Mess

2016-09-02 Thread Jarod Wilson
So... I had a bug reported, about a NIC that ceased to work, if it's MTU was set to 0, then back to it's original value (1500). This got me thinking... What does an MTU of 0 even mean? Why should it be allowed? As it turns out, most (but not all) network drivers have a check in their