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:   Mon, 14 Sep 2020 11:58:09 -0700
From:   Jakub Kicinski <kuba@...nel.org>
To:     Andrew Lunn <andrew@...n.ch>
Cc:     davem@...emloft.net, netdev@...r.kernel.org, mkubecek@...e.cz,
        michael.chan@...adcom.com, tariqt@...dia.com, saeedm@...dia.com,
        alexander.duyck@...il.com
Subject: Re: [PATCH net-next v2 1/8] ethtool: add standard pause stats

On Mon, 14 Sep 2020 19:18:08 +0200 Andrew Lunn wrote:
> On Mon, Sep 14, 2020 at 08:48:10AM -0700, Jakub Kicinski wrote:
> > On Mon, 14 Sep 2020 03:48:40 +0200 Andrew Lunn wrote:  
> > > >  static int pause_prepare_data(const struct ethnl_req_info *req_base,
> > > > @@ -34,10 +36,17 @@ static int pause_prepare_data(const struct ethnl_req_info *req_base,
> > > >  
> > > >  	if (!dev->ethtool_ops->get_pauseparam)
> > > >  		return -EOPNOTSUPP;
> > > > +
> > > >  	ret = ethnl_ops_begin(dev);
> > > >  	if (ret < 0)
> > > >  		return ret;
> > > >  	dev->ethtool_ops->get_pauseparam(dev, &data->pauseparam);
> > > > +	if (req_base->flags & ETHTOOL_FLAG_STATS &&
> > > > +	    dev->ethtool_ops->get_pause_stats) {
> > > > +		memset(&data->pausestat, 0xff,
> > > > +		       sizeof(struct ethtool_pause_stats));    
> > > 
> > > Sorry, i missed v1 of these patches. Maybe this has been commented?
> > > 
> > > Filling with 0xff is odd. I don't know of any other code doing this.  
> > 
> > Are you saying it'd be clearer to assign ETHTOOL_STAT_NOT_SET in a loop?  
> 
> Yes. In the end i figured out this is what you intended. I knew there
> had to be more to it than what i was seeing. It would be much more
> readable to just set the two values to ETHTOOL_STAT_NOT_SET. And i
> doubt it makes any difference to the compile, it is probably rolling
> the loop and just doing two assignments anyway.

Good point, thanks!

Powered by blists - more mailing lists