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: <20190820194129.jttuef4ghsx7rihf@katana>
Date:   Tue, 20 Aug 2019 21:41:29 +0200
From:   Wolfram Sang <wsa@...-dreams.de>
To:     Ulrich Hecht <uli+renesas@...nd.eu>
Cc:     linux-renesas-soc@...r.kernel.org, netdev@...r.kernel.org,
        davem@...emloft.net, sergei.shtylyov@...entembedded.com,
        niklas.soderlund@...natech.se, horms@...ge.net.au,
        magnus.damm@...il.com, geert@...der.be
Subject: Re: [PATCH v3] ravb: implement MTU change while device is up

Hi Uli,

thanks for the patch.

On Tue, Aug 20, 2019 at 09:01:26PM +0200, 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 and M3-W Salvator-X boards.
> 
> Signed-off-by: Ulrich Hecht <uli+renesas@...nd.eu>
> Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@...natech.se>
> Reviewed-by: Geert Uytterhoeven <geert+renesas@...der.be>
> Reviewed-by: Sergei Shtylyov <sergei.shtylyov@...entembedded.com>

Are these reviews left from v2? If so, I'd prefer to see them given
again because the logic was changed in v3.

> ---
> 
> Hi!
> 
> This revision reverts the MTU change if re-opening the device fails.
> 
> CU
> Uli
> 
> 
>  drivers/net/ethernet/renesas/ravb_main.c | 14 +++++++++++++-
>  1 file changed, 13 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
> index ef8f089..402bcec 100644
> --- a/drivers/net/ethernet/renesas/ravb_main.c
> +++ b/drivers/net/ethernet/renesas/ravb_main.c
> @@ -1810,12 +1810,24 @@ 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)
>  {
> +	unsigned int old_mtu = ndev->mtu;
> +
>  	if (netif_running(ndev))
> -		return -EBUSY;
> +		ravb_close(ndev);
>  
>  	ndev->mtu = new_mtu;
>  	netdev_update_features(ndev);
>  
> +	if (netif_running(ndev)) {
> +		int err = ravb_open(ndev);
> +
> +		if (err) {
> +			ndev->mtu = old_mtu;
> +			netdev_update_features(ndev);
> +			return err;
> +		}
> +	}
> +
>  	return 0;
>  }
>  
> -- 
> 2.7.4
> 

Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ