[dpdk-dev] [PATCH v2] eal: rename state values in rte_lcore_state

David Marchand david.marchand at redhat.com
Tue Apr 2 23:03:06 CEST 2019


On Tue, Apr 2, 2019 at 10:48 PM Stephen Hemminger <
stephen at networkplumber.org> wrote:

> On Tue, 2 Apr 2019 22:15:40 +0200
> David Marchand <david.marchand at redhat.com> wrote:
>
> > On Tue, Apr 2, 2019 at 5:57 PM Stephen Hemminger <
> stephen at 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.
>
> The lcore state was marked as internal in the header file, code that
> ignores that is going to have problems. The values are the same.
>
> We could defer this to 19.11 (next LTS) since it is cosmetic.
>

We must announce it before changing.


At that time, I am willing to do more work to make lcore_config hidden;
> ie no inline's to access it.
>

Ah I was looking at that, to see if we could at least shoot the direct
accesses by calling the existing API.
I can see we are missing one wrapper for the cpu id...

And there are quite some odds things in with cpu affinity in dpaa:
drivers/bus/dpaa/dpaa_bus.c:    cpu = lcore_config[lcore].core_id;
drivers/bus/dpaa/dpaa_bus.c:
&lcore_config[lcore].cpuset);
drivers/bus/fslmc/portal/dpaa2_hw_dpio.c:                       if
(CPU_ISSET(i, &lcore_config[lcore_id].cpuset)) {


-- 
David Marchand


More information about the dev mailing list