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  linux-hardening  linux-cve-announce  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]
Message-ID: <20190508165219.GA26309@bigcity.dyn.berto.se>
Date:   Wed, 8 May 2019 18:52:20 +0200
From:   Niklas Söderlund 
        <niklas.soderlund@...natech.se>
To:     Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
Cc:     Ulrich Hecht <uli+renesas@...nd.eu>,
        linux-renesas-soc@...r.kernel.org, netdev@...r.kernel.org,
        davem@...emloft.net, wsa@...-dreams.de, horms@...ge.net.au,
        magnus.damm@...il.com
Subject: Re: [PATCH] ravb: implement MTU change while device is up

Hi Sergei,

On 2019-05-08 18:59:01 +0300, Sergei Shtylyov wrote:
> Hello!
> 
> On 05/08/2019 06:21 PM, Ulrich Hecht wrote:
> 
> > Uses the same method as various other drivers: shut the device down,
> > change the MTU, then bring it back up again.
> > 
> > Tested on Renesas D3 Draak board.
> > 
> > Signed-off-by: Ulrich Hecht <uli+renesas@...nd.eu>
> 
>    You should have CC'ed me (as an reviewer for the Renesas drivers).
> 
> > ---
> >  drivers/net/ethernet/renesas/ravb_main.c | 11 +++++++----
> >  1 file changed, 7 insertions(+), 4 deletions(-)
> 
>    What about sh_eth?
> 
> > 
> > diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
> > index ef8f089..02c247c 100644
> > --- a/drivers/net/ethernet/renesas/ravb_main.c
> > +++ b/drivers/net/ethernet/renesas/ravb_main.c
> > @@ -1810,13 +1810,16 @@ static int ravb_do_ioctl(struct net_device *ndev, struct ifreq *req, int cmd)
> >  
> >  static int ravb_change_mtu(struct net_device *ndev, int new_mtu)
> >  {
> > -	if (netif_running(ndev))
> > -		return -EBUSY;
> > +	if (!netif_running(ndev)) {
> > +		ndev->mtu = new_mtu;
> > +		netdev_update_features(ndev);
> > +		return 0;
> > +	}
> >  
> > +	ravb_close(ndev);
> >  	ndev->mtu = new_mtu;
> > -	netdev_update_features(ndev);
> >  
> > -	return 0;
> > +	return ravb_open(ndev);
> 
>    How about the code below instead?
> 
> 	if (netif_running(ndev))
> 		ravb_close(ndev);
> 
>  	ndev->mtu = new_mtu;
> 	netdev_update_features(ndev);

Is there a need to call netdev_update_features() even if the if is not 
running?

> 
> 	if (netif_running(ndev))
> 		return ravb_open(ndev);
> 
> 	return 0;
> 
> [...]
> 
> MBR, Sergei

-- 
Regards,
Niklas Söderlund

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ