From: Stephen Hemminger <stephen@networkplumber.org>
To: huangdengdui <huangdengdui@huawei.com>
Cc: <dev@dpdk.org>, <mb@smartsharesystems.com>,
<david.marchand@redhat.com>, <roretzla@linux.microsoft.com>,
<lihuisong@huawei.com>, <fengchengwen@huawei.com>,
<liuyonglong@huawei.com>
Subject: Re: [PATCH v5] eal: fix uncheck lcore role
Date: Wed, 13 Aug 2025 09:10:15 -0700 [thread overview]
Message-ID: <20250813091015.67840747@hermes.local> (raw)
In-Reply-To: <16cd59c0-15ba-441c-ace6-8741c7586a3a@huawei.com>
On Thu, 7 Aug 2025 11:57:31 +0800
huangdengdui <huangdengdui@huawei.com> wrote:
> On 2025/8/7 11:15, Stephen Hemminger wrote:
> > On Thu, 7 Aug 2025 10:49:36 +0800
> > Dengdui Huang <huangdengdui@huawei.com> wrote:
> >
> >> diff --git a/lib/eal/common/eal_common_launch.c b/lib/eal/common/eal_common_launch.c
> >> index a7deac6ecd..be7226e4b6 100644
> >> --- a/lib/eal/common/eal_common_launch.c
> >> +++ b/lib/eal/common/eal_common_launch.c
> >> @@ -36,8 +36,15 @@ RTE_EXPORT_SYMBOL(rte_eal_remote_launch)
> >> int
> >> rte_eal_remote_launch(lcore_function_t *f, void *arg, unsigned int worker_id)
> >> {
> >> + enum rte_lcore_role_t role;
> >> int rc = -EBUSY;
> >>
> >> + role = lcore_config[worker_id].core_role;
> >> + if (role != ROLE_RTE && role != ROLE_SERVICE) {
> >> + rc = -EINVAL;
> >> + goto finish;
> >> + }
> >
> > worker_id could be any value, if it was out of the range of the array
> > you would end up reading junk.
>
> The lcore should not exceed the RTE_MAX_LCORE range, which should be a common understanding everyone.
> I believe checking it in the code is redundant, updating the documentation be a better solution.
It should be in documentation, but this an exposed API, and all non-datapath API's must
check arguments.
> Moreover, in some interfaces[1], if the lore exceeds the RTE_MAX_LCORE range, it is difficult to determine what value should be returned.
Invalid same as your other checks. or ERANGE?
>
> [1] https://elixir.bootlin.com/dpdk/v25.07/source/lib/eal/include/rte_launch.h#L112
prev parent reply other threads:[~2025-08-13 16:10 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-21 4:03 [PATCH 0/2] fix the problem of dma-perf infinite loop Dengdui Huang
2025-03-21 4:03 ` [PATCH 1/2] eal: fix wake a incorrect lcore Dengdui Huang
2025-03-21 4:03 ` [PATCH 2/2] app/dma-perf: fix infinite loop Dengdui Huang
2025-03-21 15:58 ` Stephen Hemminger
2025-03-24 3:42 ` huangdengdui
2025-03-21 7:49 ` [PATCH 0/2] fix the problem of dma-perf " David Marchand
2025-03-24 3:42 ` huangdengdui
2025-03-27 8:58 ` [PATCH] app/dma-perf: fix " Dengdui Huang
2025-03-27 8:58 ` [PATCH 1/2] eal: fix uncheck worker ID Dengdui Huang
2025-03-27 8:58 ` [PATCH 2/2] app/dma-perf: fix infinite loop Dengdui Huang
2025-03-27 9:01 ` [PATCH v2 0/2] fix the problem of dma-perf " Dengdui Huang
2025-03-27 9:01 ` [PATCH v2 1/2] eal: fix uncheck worker ID Dengdui Huang
2025-03-27 9:32 ` Morten Brørup
2025-04-02 8:28 ` huangdengdui
2025-03-27 9:01 ` [PATCH v2 2/2] app/dma-perf: fix infinite loop Dengdui Huang
2025-04-02 12:24 ` [PATCH v3 0/3] fix the problem of dma-perf " Dengdui Huang
2025-04-02 12:24 ` [PATCH v3 1/3] eal: fix uncheck lcore ID Dengdui Huang
2025-04-02 12:24 ` [PATCH v3 2/3] eal: fix unckeck pipe Dengdui Huang
2025-04-02 14:45 ` Morten Brørup
2025-04-03 8:12 ` huangdengdui
2025-04-02 12:24 ` [PATCH v3 3/3] app/dma-perf: fix infinite loop Dengdui Huang
2025-07-24 11:25 ` [PATCH v4] eal: fix uncheck lcore ID and lcore role Dengdui Huang
2025-07-24 14:44 ` Morten Brørup
2025-08-07 2:43 ` huangdengdui
2025-08-07 2:49 ` [PATCH v5] eal: fix uncheck " Dengdui Huang
2025-08-07 3:15 ` Stephen Hemminger
2025-08-07 3:57 ` huangdengdui
2025-08-13 16:10 ` Stephen Hemminger [this message]
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=20250813091015.67840747@hermes.local \
--to=stephen@networkplumber.org \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=fengchengwen@huawei.com \
--cc=huangdengdui@huawei.com \
--cc=lihuisong@huawei.com \
--cc=liuyonglong@huawei.com \
--cc=mb@smartsharesystems.com \
--cc=roretzla@linux.microsoft.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.