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]
Date:   Mon, 20 Feb 2023 21:15:15 +0100 (CET)
From:   Richard Weinberger <richard@....at>
To:     wei fang <wei.fang@....com>
Cc:     netdev <netdev@...r.kernel.org>,
        linux-kernel <linux-kernel@...r.kernel.org>,
        pabeni <pabeni@...hat.com>, kuba <kuba@...nel.org>,
        edumazet <edumazet@...gle.com>, davem <davem@...emloft.net>,
        linux-imx <linux-imx@....com>,
        xiaoning wang <xiaoning.wang@....com>,
        shenwei wang <shenwei.wang@....com>
Subject: Re: [PATCH] [RFC] net: fec: Allow turning off IRQ coalescing

Wei Fang,

----- Ursprüngliche Mail -----
> Von: "wei fang" <wei.fang@....com>
>>  /* Set threshold for interrupt coalescing */
>> -static void fec_enet_itr_coal_set(struct net_device *ndev)
>> +static int fec_enet_itr_coal_set(struct net_device *ndev)
>>  {
>> +	bool disable_rx_itr = false, disable_tx_itr = false;
>>  	struct fec_enet_private *fep = netdev_priv(ndev);
> disable_rx_itr should be defined below fep to follow the style of the reverse
> Christmas tree.

Of course, will fix in v2.
 
>> -	int rx_itr, tx_itr;
>> +	struct device *dev = &fep->pdev->dev;
>> +	int rx_itr = 0, tx_itr = 0;
>> 
>> -	/* Must be greater than zero to avoid unpredictable behavior */
>> -	if (!fep->rx_time_itr || !fep->rx_pkts_itr ||
>> -	    !fep->tx_time_itr || !fep->tx_pkts_itr)
>> -		return;
>> +	if (!fep->rx_time_itr || !fep->rx_pkts_itr) {
>> +		if (fep->rx_time_itr || fep->rx_pkts_itr) {
> 
> I think the below should be better:
> if (!!fep->rx_time_itr == ! fep->rx_pkts_itr)

At least it's shorter. :-)
I'm not sure which variant is easier to understand, though.

But in general you are fine with returning -EINVAL in this case?
I'm asking because that a userspace visible change.

Thanks,
//richard

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ