From: "Min Hu (Connor)" <humin29@huawei.com>
To: Kevin Traynor <ktraynor@redhat.com>, <dev@dpdk.org>
Cc: <ferruh.yigit@intel.com>, <thomas@monjalon.net>,
<andrew.rybchenko@oktetlabs.ru>
Subject: Re: [dpdk-dev] [PATCH v4] ethdev: add sanity checks in control APIs
Date: Fri, 16 Apr 2021 18:44:22 +0800 [thread overview]
Message-ID: <146942ea-a3f3-a201-9089-63c883737d49@huawei.com> (raw)
In-Reply-To: <da896855-5b76-8ccc-7f1d-6f943e821710@redhat.com>
在 2021/4/16 18:09, Kevin Traynor 写道:
> On 16/04/2021 08:00, Min Hu (Connor) wrote:
>> Thanks Kevin,
>> all is fixed in v6, please review it, thanks.
>> Some comments are below.
>>
>> 在 2021/4/15 20:04, Kevin Traynor 写道:
>>> On 15/04/2021 01:52, Min Hu (Connor) wrote:
>>>> This patch adds more sanity checks in control path APIs.
>>>>
>>>
>>> Hi Connor,
>>>
>>> A few general comments,
>>>
>>> --
>>> Some of the functions have unit tests, you could consider adding unit
>>> tests for the new checks. Considering the checks are not subtle and
>>> unlikely to be messed up in future, not adding unit tests is not a
>>> blocker imho.
>>>
>>> --
>>> It took me a while to get what you meant with "by NULL". It's usage
>>> seems like in "Death by taxes". Perhaps "because NULL ptr" would be a
>>> better way to phrase this generically, but I think it is more useful to
>>> say what is NULL.
>>>
>>> e.g. "Failed to convert NULL to string\n" is very generic and would be
>>> better as "Failed to convert NULL link to string\n" . ok, still a bit
>>> generic but more of a clue.
>>>
>>> I won't comment on each log message individually but I've added a few
>>> suggestions here and there.
>
> Thanks, I think it looks a lot nicer to read in v6 my completely
> subjective biased opinion :-)
>
>>> --
>>>
>>> Did you check the usage of these functions in DPDK, and if the return
>>> value is handled ok? e.g. RTE_ETH_FOREACH_MATCHING_DEV will keep calling
>>> iterator functions. I'm not sure that having a return check is needed in
>>> that case, but there could be other cases where you want to take some
>>> different action now.
>>>
>> As iterator functions are all APIs, they may be used by APP directly.
>> I think param check is necessary.
>
> The point is that it would continue to call the functions even after it
> caught this error, so would continue to print error messages. Yes, that
> is much better than a seg fault and maybe in this case that is ok. I
> will leave it to maintainers to decided.
>
> I was just wondering if there was additional things similar to this in
> DPDK where handling these new errors could now be improved too. I don't
> think it has to be a prerequisite for this patch, as this patch is still
> an improvement.
>
Thanks Kevin.
Well, for what your metioned, I will try to look for it.
If found, I will send another patch or initiate discussions.
Thanks.
>>> some other comments inlined,
>>>
>>>> Fixes: 214ed1acd125 ("ethdev: add iterator to match devargs input")
>>>> Fixes: 3d98f921fbe9 ("ethdev: unify prefix for static functions and variables")
>>>> Fixes: 0366137722a0 ("ethdev: check for invalid device name")
>>>> Fixes: d948f596fee2 ("ethdev: fix port data mismatched in multiple process model")
>>>> Fixes: 5b7ba31148a8 ("ethdev: add port ownership")
>>>> Fixes: f8244c6399d9 ("ethdev: increase port id range")
>
> .
>
next prev parent reply other threads:[~2021-04-16 10:44 UTC|newest]
Thread overview: 65+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-10 9:18 [dpdk-dev] [PATCH] " Min Hu (Connor)
2021-04-12 23:08 ` Ferruh Yigit
2021-04-13 3:23 ` Min Hu (Connor)
2021-04-13 3:22 ` [dpdk-dev] [PATCH v2] " Min Hu (Connor)
2021-04-13 8:44 ` Andrew Rybchenko
2021-04-13 8:58 ` Thomas Monjalon
2021-04-13 9:24 ` Ferruh Yigit
2021-04-14 11:12 ` Min Hu (Connor)
2021-04-29 17:48 ` Tyler Retzlaff
2021-04-29 18:18 ` Stephen Hemminger
2021-04-14 11:11 ` [dpdk-dev] [PATCH v3] " Min Hu (Connor)
2021-04-14 12:00 ` Andrew Rybchenko
2021-04-15 0:52 ` Min Hu (Connor)
2021-04-15 0:52 ` [dpdk-dev] [PATCH v4] " Min Hu (Connor)
2021-04-15 8:15 ` Andrew Rybchenko
2021-04-15 11:09 ` Min Hu (Connor)
2021-04-15 11:57 ` Thomas Monjalon
2021-04-15 12:03 ` Andrew Rybchenko
2021-04-15 12:20 ` Thomas Monjalon
2021-04-15 12:43 ` Andrew Rybchenko
2021-04-15 12:04 ` Kevin Traynor
2021-04-15 12:15 ` Thomas Monjalon
2021-04-16 7:01 ` Min Hu (Connor)
2021-04-16 7:00 ` Min Hu (Connor)
2021-04-16 10:09 ` Kevin Traynor
2021-04-16 10:44 ` Min Hu (Connor) [this message]
2021-04-15 11:09 ` [dpdk-dev] [PATCH v5] " Min Hu (Connor)
2021-04-15 15:38 ` Ferruh Yigit
2021-04-16 7:02 ` Min Hu (Connor)
2021-04-16 16:19 ` Stephen Hemminger
2021-04-15 15:45 ` Ferruh Yigit
2021-04-15 16:21 ` Thomas Monjalon
2021-04-16 7:04 ` Min Hu (Connor)
2021-04-16 16:25 ` Stephen Hemminger
2021-04-16 6:52 ` [dpdk-dev] [PATCH v6] " Min Hu (Connor)
2021-04-16 10:22 ` Kevin Traynor
2021-04-16 11:00 ` Min Hu (Connor)
2021-04-16 16:28 ` Stephen Hemminger
2021-04-17 0:28 ` Min Hu (Connor)
2021-04-17 21:37 ` Thomas Monjalon
2021-04-19 0:34 ` Min Hu (Connor)
2021-04-17 7:42 ` Min Hu (Connor)
2021-04-16 11:00 ` [dpdk-dev] [PATCH v7] " Min Hu (Connor)
2021-04-16 11:31 ` Ferruh Yigit
2021-04-16 12:02 ` Thomas Monjalon
2021-04-17 7:39 ` Min Hu (Connor)
2021-04-17 7:39 ` [dpdk-dev] [PATCH v8] " Min Hu (Connor)
2021-04-20 10:04 ` Thomas Monjalon
2021-04-20 13:59 ` Ferruh Yigit
2021-04-20 14:20 ` Kevin Traynor
2021-04-20 14:33 ` Thomas Monjalon
2021-04-21 2:36 ` [dpdk-dev] [PATCH v9] " Ferruh Yigit
2021-04-21 10:48 ` Thomas Monjalon
2021-04-21 11:28 ` Andrew Rybchenko
2021-04-21 12:36 ` Min Hu (Connor)
2021-04-21 12:38 ` Kevin Traynor
2021-04-21 13:19 ` Ferruh Yigit
2021-04-21 13:40 ` Ferruh Yigit
2021-04-21 13:50 ` Andrew Rybchenko
2021-04-21 13:50 ` Andrew Rybchenko
2021-04-21 14:17 ` Ferruh Yigit
2021-04-21 12:36 ` [dpdk-dev] [PATCH v10] " Min Hu (Connor)
2021-04-21 14:19 ` Ferruh Yigit
2021-04-21 16:22 ` Ferruh Yigit
2021-04-21 17:16 ` Ferruh Yigit
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=146942ea-a3f3-a201-9089-63c883737d49@huawei.com \
--to=humin29@huawei.com \
--cc=andrew.rybchenko@oktetlabs.ru \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
--cc=ktraynor@redhat.com \
--cc=thomas@monjalon.net \
/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;
as well as URLs for NNTP newsgroup(s).