lkml.org 
[lkml]   [2023]   [Feb]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] [RFC] net: fec: Allow turning off IRQ coalescing
Wei Fang,

----- Ursprüngliche Mail -----
> Von: "wei fang" <wei.fang@nxp.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

\
 
 \ /
  Last update: 2023-03-27 00:29    [W:0.148 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site