lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 18 Oct 2016 11:04:52 -0400
From:   Jarod Wilson <jarod@...hat.com>
To:     Denis Kirjanov <kda@...ux-powerpc.org>
Cc:     linux-kernel@...r.kernel.org, netdev@...r.kernel.org
Subject: Re: [PATCH net-next 09/15] ethernet/dlink: use core min/max MTU
 checking

On Tue, Oct 18, 2016 at 04:45:51PM +0300, Denis Kirjanov wrote:
> On 10/17/16, Jarod Wilson <jarod@...hat.com> wrote:
> > dl2k: min_mtu 68, max_mtu 1536 or 8000, depending on hardware
> > - Removed change_mtu, does nothing productive anymore
> >
> > sundance: min_mtu 68, max_mtu 8191
> >
> > CC: netdev@...r.kernel.org
> > CC: Denis Kirjanov <kda@...ux-powerpc.org>
> > Signed-off-by: Jarod Wilson <jarod@...hat.com>
> > ---
> >  drivers/net/ethernet/dlink/dl2k.c     | 22 ++++------------------
> >  drivers/net/ethernet/dlink/sundance.c |  6 ++++--
> >  2 files changed, 8 insertions(+), 20 deletions(-)
...
> > diff --git a/drivers/net/ethernet/dlink/sundance.c
> > b/drivers/net/ethernet/dlink/sundance.c
> > index 79d8009..eab36ac 100644
> > --- a/drivers/net/ethernet/dlink/sundance.c
> > +++ b/drivers/net/ethernet/dlink/sundance.c
> > @@ -580,6 +580,10 @@ static int sundance_probe1(struct pci_dev *pdev,
> >  	dev->ethtool_ops = &ethtool_ops;
> >  	dev->watchdog_timeo = TX_TIMEOUT;
> >
> > +	/* MTU range: 68 - 8191 */
> > +	dev->min_mtu = ETH_MIN_MTU;
> > +	dev->max_mtu = 8191;
> > +
> ICPlus datasheet defines the max frame size like 0x1514 or 0x4491
> based on the RcvLargeFrames bit in the MACCtrl0 register

I do anticipate this patchset might bring to light some inaccuracies in
min/max mtu values currently implemented in various drivers, but for the
moment, I'm going for 100% identical behavior with what's currently in the
driver, and if you'll look down below...

> >  	pci_set_drvdata(pdev, dev);
> >
> >  	i = register_netdev(dev);
> > @@ -713,8 +717,6 @@ static int sundance_probe1(struct pci_dev *pdev,
> >
> >  static int change_mtu(struct net_device *dev, int new_mtu)
> >  {
> > -	if ((new_mtu < 68) || (new_mtu > 8191)) /* Set by RxDMAFrameLen */

                                         ^^^^
The 8191 was simply transplanted from right here. I think altering the
value should be the subject of a separate patch.

-- 
Jarod Wilson
jarod@...hat.com

Powered by blists - more mailing lists