From: Jacob Keller <jacob.e.keller@intel.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [PATCH net-next 2/6] ice: always check VF VSI pointer values
Date: Tue, 12 Apr 2022 10:35:54 -0700 [thread overview]
Message-ID: <987480f6-9fc1-bd67-8803-9b88645b514c@intel.com> (raw)
In-Reply-To: <e079ab74-48fc-65d1-4d3f-2c0cdd4ffcb9@molgen.mpg.de>
On 4/11/2022 10:38 PM, Paul Menzel wrote:
> Dear Jacob,
>
>
> Thank you for the patch.
>
> Am 12.04.22 um 01:29 schrieb Jacob Keller:
>> The ice_get_vf_vsi function can return NULL in some cases, such as if
>> handling messages during a reset where the VSI is being removed and
>> recreated.
>>
>> Several places throughout the driver do not bother to check whether this
>> VSI pointer is valid. Static analysis tools maybe report issues because
>> they detect paths where a potentially NULL pointer could be
>> dereferenced.
>
> (side note: scripts/checkpatch.pl checks for 75 characters per line, and
> you seem to use 72 characters per line.)
>
For commit message wrapping? I use some default from a vim plugin which
I guess decided that 72 was a good choice. Technically thats 8
characters less than 80 which is one full tabstop if you render tabs as
8 spaces, which is sometimes used as a method of indenting commits from
git tools..
>> Fix this by checking the return value of ice_get_vf_vsi everywhere.
>
> I didn?t understand, when WARN_ON() is necessary, and when not, but
> looks fine.
>
I tried my best to use WARN_ON in places which have no suitable way to
report an error back out, but for places where we can simply fail the
operation I avoided it.
This was similar to how we handled invalid VF pointers in certain places.
The WARN_ONs aren't strictly needed, but generally speaking those flows
shouldn't be hitting an invalid pointer. (Indeed, prior to this patch
they would have been BUGs instead!)
Hope that explains why not every place has the WARN_ON.
>> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
>> ---
>> drivers/net/ethernet/intel/ice/ice_devlink.c | 5 ++-
>> drivers/net/ethernet/intel/ice/ice_repr.c | 7 +++-
>> drivers/net/ethernet/intel/ice/ice_sriov.c | 32 +++++++++++++++++--
>> drivers/net/ethernet/intel/ice/ice_vf_lib.c | 28 +++++++++++++++-
>> drivers/net/ethernet/intel/ice/ice_virtchnl.c | 5 +++
>> .../ethernet/intel/ice/ice_virtchnl_fdir.c | 7 +++-
>> 6 files changed, 77 insertions(+), 7 deletions(-)
>
> [?]
>
> Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>
>
>
> Kind regards,
>
> Paul
next prev parent reply other threads:[~2022-04-12 17:35 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-11 23:29 [Intel-wired-lan] [PATCH net-next 0/6] minor cleanups for ice virtualization Jacob Keller
2022-04-11 23:29 ` [Intel-wired-lan] [PATCH net-next 1/6] ice: add newline to dev_dbg in ice_vf_fdir_dump_info Jacob Keller
2022-04-12 5:10 ` Paul Menzel
2022-04-12 16:36 ` Keller, Jacob E
2022-04-11 23:29 ` [Intel-wired-lan] [PATCH net-next 2/6] ice: always check VF VSI pointer values Jacob Keller
2022-04-12 5:38 ` Paul Menzel
2022-04-12 17:35 ` Jacob Keller [this message]
2022-04-12 17:50 ` Paul Menzel
2022-04-18 22:58 ` Jacob Keller
2022-04-26 5:50 ` Jankowski, Konrad0
2022-04-11 23:29 ` [Intel-wired-lan] [PATCH net-next 3/6] ice: remove return value comment for ice_reset_all_vfs Jacob Keller
2022-04-11 23:29 ` [Intel-wired-lan] [PATCH net-next 4/6] ice: fix wording in comment for ice_reset_vf Jacob Keller
2022-04-11 23:29 ` [Intel-wired-lan] [PATCH net-next 5/6] ice: add a function comment for ice_cfg_mac_antispoof Jacob Keller
2022-04-11 23:29 ` [Intel-wired-lan] [PATCH net-next 6/6] ice: remove period on argument description in ice_for_each_vf Jacob Keller
2022-04-12 5:44 ` [Intel-wired-lan] [PATCH net-next 0/6] minor cleanups for ice virtualization Paul Menzel
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=987480f6-9fc1-bd67-8803-9b88645b514c@intel.com \
--to=jacob.e.keller@intel.com \
--cc=intel-wired-lan@osuosl.org \
/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