Re: [PATCH] [RFC] net: fec: Allow turning off IRQ coalescing

From: Richard Weinberger
Date: Mon Feb 20 2023 - 15:07:47 EST


Andrew,

----- Ursprüngliche Mail -----
>> - /* 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) {
>> + dev_warn(dev, "Rx coalesced frames and usec have to be "
>> + "both positive or both zero to disable Rx "
>> + "coalescence completely\n");
>> + return -EINVAL;
>> + }
>
> Hi Richard
>
> Why do this validation here, and not in fec_enet_set_coalesce() where
> there are already checks? fec_enet_set_coalesce() also has extack, so
> you can return useful messages to user space, not just the kernel log.

Using extack is a good point, the driver does not use it at all so far.
So I'd do a second patch which cleans this up.

I did the check in fec_enet_itr_coal_set() because the check is used to
set both disable_rx_itr and disable_tx_itr.
Of course I can place the check into fec_enet_set_coalesce() and then
pass disable_rx_itr and disable_tx_itr to fec_enet_itr_coal_set().

Thanks,
//richard