public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Li Xiasong <lixiasong1@huawei.com>
To: Jordan Rhee <jordanrhee@google.com>
Cc: Harshitha Ramamurthy <hramamurthy@google.com>,
	<joshwash@google.com>, <andrew+netdev@lunn.ch>,
	<davem@davemloft.net>, <edumazet@google.com>, <kuba@kernel.org>,
	<pabeni@redhat.com>, <richardcochran@gmail.com>,
	<willemb@google.com>, <nktgrg@google.com>, <jfraker@google.com>,
	<ziweixiao@google.com>, <maolson@google.com>,
	<thostet@google.com>, <jefrogers@google.com>,
	<alok.a.tiwari@oracle.com>, <yyd@google.com>,
	<linux-kernel@vger.kernel.org>, <netdev@vger.kernel.org>,
	<yuehaibing@huawei.com>, <zhangchangzhong@huawei.com>,
	<weiyongjun1@huawei.com>
Subject: Re: [PATCH net-next v2 1/3] gve: skip error logging for retryable AdminQ commands
Date: Fri, 27 Mar 2026 13:06:41 +0800	[thread overview]
Message-ID: <e5aa3bb6-34e5-49de-b07a-47c8bac32420@huawei.com> (raw)
In-Reply-To: <CA+mzVtsXm1M4G_qiuEZ4A_ttJk4NL-DP-Ceo=nFPWRNUSn6RBQ@mail.gmail.com>

Hi, Jordan

On 3/27/2026 11:56 AM, Jordan Rhee wrote:
> Hi Li, thank you very much for the review. The intent is only to skip
> logging for *retryable* commands that return -EAGAIN. If a
> non-retryable command fails, we do want to log, even if it returns
> -EAGAIN.
> Jordan
>

Thanks for the explanation! I totally misread the condition - I confused
opcode with err because they both start with GVE_ADMINQ_.

The || makes perfect sense now. Sorry for the noise!

Best regards,
Li Xiasong

> 
> On Thu, Mar 26, 2026 at 7:28 PM Li Xiasong <lixiasong1@huawei.com> wrote:
>>
>> Hi,
>>
>> On 3/27/2026 6:45 AM, Harshitha Ramamurthy wrote:
>>> From: Jordan Rhee <jordanrhee@google.com>
>>>
>>> AdminQ commands may return -EAGAIN under certain transient conditions.
>>> These commands are intended to be retried by the driver, so logging
>>> a formal error to the system log is misleading and creates
>>> unnecessary noise.
>>>
>>> Modify the logging logic to skip the error message when the result
>>> is -EAGAIN.
>>>
>>> Reviewed-by: Joshua Washington <joshwash@google.com>
>>> Signed-off-by: Jordan Rhee <jordanrhee@google.com>
>>> Signed-off-by: Harshitha Ramamurthy <hramamurthy@google.com>
>>> ---
>>>  drivers/net/ethernet/google/gve/gve_adminq.c | 26 +++++++++++++++-----
>>>  1 file changed, 20 insertions(+), 6 deletions(-)
>>>
>>> diff --git a/drivers/net/ethernet/google/gve/gve_adminq.c b/drivers/net/ethernet/google/gve/gve_adminq.c
>>> index 08587bf40ed4..c7834614c5f0 100644
>>> --- a/drivers/net/ethernet/google/gve/gve_adminq.c
>>> +++ b/drivers/net/ethernet/google/gve/gve_adminq.c
>>> @@ -416,11 +416,6 @@ static bool gve_adminq_wait_for_cmd(struct gve_priv *priv, u32 prod_cnt)
>>>
>>>  static int gve_adminq_parse_err(struct gve_priv *priv, u32 status)
>>>  {
>>> -     if (status != GVE_ADMINQ_COMMAND_PASSED &&
>>> -         status != GVE_ADMINQ_COMMAND_UNSET) {
>>> -             dev_err(&priv->pdev->dev, "AQ command failed with status %d\n", status);
>>> -             priv->adminq_cmd_fail++;
>>> -     }
>>>       switch (status) {
>>>       case GVE_ADMINQ_COMMAND_PASSED:
>>>               return 0;
>>> @@ -455,6 +450,16 @@ static int gve_adminq_parse_err(struct gve_priv *priv, u32 status)
>>>       }
>>>  }
>>>
>>> +static bool gve_adminq_is_retryable(enum gve_adminq_opcodes opcode)
>>> +{
>>> +     switch (opcode) {
>>> +     case GVE_ADMINQ_REPORT_NIC_TIMESTAMP:
>>> +             return true;
>>> +     default:
>>> +             return false;
>>> +     }
>>> +}
>>> +
>>>  /* Flushes all AQ commands currently queued and waits for them to complete.
>>>   * If there are failures, it will return the first error.
>>>   */
>>> @@ -482,9 +487,18 @@ static int gve_adminq_kick_and_wait(struct gve_priv *priv)
>>>               cmd = &priv->adminq[i & priv->adminq_mask];
>>>               status = be32_to_cpu(READ_ONCE(cmd->status));
>>>               err = gve_adminq_parse_err(priv, status);
>>> -             if (err)
>>> +             if (err) {
>>> +                     enum gve_adminq_opcodes opcode =
>>> +                             be32_to_cpu(READ_ONCE(cmd->opcode));
>>> +                     priv->adminq_cmd_fail++;
>>> +                     if (!gve_adminq_is_retryable(opcode) || err != -EAGAIN)
>>
>> In gve_adminq_kick_and_wait(), the condition is:
>>
>>         if (!gve_adminq_is_retryable(opcode) || err != -EAGAIN)
>>                 dev_err_ratelimited(...);
>>
>> Based on the commit log, the goal is to skip logging when the result is
>> -EAGAIN for transient conditions. However, when gve_adminq_is_retryable()
>> returns false (e.g., GVE_ADMINQ_COMMAND_ERROR_ABORTED), even if err is
>> -EAGAIN, the condition evaluates to true and the error would still be logged.
>>
>> Would it be more appropriate to use && instead of || here?
>>
>>         if (!gve_adminq_is_retryable(opcode) && err != -EAGAIN)
>>
>> I may be missing something, so please let me know if I've misunderstood.
>>
>>> +                             dev_err_ratelimited(&priv->pdev->dev,
>>> +                                                 "AQ command %d failed with status %d\n",
>>> +                                                 opcode, status);
>>> +
>>>                       // Return the first error if we failed.
>>>                       return err;
>>> +             }
>>>       }
>>>
>>>       return 0;
>>
>> Best regards,
>> Li Xiasong

  reply	other threads:[~2026-03-27  5:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-26 22:45 [PATCH net-next v2 0/3] gve: add support for PTP gettimex64 Harshitha Ramamurthy
2026-03-26 22:45 ` [PATCH net-next v2 1/3] gve: skip error logging for retryable AdminQ commands Harshitha Ramamurthy
2026-03-27  2:28   ` Li Xiasong
2026-03-27  3:56     ` Jordan Rhee
2026-03-27  5:06       ` Li Xiasong [this message]
2026-03-26 22:45 ` [PATCH net-next v2 2/3] gve: make nic clock reads thread safe Harshitha Ramamurthy
2026-03-26 22:45 ` [PATCH net-next v2 3/3] gve: implement PTP gettimex64 Harshitha Ramamurthy

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=e5aa3bb6-34e5-49de-b07a-47c8bac32420@huawei.com \
    --to=lixiasong1@huawei.com \
    --cc=alok.a.tiwari@oracle.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hramamurthy@google.com \
    --cc=jefrogers@google.com \
    --cc=jfraker@google.com \
    --cc=jordanrhee@google.com \
    --cc=joshwash@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maolson@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=nktgrg@google.com \
    --cc=pabeni@redhat.com \
    --cc=richardcochran@gmail.com \
    --cc=thostet@google.com \
    --cc=weiyongjun1@huawei.com \
    --cc=willemb@google.com \
    --cc=yuehaibing@huawei.com \
    --cc=yyd@google.com \
    --cc=zhangchangzhong@huawei.com \
    --cc=ziweixiao@google.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