From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1ACC442609; Tue, 19 Sep 2023 16:47:36 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0A4F1402C9; Tue, 19 Sep 2023 16:47:36 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id F3C06402C5 for ; Tue, 19 Sep 2023 16:47:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695134854; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=aEt0RKw9N0o07o/rd6lfrkExy+Tubmg4ral/LrkFhTY=; b=Dbs+x7VHqkKj8Ibpi4kfNoPP2MS8HDM+bU6Qua3Jdjh2ouigTXCcKwBpfZXsDjqkafkdO2 cFuC29rKsL8JCZ+MUjjVlFjIjgRpRU6kT8sbF25eD/n7C3fvxx2+BEkS1pjA/UJvHOxi6P JejFJ2M9gqp3v+S892QYLEFSRt+c1Kc= Received: from mail-lj1-f197.google.com (mail-lj1-f197.google.com [209.85.208.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-665-3bBkHTehNIWBozCmVz_TuA-1; Tue, 19 Sep 2023 10:47:33 -0400 X-MC-Unique: 3bBkHTehNIWBozCmVz_TuA-1 Received: by mail-lj1-f197.google.com with SMTP id 38308e7fff4ca-2bffe368ae3so30906311fa.2 for ; Tue, 19 Sep 2023 07:47:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695134851; x=1695739651; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aEt0RKw9N0o07o/rd6lfrkExy+Tubmg4ral/LrkFhTY=; b=PhZzb4cMZoNcODyyjxl484YzSzIEx8J3uLpX+TshqO56BJCXQTJBVg55sXnzh0QYCj H9zIdbCyg43B0BhZOTbKKXaZUN45RlYXv6kPjboMPzZaOQfmvD6VUJXr8O2etLJJiwoR hq+VZNpGkSomgYA2+HeyK7bv5oO4XAzjr5wn0PX4U5r4Mp3qeUb2vW8ZNqA8wDKniZXo 5OeyW2+kELFmCxkAr+CuMOF/S8TOd0vPpmpTk8QoQrUKf8KNaLoA+MPuh8GqWJBQYg2n tTBHZYKpqmseKKJd6X39vArMO0k/7cBw22iaGyoAsPbVfW0cbVu/DD3kHfzkiH0KHgQ1 ga/A== X-Gm-Message-State: AOJu0YxhoHvsgVPjXWxcTlGm3sZZpgPVM+EzjeTZFKj+A/e4XLHxUoRH EoME/XQMHyFK36CoA6nQ2RXZqhJDe5UVIgII9IxR+gqoCMEJnUBWLGdvQTjV8kYLpKvW7VP9PXk RIpqCCUFgm8Z6DQJJk0k= X-Received: by 2002:a2e:900d:0:b0:2bf:789e:b5dd with SMTP id h13-20020a2e900d000000b002bf789eb5ddmr10962336ljg.53.1695134851266; Tue, 19 Sep 2023 07:47:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHT4ec0T3V8CgwFJxoEzC9XJRbrWjnmoNVon90v77c2IBm2mjjtQK5mHYQ+fijDkygRGi+aRBeuPx+SwnlMkhE= X-Received: by 2002:a2e:900d:0:b0:2bf:789e:b5dd with SMTP id h13-20020a2e900d000000b002bf789eb5ddmr10962318ljg.53.1695134850954; Tue, 19 Sep 2023 07:47:30 -0700 (PDT) MIME-Version: 1.0 References: <20230802211150.939121-1-sivaprasad.tummala@amd.com> <20230811060755.481572-1-sivaprasad.tummala@amd.com> <20230811060755.481572-2-sivaprasad.tummala@amd.com> In-Reply-To: From: David Marchand Date: Tue, 19 Sep 2023 16:47:19 +0200 Message-ID: Subject: Re: [PATCH v2 2/2] eal: remove NUMFLAGS enumeration To: =?UTF-8?Q?Stanis=C5=82aw_Kardach?= , Sivaprasad Tummala Cc: Ruifeng Wang , Min Zhou , David Christensen , Bruce Richardson , Konstantin Ananyev , dev , Ferruh Yigit , Thomas Monjalon X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Hello, On Tue, Aug 15, 2023 at 8:10=E2=80=AFAM Stanis=C5=82aw Kardach wrote: > On Fri, Aug 11, 2023, 08:08 Sivaprasad Tummala 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 do= es 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 undocumen= ted 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-davi= d.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-davi= d.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? --=20 David Marchand