From: David Marchand <david.marchand@redhat.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: dev <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v3] eal: rename state values in rte_lcore_state
Date: Wed, 3 Apr 2019 13:59:58 +0200 [thread overview]
Message-ID: <CAJFAV8xyQwVu43ucbcwoyvVBeaqC30AUw56WD+2i6WVodCir-Q@mail.gmail.com> (raw)
Message-ID: <20190403115958.mzffaF-L4nWGjVXzsm3_djABJg78XDeGkhRpgVEXaHo@z> (raw)
In-Reply-To: <20190402205335.13745-1-stephen@networkplumber.org>
On Tue, Apr 2, 2019 at 10:54 PM Stephen Hemminger <
stephen@networkplumber.org> wrote:
> C language does not really treat enum's as first class symbols.
> The values in an enum live in a global namespace. That means if
> DPDK defines "RUNNING" it can't be used by another enum in an
> application using DPDK.
>
> To solve this add a prefix "RTE_LCORE_" to the enum values, and
> make them grammatically consistent.
>
> Also, simplify the inline thread_is_running() which is copied
> in softnic and ip_pipeline.
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
> v3 - fix BSD and bond driver usage of state
>
>
>
> diff --git a/examples/bond/main.c b/examples/bond/main.c
> index ef86194fff4a..12123a4b16d8 100644
> --- a/examples/bond/main.c
> +++ b/examples/bond/main.c
> @@ -527,7 +527,7 @@ static void cmd_start_parsed(__attribute__((unused))
> void *parsed_result,
>
> rte_spinlock_trylock(&global_flag_stru_p->lock);
> if (global_flag_stru_p->LcoreMainIsRunning == 0) {
> - if (lcore_config[global_flag_stru_p->LcoreMainCore].state
> != WAIT) {
> + if (lcore_config[global_flag_stru_p->LcoreMainCore].state
> != RTE_LCORE_WAIT) {
> rte_spinlock_unlock(&global_flag_stru_p->lock);
> return;
> }
> @@ -796,7 +796,7 @@ main(int argc, char *argv[])
>
> /* check state of lcores */
> RTE_LCORE_FOREACH_SLAVE(slave_core_id) {
> - if (lcore_config[slave_core_id].state != WAIT)
> + if (lcore_config[slave_core_id].state != RTE_LCORE_WAIT)
> return -EBUSY;
> }
> /* start lcore main on core != master_core - ARP response thread */
>
diff --git a/lib/librte_eal/freebsd/eal/eal.c
> b/lib/librte_eal/freebsd/eal/eal.c
> index 790c6afa7050..aae4243486bd 100644
> --- a/lib/librte_eal/freebsd/eal/eal.c
> +++ b/lib/librte_eal/freebsd/eal/eal.c
> @@ -784,7 +784,7 @@ rte_eal_init(int argc, char **argv)
> if (pipe(lcore_config[i].pipe_slave2master) < 0)
> rte_panic("Cannot create pipe\n");
>
> - lcore_config[i].state = WAIT;
> + lcore_config[i].state = RTE_LCORE_WAIT;
>
> /* create a thread for each lcore */
> ret = pthread_create(&lcore_config[i].thread_id, NULL,
>
s/RTE_LCORE_WAIT/RTE_LCORE_WAITING/g
--
David Marchand
next prev parent reply other threads:[~2019-04-03 12:00 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-26 19:25 [dpdk-dev] [RFC] " Stephen Hemminger
2019-03-26 19:25 ` Stephen Hemminger
2019-03-27 0:42 ` Thomas Monjalon
2019-03-27 0:42 ` Thomas Monjalon
2019-04-02 15:57 ` [dpdk-dev] [PATCH v2] " Stephen Hemminger
2019-04-02 15:57 ` Stephen Hemminger
2019-04-02 20:15 ` David Marchand
2019-04-02 20:15 ` David Marchand
2019-04-02 20:48 ` Stephen Hemminger
2019-04-02 20:48 ` Stephen Hemminger
2019-04-02 21:03 ` David Marchand
2019-04-02 21:03 ` David Marchand
2019-04-02 21:07 ` Stephen Hemminger
2019-04-02 21:07 ` Stephen Hemminger
2019-04-02 21:21 ` David Marchand
2019-04-02 21:21 ` David Marchand
2019-04-02 20:53 ` [dpdk-dev] [PATCH v3] " Stephen Hemminger
2019-04-02 20:53 ` Stephen Hemminger
2019-04-03 11:59 ` David Marchand [this message]
2019-04-03 11:59 ` David Marchand
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=CAJFAV8xyQwVu43ucbcwoyvVBeaqC30AUw56WD+2i6WVodCir-Q@mail.gmail.com \
--to=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=stephen@networkplumber.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;
as well as URLs for NNTP newsgroup(s).