From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0C6AEA0352; Thu, 14 May 2020 15:39:32 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DAF921BE85; Thu, 14 May 2020 15:39:31 +0200 (CEST) Received: from dal3relay55.mxroute.com (dal3relay55.mxroute.com [64.40.27.55]) by dpdk.org (Postfix) with ESMTP id 9EA552BA2 for ; Thu, 14 May 2020 15:39:30 +0200 (CEST) Received: from filter003.mxroute.com ([168.235.111.26] 168-235-111-26.cloud.ramnode.com) (Authenticated sender: mN4UYu2MZsgR) by dal3relay55.mxroute.com (ZoneMTA) with ESMTPSA id 172136942f000075bf.001 for (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256); Thu, 14 May 2020 13:39:25 +0000 X-Zone-Loop: 82443a1379de611e4afe47de7c4ac63dd04a266d2336 X-Originating-IP: [168.235.111.26] Received: from galaxy.mxroute.com (unknown [23.92.70.113]) by filter003.mxroute.com (Postfix) with ESMTPS id 06D2A6002C; Thu, 14 May 2020 13:39:19 +0000 (UTC) Received: from [192.198.151.44] (helo=localhost) by galaxy.mxroute.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.91) (envelope-from ) id 1jZDdb-0007mV-H3; Thu, 14 May 2020 09:10:59 -0400 From: Ray Kinsella To: dev@dpdk.org Cc: Ray Kinsella , Ferruh Yigit , Kevin Traynor , David Marchand , Neil Horman , John McNamara , Marko Kovacevic Date: Thu, 14 May 2020 14:38:57 +0100 Message-Id: <1589463539-1988-1-git-send-email-mdr@ashroe.eu> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1580915872-1686-1-git-send-email-mdr@ashroe.eu> References: <1580915872-1686-1-git-send-email-mdr@ashroe.eu> X-AuthUser: mdr@ashroe.eu Subject: [dpdk-dev] [PATCH v5] doc: alias to experimental tag for stable apis X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" When a maintainer is promoting an API to become part of the next major ABI version by removing the experimental tag, possibly a few releases in advance of the declaration of the next ABI version. The maintainer may choose to offer an alias to the experimental tag, as removing the tag before the declaration of the next major ABI version, would cause an ABI breakage for applications using the API. Signed-off-by: Ray Kinsella Acked-by: Ferruh Yigit Acked-by: Kevin Traynor --- This patch depends on "doc: fix references to bind_default_symbol". https://patches.dpdk.org/patch/69850/ v5: * Added section on aliasing to experimental. requested by Neil Horman CC: Ferruh Yigit CC: Kevin Traynor CC: David Marchand doc/guides/contributing/abi_policy.rst | 10 ++ doc/guides/contributing/abi_versioning.rst | 158 ++++++++++++++++++++++++++++- 2 files changed, 167 insertions(+), 1 deletion(-) diff --git a/doc/guides/contributing/abi_policy.rst b/doc/guides/contributing/abi_policy.rst index 86e7dd9..c33bff1 100644 --- a/doc/guides/contributing/abi_policy.rst +++ b/doc/guides/contributing/abi_policy.rst @@ -160,6 +160,11 @@ The requirements for changing the ABI are: ``experimental``, as described in the section on :ref:`Experimental APIs and Libraries `. + - In situations in which an ``experimental`` symbol has been stable for some + time. When promoting the symbol to become part of the next ABI version, the + maintainer may choose to provide an alias to the ``experimental`` tag, so + as not to break consuming applications. + #. If a newly proposed API functionally replaces an existing one, when the new API becomes non-experimental, then the old one is marked with ``__rte_deprecated``. @@ -318,6 +323,11 @@ not required. Though, an API should remain in experimental state for at least one release. Thereafter, the normal process of posting patch for review to mailing list can be followed. +After the experimental tag has been formally removed, a tree/sub-tree maintainer +may choose to offer an alias to the experimental tag so as not to break +applications using the symbol. The alias is then dropped at the declaration of +next major ABI version. + Libraries ~~~~~~~~~ diff --git a/doc/guides/contributing/abi_versioning.rst b/doc/guides/contributing/abi_versioning.rst index 7065979..4832e8f 100644 --- a/doc/guides/contributing/abi_versioning.rst +++ b/doc/guides/contributing/abi_versioning.rst @@ -156,6 +156,11 @@ The macros exported are: ``be`` to signal that it is being used as an implementation of a particular version of symbol ``b``. +* ``VERSION_SYMBOL_EXPERIMENTAL(b, e)``: Creates a symbol version table entry + binding versioned symbol ``b@EXPERIMENTAL`` to the internal function ``be``. + The macro is used when a symbol matures to become part of the stable ABI, to + provide an alias to experimental for some time. + .. _example_abi_macro_usage: Examples of ABI Macro use @@ -361,7 +366,7 @@ and a new DPDK_21 version, used by future built applications. .. note:: **Before you leave**, please take care to the review the sections on - :ref:`Mapping static symbols `, :ref:`Enabling + :ref:`mapping static symbols `, :ref:`enabling versioning macros ` and :ref:`ABI deprecation `. @@ -415,6 +420,157 @@ at the start of the head of the file. This will indicate to the tool-chain to enable the function version macros when building. There is no corresponding directive required for the ``make`` build system. +.. _aliasing_experimental_symbols: + +Aliasing experimental symbols +_____________________________ + +In situations in which an ``experimental`` symbol has been stable for some time, +and it becomes a candidate for promotion to the stable ABI. At this time, when +promoting the symbol, maintainer may choose to provide an alias to the +``experimental`` symbol version, so as not to break consuming applications. + +The process to provide an alias to ``experimental`` is similar to that, of +:ref:`symbol visioning ` described above. Assume we +have an experimental function ``rte_acl_create`` as follows + +.. code-block:: c + + #include ; + + /* + * Create an acl context object for apps to + * manipulate + */ + __rte_experimental + struct rte_acl_ctx * + rte_acl_create(const struct rte_acl_param *param) + { + ... + } + +In the map file, experimental symbols are listed as part of the ``experimental`` +version node. + +.. code-block:: none + + DPDK_20 { + global: + ... + + local: *; + }; + + EXPERIMENTAL { + global: + + rte_acl_create + }; + +When we promote the symbol to the stable ABI, we simply strip the +``rte_experimental`` annotation from the function and move the symbol from the +``experimental`` node, to the node of the next major ABI version as follow. + +.. code-block:: c + + /* + * Create an acl context object for apps to + * manipulate + */ + struct rte_acl_ctx * + rte_acl_create(const struct rte_acl_param *param) + { + ... + } + +We then update the map file, adding the symbol ``rte_acl_create`` to the ``v21`` +version node. + +.. code-block:: none + + DPDK_20 { + global: + ... + + local: *; + }; + + DPDK_21 { + global: + + rte_acl_create + } DPDK_20; + + +Although there are strictly no guarantees or commitments associated with +:ref:`experimental symbols `, a maintainer may wish to offer +an alias to experimental. The process to add an alias to experimental, is +similar to the symbol versioning process. Assuming we have an experimental +symbol as before, we now add the symbol to both the ``experimental`` and ``v21`` +version nodes. + +.. code-block:: c + + #include ; + #include ; + + /* + * Create an acl context object for apps to + * manipulate + */ + struct rte_acl_ctx * + rte_acl_create(const struct rte_acl_param *param) + { + ... + } + + __rte_experimental + struct rte_acl_ctx * + rte_acl_create_e(const struct rte_acl_param *param) + { + return rte_acl_create(param); + } + VERSION_SYMBOL_EXPERIMENTAL(rte_acl_create, _e); + + struct rte_acl_ctx * + rte_acl_create_v21(const struct rte_acl_param *param) + { + return rte_acl_create(param); + } + BIND_DEFAULT_SYMBOL(rte_acl_create, _v21, 21); + + +In the map file, we map the symbol to both the experimental and ``v21`` version +nodes. + +.. code-block:: none + + DPDK_20 { + global: + ... + + local: *; + }; + + DPDK_21 { + global: + + rte_acl_create + } DPDK_20; + + EXPERIMENTAL { + global: + + rte_acl_create + }; + +.. note:: + + Please note, similar to :ref:`symbol visioning ` + when aliasing to experimental you will also need to take care of + :ref:`mapping static symbols `. + + .. _abi_decprecation: Deprecating part of a public API -- 2.7.4