Skip to content

dpdk: introduce __rte_internal tag

Neil Horman dpdk-dev 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest10 patches 19 repliesIn review
  2. v19 patches 5 repliesSuperseded

Changes in v2 from the cover letter

Moved check-experimental-syms.sh rename to earlier in the series Updated meson build environment to support BUILDING_RTE_SDK

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10Add __rte_internal tag for functions and version targetbuildtools/check-special-syms.sh lib/librte_eal/common/include/rte_compat.h mk/internal/rte.compile-pre.mk +1 more+39 -53 replies
2/10meson: add BUILDING_RTE_SDKdrivers/meson.build lib/meson.build+2 -06 replies
3/10Exempt INTERNAL symbols from checkingdevtools/check-symbol-change.sh+7 -00 replies
4/10mark dpaa driver internal-only symbols with __rte_internaldrivers/bus/dpaa/include/fsl_bman.h drivers/bus/dpaa/include/fsl_fman.h drivers/bus/dpaa/include/fsl_qman.h +7 more+99 -1080 replies
5/10fslmc: identify internal only functions and tag them as __rte_internaldrivers/bus/fslmc/fslmc_bus.c drivers/bus/fslmc/mc/dpbp.c drivers/bus/fslmc/mc/dpci.c +21 more+269 -2645 replies
6/10dpaa2: Adjust dpaa2 driver to mark internal symbols with __rte_internaldrivers/net/dpaa2/dpaa2_ethdev.c drivers/net/dpaa2/dpaa2_ethdev.h drivers/net/dpaa2/rte_pmd_dpaa2_version.map+10 -120 replies
7/10dpaax: mark internal functions with __rte_internaldrivers/common/dpaax/dpaax_iova_table.c drivers/common/dpaax/dpaax_iova_table.h drivers/common/dpaax/rte_common_dpaax_version.map+11 -90 replies
8/10cpt: mark internal functions with __rte_internaldrivers/common/cpt/cpt_pmd_ops_helper.c drivers/common/cpt/cpt_pmd_ops_helper.h drivers/common/cpt/rte_common_cpt_version.map+9 -50 replies
9/10octeonx: mark internal functions with __rte_internaldrivers/common/octeontx/octeontx_mbox.c drivers/common/octeontx/octeontx_mbox.h drivers/common/octeontx/rte_common_octeontx_version.map+14 -70 replies
10/10dpaa2: mark internal functions with __rte_internaldrivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c drivers/crypto/dpaa2_sec/dpaa2_sec_event.h drivers/crypto/dpaa2_sec/rte_pmd_dpaa2_sec_version.map+10 -110 replies

Reviews trailers per patch

1 of 10 patches has a Reviewed-by or Acked-by.

PatchBruce Richardson
1/10
2/10A-b
3/10
4/10
5/10
6/10
7/10
8/10
9/10
10/10

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [dpdk-dev] [PATCH v2 0/10] dpdk: introduce __rte_internal tag

Hey-
Based on our recent conversations regarding the use of symbols only
meant for internal dpdk consumption (between dpdk libraries), this is an idea that I've come up with that I'd like to get some feedback on

Summary:
1) We have symbols in the DPDK that are meant to be used between DPDK libraries, but not by applications linking to them
2) We would like to document those symbols in the code, so as to note them clearly as for being meant for internal use only
3) Linker symbol visibility is a very coarse grained tool, and so there is no good way in a single library to mark items as being meant for use only by other DPDK libraries, at least not without some extensive runtime checking

Proposal:
I'm proposing that we introduce the __rte_internal tag. From a coding standpoint it works a great deal like the __rte_experimental tag in that it expempts the tagged symbol from ABI constraints (as the only users should be represented in the DPDK build environment). Additionally, the __rte_internal macro resolves differently based on the definition of the BUILDING_RTE_SDK flag (working under the assumption that said flag should only ever be set if we are actually building DPDK libraries which will make use of internal calls). If the BUILDING_RTE_SDK flag is set __rte_internal resolves to __attribute__((section "text.internal)), placing it in a special text section which is then used to validate that the the symbol appears in the INTERNAL section of the corresponding library version map). If BUILDING_RTE_SDK is not set, then __rte_internal resolves to __attribute__((error("..."))), which causes any caller of the tagged function to throw an error at compile time, indicating that the symbol is not available for external use.

This isn't a perfect solution, as applications can still hack around it of course, but I think it hits some of the high points, restricting symbol access for any library that prototypes its public and private symbols in the same header file, excluding the internal symbols from ABI constraints, and clearly documenting those symbols which we wish to limit to internal usage.

CC Jerin Jacob Kollanukkaran <[email protected]>
CC Bruce Richardson <[email protected]>
CC Thomas Monjalon <[email protected]>

---
Change notes

v1->v2
Moved check-experimental-syms.sh rename to earlier in the series Updated meson build environment to support BUILDING_RTE_SDK