DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: dev <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v2] eal: rename state values in rte_lcore_state
Date: Tue, 2 Apr 2019 22:15:40 +0200	[thread overview]
Message-ID: <CAJFAV8y_UVTD7Fot++bFSwEWP3n8P03UUvZ1bJZRNkPFGSzADg@mail.gmail.com> (raw)
In-Reply-To: <20190402155722.21400-1-stephen@networkplumber.org>

On Tue, Apr 2, 2019 at 5:57 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.
>

Well, I understand this is not clean, but this patch breaks the API.



> Also, simplify the inline thread_is_running() which is copied
> in softnic and ip_pipeline.
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
> v2 - change prefix to RTE_LCORE_
>
>  drivers/event/octeontx/ssovf_evdev_selftest.c |  2 +-
>  drivers/event/sw/sw_evdev_selftest.c          |  4 ++--
>  drivers/net/softnic/rte_eth_softnic_thread.c  |  5 +----
>  examples/ip_pipeline/thread.c                 |  5 +----
>  examples/l2fwd-keepalive/main.c               |  2 +-
>  lib/librte_eal/common/eal_common_launch.c     | 12 ++++++------
>  lib/librte_eal/common/include/rte_launch.h    |  6 +++---
>  lib/librte_eal/common/rte_service.c           |  2 +-
>  lib/librte_eal/freebsd/eal/eal_thread.c       |  6 +++---
>  lib/librte_eal/linux/eal/eal.c                |  2 +-
>  lib/librte_eal/linux/eal/eal_thread.c         |  8 ++++----
>  11 files changed, 24 insertions(+), 30 deletions(-)
>

Missed a few places:

# should probably not access lcore_config directly...
examples/bond/main.c:           if
(lcore_config[global_flag_stru_p->LcoreMainCore].state != WAIT)      {
examples/bond/main.c:   if (lcore_config[slave_core_id].state != WAIT)

# BSD must have trouble building
lib/librte_eal/freebsd/eal/eal.c:               lcore_config[i].state =
WAIT;

# I suppose most comments are quite useless, but still unaligned with your
change
examples/ip_pipeline/thread.c: *    (B) Its data plane thread is in RUNNING
state.
lib/librte_eal/common/eal_common_launch.c: * Check that every SLAVE lcores
are in WAIT state, then call
lib/librte_eal/common/include/rte_eal.h: * It puts the SLAVE lcores in the
WAIT state.
lib/librte_eal/common/include/rte_launch.h: * is in the WAIT state (this is
true after the first call to
lib/librte_eal/common/include/rte_launch.h: * the RUNNING state, then calls
the function f with argument arg. Once the
lib/librte_eal/common/include/rte_launch.h: * execution is done, the remote
lcore switches to a FINISHED state and
lib/librte_eal/common/include/rte_launch.h: *   - (-EBUSY): The remote
lcore is not in a WAIT state.
lib/librte_eal/common/include/rte_launch.h: * Check that each SLAVE lcore
is in a WAIT state, then call
lib/librte_eal/common/include/rte_launch.h: *   - (-EBUSY): At least one
remote lcore is not in a WAIT state. In this
lib/librte_eal/common/include/rte_launch.h: * If the slave lcore identified
by the slave_id is in a FINISHED state,
lib/librte_eal/common/include/rte_launch.h: * switch to the WAIT state. If
the lcore is in RUNNING state, wait until
lib/librte_eal/common/include/rte_launch.h: * the lcore finishes its job
and moves to the FINISHED state.
lib/librte_eal/common/include/rte_launch.h: *   - 0: If the lcore
identified by the slave_id is in a WAIT state.
lib/librte_eal/common/include/rte_launch.h: *     FINISHED or RUNNING
state. In this case, it changes the state
lib/librte_eal/common/include/rte_launch.h: *     of the lcore to WAIT.
lib/librte_eal/common/include/rte_launch.h: * that all slave lcores are in
a WAIT state.
lib/librte_eal/freebsd/eal/eal_thread.c: * remote lcore switch in FINISHED
state.
lib/librte_eal/linux/eal/eal_thread.c: * remote lcore switch in FINISHED
state.
lib/librte_eal/linux/eal/eal_thread.c:          /* when a service core
returns, it should go directly to WAIT


-- 
David Marchand

  parent reply	other threads:[~2019-04-02 20:15 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 [this message]
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
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=CAJFAV8y_UVTD7Fot++bFSwEWP3n8P03UUvZ1bJZRNkPFGSzADg@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).