All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: David Marchand <david.marchand@redhat.com>
Cc: dev@dpdk.org, bruce.richardson@intel.com,
	andremue@linux.microsoft.com,
	Tyler Retzlaff <roretzla@linux.microsoft.com>,
	Jasvinder Singh <jasvinder.singh@intel.com>
Subject: Re: [PATCH v6 8/8] eal: rework function versioning macros
Date: Wed, 02 Apr 2025 13:53:23 +0200	[thread overview]
Message-ID: <5048875.4XsnlVU6TS@thomas> (raw)
In-Reply-To: <20250328105250.3082414-9-david.marchand@redhat.com>

28/03/2025 11:52, David Marchand:
> --- a/lib/eal/common/eal_symbol_exports.h
> +++ b/lib/eal/common/eal_symbol_exports.h
> @@ -5,6 +5,8 @@
>  #ifndef EAL_SYMBOL_EXPORTS_H
>  #define EAL_SYMBOL_EXPORTS_H
>  
> +#include <rte_common.h>
> +
>  /* Internal macros for exporting symbols, used by the build system.
>   * For RTE_EXPORT_EXPERIMENTAL_SYMBOL, ver indicates the
>   * version this symbol was introduced in.
> @@ -13,4 +15,68 @@
>  #define RTE_EXPORT_INTERNAL_SYMBOL(a)
>  #define RTE_EXPORT_SYMBOL(a)
>  
> +#if !defined(RTE_USE_FUNCTION_VERSIONING) && (defined(RTE_CC_GCC) || defined(RTE_CC_CLANG))
> +#define VERSIONING_WARN RTE_PRAGMA_WARNING(Use of function versioning disabled. \
> +       Is "use_function_versioning=true" in meson.build?)
> +#else
> +#define VERSIONING_WARN
> +#endif

Why no warning for other compilers?
Why not warn at Meson level?

> +
> +/*
> + * Provides backwards compatibility when updating exported functions.

I feel a word is missing. What "provides" it?

> + * When a symbol is exported from a library to provide an API, it also provides a
> + * calling convention (ABI) that is embodied in its name, return type,
> + * arguments, etc.  On occasion that function may need to change to accommodate
> + * new functionality, behavior, etc.  When that occurs, it is desirable to
> + * allow for backwards compatibility for a time with older binaries that are
> + * dynamically linked to the dpdk.
> + */
> +
> +#ifdef RTE_BUILD_SHARED_LIB
> +
> +/*

Why not Doxygen style?

> + * RTE_VERSION_SYMBOL

No need to repeat the macro name here.

> + * Creates a symbol version table entry binding symbol <name>@DPDK_<ver> to the internal

Imperative form is more usual.

> + * function name <name>_v<ver>.
> + */
> +#define RTE_VERSION_SYMBOL(ver, type, name, args) VERSIONING_WARN \
> +__asm__(".symver " RTE_STR(name) "_v" RTE_STR(ver) ", " RTE_STR(name) "@DPDK_" RTE_STR(ver)); \
> +__rte_used type name ## _v ## ver args; \
> +type name ## _v ## ver args

This is only GNU style. It should be highlighted both in this file and the commit log.

> +
> +/*
> + * RTE_VERSION_EXPERIMENTAL_SYMBOL
> + * Similar to RTE_VERSION_SYMBOL but for experimental API symbols.
> + * This is mainly used for keeping compatibility for symbols that get promoted to stable ABI.
> + */
> +#define RTE_VERSION_EXPERIMENTAL_SYMBOL(type, name, args) VERSIONING_WARN \
> +__asm__(".symver " RTE_STR(name) "_exp, " RTE_STR(name) "@EXPERIMENTAL") \
> +__rte_used type name ## _exp args; \
> +type name ## _exp args
> +
> +/*
> + * RTE_DEFAULT_SYMBOL
> + * Creates a symbol version entry instructing the linker to bind references to
> + * symbol <name> to the internal symbol <name>_v<ver>.
> + */
> +#define RTE_DEFAULT_SYMBOL(ver, type, name, args) VERSIONING_WARN \
> +__asm__(".symver " RTE_STR(name) "_v" RTE_STR(ver) ", " RTE_STR(name) "@@DPDK_" RTE_STR(ver)); \
> +__rte_used type name ## _v ## ver args; \
> +type name ## _v ## ver args

Only 3 macros, that's simple and clean, thank you.



  reply	other threads:[~2025-04-02 11:53 UTC|newest]

Thread overview: 101+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-05 21:23 [RFC] eal: add new function versioning macros David Marchand
2025-03-06  2:57 ` Patrick Robb
2025-03-06 10:23 ` Bruce Richardson
2025-03-06 12:50 ` [RFC v2 1/2] " David Marchand
2025-03-06 12:50   ` [RFC v2 2/2] build: generate symbol maps David Marchand
2025-03-06 15:45   ` [RFC v2 1/2] eal: add new function versioning macros Andre Muezerie
2025-03-11  9:55 ` [RFC v3 0/8] Symbol versioning and export rework David Marchand
2025-03-11  9:55   ` [RFC v3 1/8] lib: remove incorrect exported symbols David Marchand
2025-03-11  9:56   ` [RFC v3 2/8] drivers: " David Marchand
2025-03-11  9:56   ` [RFC v3 3/8] eal: rework function versioning macros David Marchand
2025-03-13 16:53     ` Bruce Richardson
2025-03-13 17:09       ` David Marchand
2025-03-11  9:56   ` [RFC v3 4/8] buildtools: display version when listing symbols David Marchand
2025-03-11  9:56   ` [RFC v3 5/8] build: generate symbol maps David Marchand
2025-03-13 17:26     ` Bruce Richardson
2025-03-14 15:38       ` David Marchand
2025-03-14 14:24     ` Thomas Monjalon
2025-03-14 15:38       ` David Marchand
2025-03-14 15:27     ` Andre Muezerie
2025-03-14 15:51       ` David Marchand
2025-03-11  9:56   ` [RFC v3 6/8] build: mark exported symbols David Marchand
2025-03-13 17:30     ` Bruce Richardson
2025-03-14 16:14       ` David Marchand
2025-03-14 16:23         ` Bruce Richardson
2025-03-14 16:53           ` David Marchand
2025-03-14 17:21             ` David Marchand
2025-03-14 17:28             ` Bruce Richardson
2025-03-14 17:39               ` David Marchand
2025-03-14 17:51                 ` Bruce Richardson
2025-03-11  9:56   ` [RFC v3 7/8] build: use dynamically generated version maps David Marchand
2025-03-11  9:56   ` [RFC v3 8/8] build: remove static " David Marchand
2025-03-11 10:18   ` [RFC v3 0/8] Symbol versioning and export rework Morten Brørup
2025-03-11 13:43     ` David Marchand
2025-03-17 15:42 ` [RFC v4 " David Marchand
2025-03-17 15:42   ` [RFC v4 1/8] lib: remove incorrect exported symbols David Marchand
2025-03-17 15:42   ` [RFC v4 2/8] drivers: " David Marchand
2025-03-17 15:42   ` [RFC v4 3/8] eal: rework function versioning macros David Marchand
2025-03-17 15:43   ` [RFC v4 4/8] buildtools: display version when listing symbols David Marchand
2025-03-17 15:43   ` [RFC v4 5/8] build: generate symbol maps David Marchand
2025-03-19 16:19     ` Stephen Hemminger
2025-03-19 17:12       ` David Marchand
2025-03-20 15:06         ` Andre Muezerie
2025-03-17 15:43   ` [RFC v4 6/8] build: mark exported symbols David Marchand
2025-03-17 15:43   ` [RFC v4 7/8] build: use dynamically generated version maps David Marchand
2025-03-17 15:43   ` [RFC v4 8/8] build: remove static " David Marchand
2025-03-18  8:19   ` [RFC v4 0/8] Symbol versioning and export rework David Marchand
2025-03-26 12:02   ` David Marchand
2025-03-26 12:26     ` Morten Brørup
2025-03-26 13:07     ` Bruce Richardson
2025-03-26 13:36     ` Bruce Richardson
2025-03-26 13:54       ` David Marchand
2025-03-26 14:16         ` Bruce Richardson
2025-03-27 13:36 ` [PATCH v5 " David Marchand
2025-03-27 13:36   ` [PATCH v5 1/8] lib: remove incorrect exported symbols David Marchand
2025-03-27 13:36   ` [PATCH v5 2/8] drivers: " David Marchand
2025-03-27 13:36   ` [PATCH v5 3/8] buildtools: display version when listing symbols David Marchand
2025-03-27 13:36   ` [PATCH v5 4/8] build: generate symbol maps David Marchand
2025-03-27 13:36   ` [PATCH v5 5/8] build: mark exported symbols David Marchand
2025-03-27 18:21     ` David Marchand
2025-03-27 13:36   ` [PATCH v5 6/8] build: use dynamically generated version maps David Marchand
2025-03-28 13:19     ` Aaron Conole
2025-03-27 13:36   ` [PATCH v5 7/8] build: remove static " David Marchand
2025-03-27 13:36   ` [PATCH v5 8/8] eal: rework function versioning macros David Marchand
2025-03-27 18:22   ` [PATCH v5 0/8] Symbol versioning and export rework David Marchand
2025-03-28 10:52 ` [PATCH v6 " David Marchand
2025-03-28 10:52   ` [PATCH v6 1/8] lib: remove incorrect exported symbols David Marchand
2025-03-28 10:52   ` [PATCH v6 2/8] drivers: " David Marchand
2025-03-28 10:52   ` [PATCH v6 3/8] buildtools: display version when listing symbols David Marchand
2025-04-01 16:11     ` Thomas Monjalon
2025-04-01 19:04       ` David Marchand
2025-03-28 10:52   ` [PATCH v6 4/8] build: generate symbol maps David Marchand
2025-04-01 20:25     ` Thomas Monjalon
2025-04-02  7:00       ` David Marchand
2025-04-02  8:00         ` Thomas Monjalon
2025-04-01 20:33     ` Thomas Monjalon
2025-04-02  7:01       ` David Marchand
2025-04-02  8:05     ` Thomas Monjalon
2025-04-02  9:21       ` David Marchand
2025-03-28 10:52   ` [PATCH v6 5/8] build: mark exported symbols David Marchand
2025-04-02  9:01     ` Thomas Monjalon
2025-04-02  9:23       ` David Marchand
2025-03-28 10:52   ` [PATCH v6 6/8] build: use dynamically generated version maps David Marchand
2025-03-28 13:20     ` Aaron Conole
2025-03-28 10:52   ` [PATCH v6 7/8] build: remove static " David Marchand
2025-03-28 10:52   ` [PATCH v6 8/8] eal: rework function versioning macros David Marchand
2025-04-02 11:53     ` Thomas Monjalon [this message]
2025-04-02 12:16       ` David Marchand
2025-04-03 16:58 ` [PATCH v7 0/8] Symbol versioning and export rework David Marchand
2025-04-03 16:58   ` [PATCH v7 1/8] lib: remove incorrect exported symbols David Marchand
2025-04-03 16:58   ` [PATCH v7 2/8] drivers: " David Marchand
2025-04-04  5:47     ` Hemant Agrawal
2025-04-03 16:58   ` [PATCH v7 3/8] buildtools: display symbols version from map David Marchand
2025-04-03 16:58   ` [PATCH v7 4/8] build: generate symbol maps David Marchand
2025-04-03 16:58   ` [PATCH v7 5/8] build: mark exported symbols David Marchand
2025-04-04  5:48     ` Hemant Agrawal
2025-04-04  7:16       ` Andrew Rybchenko
2025-04-04  7:16     ` Andrew Rybchenko
2025-04-03 16:58   ` [PATCH v7 6/8] build: use dynamically generated version maps David Marchand
2025-04-03 16:58   ` [PATCH v7 7/8] build: remove static " David Marchand
2025-04-03 16:58   ` [PATCH v7 8/8] eal: rework function versioning macros David Marchand
2025-04-07 13:46   ` [PATCH v7 0/8] Symbol versioning and export rework David Marchand

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=5048875.4XsnlVU6TS@thomas \
    --to=thomas@monjalon.net \
    --cc=andremue@linux.microsoft.com \
    --cc=bruce.richardson@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=jasvinder.singh@intel.com \
    --cc=roretzla@linux.microsoft.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.