From: Richard Weinberger <richard@nod.at>
To: Andrew Lunn <andrew@lunn.ch>
Cc: netdev <netdev@vger.kernel.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
pabeni@redhat.com, kuba@kernel.org, edumazet@google.com,
davem <davem@davemloft.net>, linux-imx <linux-imx@nxp.com>,
xiaoning wang <xiaoning.wang@nxp.com>,
shenwei wang <shenwei.wang@nxp.com>, wei fang <wei.fang@nxp.com>
Subject: Re: [PATCH] [RFC] net: fec: Allow turning off IRQ coalescing
Date: Mon, 20 Feb 2023 21:07:36 +0100 (CET) [thread overview]
Message-ID: <1575439606.155156.1676923656294.JavaMail.zimbra@nod.at> (raw)
In-Reply-To: <Y/LIS3xd1iZRyVGe@lunn.ch>
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
next prev parent reply other threads:[~2023-02-20 20:07 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-18 21:40 Richard Weinberger
2023-02-20 1:09 ` Andrew Lunn
2023-02-20 20:07 ` Richard Weinberger [this message]
2023-02-20 2:11 ` Wei Fang
2023-02-20 20:15 ` Richard Weinberger
2023-02-21 1:40 ` Wei Fang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1575439606.155156.1676923656294.JavaMail.zimbra@nod.at \
--to=richard@nod.at \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-imx@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shenwei.wang@nxp.com \
--cc=wei.fang@nxp.com \
--cc=xiaoning.wang@nxp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome