From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 7DD11A0A0F;
	Wed, 30 Jun 2021 11:08:47 +0200 (CEST)
Received: from [217.70.189.124] (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 10CF340141;
	Wed, 30 Jun 2021 11:08:47 +0200 (CEST)
Received: from mga07.intel.com (mga07.intel.com [134.134.136.100])
 by mails.dpdk.org (Postfix) with ESMTP id 7BB2340040
 for <dev@dpdk.org>; Wed, 30 Jun 2021 11:08:45 +0200 (CEST)
X-IronPort-AV: E=McAfee;i="6200,9189,10030"; a="272172212"
X-IronPort-AV: E=Sophos;i="5.83,311,1616482800"; d="scan'208";a="272172212"
Received: from orsmga006.jf.intel.com ([10.7.209.51])
 by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 30 Jun 2021 02:08:44 -0700
X-IronPort-AV: E=Sophos;i="5.83,311,1616482800"; d="scan'208";a="408491316"
Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.213.221.90])
 ([10.213.221.90])
 by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 30 Jun 2021 02:08:41 -0700
To: David Marchand <david.marchand@redhat.com>
Cc: Cristian Dumitrescu <cristian.dumitrescu@intel.com>,
 Jasvinder Singh <jasvinder.singh@intel.com>,
 Thomas Monjalon <thomas@monjalon.net>,
 Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>, dev <dev@dpdk.org>,
 Dodji Seketeli <dodji@redhat.com>, Qi Zhang <qi.z.zhang@intel.com>,
 Raslan Darawsheh <rasland@nvidia.com>,
 Ajit Khaparde <ajit.khaparde@broadcom.com>,
 "jerinj@marvell.com" <jerinj@marvell.com>
References: <20210629134632.525037-1-ferruh.yigit@intel.com>
 <CAJFAV8xS+e2QVKMTa1vxLDz0r6Zfn5PHrSTOyZzJXDCBNR0hCA@mail.gmail.com>
From: Ferruh Yigit <ferruh.yigit@intel.com>
X-User: ferruhy
Message-ID: <2fae7aa6-f6bc-16a7-37c7-98b08c26a331@intel.com>
Date: Wed, 30 Jun 2021 10:08:38 +0100
MIME-Version: 1.0
In-Reply-To: <CAJFAV8xS+e2QVKMTa1vxLDz0r6Zfn5PHrSTOyZzJXDCBNR0hCA@mail.gmail.com>
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: 8bit
Subject: Re: [dpdk-dev] [PATCH] ethdev: add namespace
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

On 6/30/2021 7:29 AM, David Marchand wrote:
> Hello Ferruh,
> 
> On Tue, Jun 29, 2021 at 3:46 PM Ferruh Yigit <ferruh.yigit@intel.com> wrote:
>>
>> Add 'RTE_ETH' namespace to all enums & macros in a backward compatible
>> way. The macros for backward compatibility can be removed in next LTS.
>>
>> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> 
> - I did not do a full check but I noticed that ETH_RSS compat macro at
> least is removed.
> Is this intentional?
> 

Yes, two groups of macros was remaining from 2013 for backward compatibility,
with this patch it would be two layer of redicrection, so I moved to old ones.
The only changes in the examples/app are because of these removed macros, since
rest are all backward compatible.

Removed ones:
/**
 * for rx mq mode backward compatible
 */
#define ETH_RSS                       ETH_MQ_RX_RSS
#define VMDQ_DCB                      ETH_MQ_RX_VMDQ_DCB
#define ETH_DCB_RX                    ETH_MQ_RX_DCB

/**
 * for tx mq mode backward compatible
 */
#define ETH_DCB_NONE                ETH_MQ_TX_NONE
#define ETH_VMDQ_DCB_TX             ETH_MQ_TX_VMDQ_DCB
#define ETH_DCB_TX                  ETH_MQ_TX_DCB



> 
> - libabigail is not happy because of enum names changes.
> Example:
> 
>   [C] 'function int rte_eth_dev_configure(uint16_t, uint16_t,
> uint16_t, const rte_eth_conf*)' at rte_ethdev.c:1326:1 has some
> indirect sub-type changes:
>     parameter 4 of type 'const rte_eth_conf*' has sub-type changes:
>       in pointed to type 'const rte_eth_conf':
>         in unqualified underlying type 'struct rte_eth_conf' at
> rte_ethdev.h:1491:1:
>           type size hasn't changed
>           5 data member changes (1 filtered):
>             type of 'rte_eth_rxmode rxmode' changed:
>               type size hasn't changed
>               1 data member change:
>                 type of 'rte_eth_rx_mq_mode mq_mode' changed:
>                   type size hasn't changed
>                   8 enumerator deletions:
>                     'rte_eth_rx_mq_mode::ETH_MQ_RX_NONE' value '0'
>                     'rte_eth_rx_mq_mode::ETH_MQ_RX_RSS' value '1'
>                     'rte_eth_rx_mq_mode::ETH_MQ_RX_DCB' value '2'
>                     'rte_eth_rx_mq_mode::ETH_MQ_RX_DCB_RSS' value '3'
>                     'rte_eth_rx_mq_mode::ETH_MQ_RX_VMDQ_ONLY' value '4'
>                     'rte_eth_rx_mq_mode::ETH_MQ_RX_VMDQ_RSS' value '5'
>                     'rte_eth_rx_mq_mode::ETH_MQ_RX_VMDQ_DCB' value '6'
>                     'rte_eth_rx_mq_mode::ETH_MQ_RX_VMDQ_DCB_RSS' value '7'
>                   8 enumerator insertions:
>                     'rte_eth_rx_mq_mode::RTE_ETH_MQ_RX_NONE' value '0'
>                     'rte_eth_rx_mq_mode::RTE_ETH_MQ_RX_RSS' value '1'
>                     'rte_eth_rx_mq_mode::RTE_ETH_MQ_RX_DCB' value '2'
>                     'rte_eth_rx_mq_mode::RTE_ETH_MQ_RX_DCB_RSS' value '3'
>                     'rte_eth_rx_mq_mode::RTE_ETH_MQ_RX_VMDQ_ONLY' value '4'
>                     'rte_eth_rx_mq_mode::RTE_ETH_MQ_RX_VMDQ_RSS' value '5'
>                     'rte_eth_rx_mq_mode::RTE_ETH_MQ_RX_VMDQ_DCB' value '6'
>                     'rte_eth_rx_mq_mode::RTE_ETH_MQ_RX_VMDQ_DCB_RSS' value '7'
> [snip]
> 
> 
> I guess libabigail is lost because the symbol
> rte_eth_rx_mq_mode::ETH_MQ_RX_NONE simply disappeared (because we used
> a macro to wrap to the new name).

Yes.

> Maybe we could go the other way: leave the current enums defined as is
> and put in place wrappers for new names pointing as old names. 
> The rest of the code in DPDK would use the new names only.

It works to prevent libabigail warnings but I think it can be confusing for
users on figuring out which ones are the correct ones to use.

> This comment applies if we want to merge this change in 21.08 and/or
> we want to backport this change.
> 
> This won't be a problem if we merge this patch in 21.11.
> 

OK to have it on v21.11. In that case I assume all internal components also
needs to be updated to use new macros/enums during v21.11 release.

Let me send a deprecation notice for it.

Meanwhile, we can use this patch to discuss the prefix/namespace, if it should
be 'RTE_ETH_' or 'RTE_ETH_DEV_', or mix of both (as done now).

And if mixed prefix used, we can try to define when to have DEV_ part and when
not to have it.

> 
>> ---
>> We can get the update on v21.11 and remove backward compatibility macros
>> on v22.11.
> 
> 
>