public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: Jacob Keller <jacob.e.keller@intel.com>
Cc: netdev@vger.kernel.org, valex@mellanox.com, parav@mellanox.com
Subject: Re: [net] devlink: report 0 after hitting end in region read
Date: Wed, 5 Feb 2020 07:18:11 +0100	[thread overview]
Message-ID: <20200205061811.GA2159@nanopsycho> (raw)
In-Reply-To: <20200204235950.2209828-1-jacob.e.keller@intel.com>

Wed, Feb 05, 2020 at 12:59:50AM CET, jacob.e.keller@intel.com wrote:
>commit fdd41ec21e15 ("devlink: Return right error code in case of errors
>for region read") modified the region read code to report errors
>properly in unexpected cases.
>
>In the case where the start_offset and ret_offset match, it unilaterally
>converted this into an error. This causes an issue for the "dump"
>version of the command. In this case, the devlink region dump will
>always report an invalid argument:
>
>000000000000ffd0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>000000000000ffe0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>devlink answers: Invalid argument
>000000000000fff0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>
>This occurs because the expected flow for the dump is to return 0 after
>there is no further data.
>
>The simplest fix would be to stop converting the error code to -EINVAL
>if start_offset == ret_offset. However, avoid unnecessary work by
>checking for when start_offset is larger than the region size and
>returning 0 upfront.
>
>Fixes: fdd41ec21e15 ("devlink: Return right error code in case of errors for region read")
>Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>

Acked-by: Jiri Pirko <jiri@mellanox.com>

Thanks!

  reply	other threads:[~2020-02-05  6:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-04 23:59 [net] devlink: report 0 after hitting end in region read Jacob Keller
2020-02-05  6:18 ` Jiri Pirko [this message]
2020-02-05 13:25 ` David Miller

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=20200205061811.GA2159@nanopsycho \
    --to=jiri@resnulli.us \
    --cc=jacob.e.keller@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=parav@mellanox.com \
    --cc=valex@mellanox.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