DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: "Stanisław Kardach" <kda@semihalf.com>,
	"Sivaprasad Tummala" <sivaprasad.tummala@amd.com>
Cc: Ruifeng Wang <ruifeng.wang@arm.com>,
	Min Zhou <zhoumin@loongson.cn>,
	 David Christensen <drc@linux.vnet.ibm.com>,
	Bruce Richardson <bruce.richardson@intel.com>,
	 Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>,
	dev <dev@dpdk.org>,  Ferruh Yigit <ferruh.yigit@amd.com>,
	Thomas Monjalon <thomas@monjalon.net>
Subject: Re: [PATCH v2 2/2] eal: remove NUMFLAGS enumeration
Date: Tue, 19 Sep 2023 16:47:19 +0200	[thread overview]
Message-ID: <CAJFAV8wh9XigLwMkHu5bc0WRKPbSmi1veg3jeiEjZfXKu8qekQ@mail.gmail.com> (raw)
In-Reply-To: <CALVGJWJoCsnOk_b4+uXCjYEs1krN-s=wEerpJWuTFnaY_nsrLQ@mail.gmail.com>

Hello,

On Tue, Aug 15, 2023 at 8:10 AM Stanisław Kardach <kda@semihalf.com> wrote:
> On Fri, Aug 11, 2023, 08:08 Sivaprasad Tummala <sivaprasad.tummala@amd.com> wrote:
>> diff --git a/lib/eal/arm/include/rte_cpuflags_32.h b/lib/eal/arm/include/rte_cpuflags_32.h
>> index 4e254428a2..41ab0d5f21 100644
>> --- a/lib/eal/arm/include/rte_cpuflags_32.h
>> +++ b/lib/eal/arm/include/rte_cpuflags_32.h
>> @@ -43,7 +43,6 @@ enum rte_cpu_flag_t {
>>         RTE_CPUFLAG_V7L,
>>         RTE_CPUFLAG_V8L,
>>         /* The last item */
>> -       RTE_CPUFLAG_NUMFLAGS,/**< This should always be the last! */
>>  };
>
> Since there is no description of V1 to V2 changes, could you point me to what has changed?

Siva? I did not see a reply on this question.


> Also I see you're still removing the RTE_CPUFLAG_NUMFLAGS (what I call a last element canary). Why? If you're concerned with ABI, then we're talking about an application linking dynamically with DPDK or talking via some RPC channel with another DPDK application. So clashing with this definition does not come into question. One should rather use rte_cpu_get_flag_enabled().
> Also if you want to introduce new features, one would add them yo the rte_cpuflags headers, unless you'd like to not add those and keep an undocumented list "above" the last defined element.
> Could you explain a bit more Your use-case?

Hey Stanislaw,

Talking generically, one problem with such pattern (having a LAST, or
MAX enum) is when an array sized with such a symbol is exposed.
As I mentionned in the past, this can have unwanted effects:
https://patchwork.dpdk.org/project/dpdk/patch/20230919140430.3251493-1-david.marchand@redhat.com/

Another issue is when an existing enum meaning changes: from the
application pov, the (old) MAX value is incorrect, but for the library
pov, a new meaning has been associated.
This may trigger bugs in the application when calling a function that
returns such an enum which never return this MAX value in the past.

For at least those two reasons, removing those canary elements is
being done in DPDK.

This specific removal has been announced:
https://patchwork.dpdk.org/project/dpdk/patch/20230919140430.3251493-1-david.marchand@redhat.com/

Now, practically, when I look at the cpuflags API, I don't see us
exposed to those two issues wrt rte_cpu_flag_t, so maybe this change
is unneeded.
But on the other hand, is it really an issue for an application to
lose this (internal) information?


-- 
David Marchand


  reply	other threads:[~2023-09-19 14:47 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-02 21:11 [PATCH 1/2] eal: remove RTE_CPUFLAG_NUMFLAGS Sivaprasad Tummala
2023-08-02 21:11 ` [PATCH 2/2] test/cpuflags: " Sivaprasad Tummala
2023-08-02 23:50 ` [PATCH 1/2] eal: " Stanisław Kardach
2023-08-11  4:02   ` Tummala, Sivaprasad
2023-08-11  6:07 ` [PATCH v2 1/2] test/cpuflags: removed test for NUMFLAGS Sivaprasad Tummala
2023-08-11  6:07   ` [PATCH v2 2/2] eal: remove NUMFLAGS enumeration Sivaprasad Tummala
2023-08-15  6:10     ` Stanisław Kardach
2023-09-19 14:47       ` David Marchand [this message]
2023-09-20  6:00         ` Stanisław Kardach
2023-09-20  7:34           ` David Marchand
2023-09-21 13:18             ` Tummala, Sivaprasad
2023-09-21 14:49               ` Stanisław Kardach
2023-09-27 11:55                 ` Ferruh Yigit
2023-09-27 13:48                   ` Stanisław Kardach
2023-09-27 14:09                     ` Ferruh Yigit
2023-09-27 15:03                       ` Stanisław Kardach
2023-09-27 16:13                         ` Ferruh Yigit
2023-09-27 13:13     ` Ferruh Yigit
2023-09-28  9:31       ` Tummala, Sivaprasad
2023-10-06  8:27     ` David Marchand
2023-10-06 11:19       ` 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=CAJFAV8wh9XigLwMkHu5bc0WRKPbSmi1veg3jeiEjZfXKu8qekQ@mail.gmail.com \
    --to=david.marchand@redhat.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=drc@linux.vnet.ibm.com \
    --cc=ferruh.yigit@amd.com \
    --cc=kda@semihalf.com \
    --cc=konstantin.v.ananyev@yandex.ru \
    --cc=ruifeng.wang@arm.com \
    --cc=sivaprasad.tummala@amd.com \
    --cc=thomas@monjalon.net \
    --cc=zhoumin@loongson.cn \
    /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).