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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200515210156.GH21714@lion.mk-sys.cz>
Date:   Fri, 15 May 2020 23:01:56 +0200
From:   Michal Kubecek <mkubecek@...e.cz>
To:     netdev@...r.kernel.org
Cc:     Jakub Kicinski <kuba@...nel.org>, davem@...emloft.net,
        simon.horman@...ronome.com, kernel-team@...com
Subject: Re: [PATCH net-next 3/3] ethtool: don't call set_channels in drivers
 if config didn't change

On Fri, May 15, 2020 at 12:49:02PM -0700, Jakub Kicinski wrote:
> Don't call drivers if nothing changed. Netlink code already
> contains this logic.
> 
> Signed-off-by: Jakub Kicinski <kuba@...nel.org>

Reviewed-by: Michal Kubecek <mkubecek@...e.cz>

> ---
>  net/ethtool/ioctl.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/net/ethtool/ioctl.c b/net/ethtool/ioctl.c
> index a574d60111fa..eeb1137a3f23 100644
> --- a/net/ethtool/ioctl.c
> +++ b/net/ethtool/ioctl.c
> @@ -1669,6 +1669,12 @@ static noinline_for_stack int ethtool_set_channels(struct net_device *dev,
>  
>  	dev->ethtool_ops->get_channels(dev, &curr);
>  
> +	if (channels.rx_count == curr.rx_count &&
> +	    channels.tx_count == curr.tx_count &&
> +	    channels.combined_count == curr.combined_count &&
> +	    channels.other_count == curr.other_count)
> +		return 0;
> +
>  	/* ensure new counts are within the maximums */
>  	if (channels.rx_count > curr.max_rx ||
>  	    channels.tx_count > curr.max_tx ||
> -- 
> 2.25.4
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ