From patchwork Sat May 25 18:43:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Horman X-Patchwork-Id: 53699 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4E1FA5689; Sat, 25 May 2019 20:44:37 +0200 (CEST) Received: from smtp.tuxdriver.com (charlotte.tuxdriver.com [70.61.120.58]) by dpdk.org (Postfix) with ESMTP id C3EDC343C for ; Sat, 25 May 2019 20:44:32 +0200 (CEST) Received: from cpe-2606-a000-111b-405a-0-0-0-162e.dyn6.twc.com ([2606:a000:111b:405a::162e] helo=hmswarspite.think-freely.org) by smtp.tuxdriver.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1hUbeY-00069a-1V; Sat, 25 May 2019 14:44:29 -0400 Received: from hmswarspite.think-freely.org (localhost [127.0.0.1]) by hmswarspite.think-freely.org (8.15.2/8.15.2) with ESMTP id x4PIhsWo028300; Sat, 25 May 2019 14:43:54 -0400 Received: (from nhorman@localhost) by hmswarspite.think-freely.org (8.15.2/8.15.2/Submit) id x4PIhsj7028299; Sat, 25 May 2019 14:43:54 -0400 From: Neil Horman To: dev@dpdk.org Cc: Neil Horman , Jerin Jacob Kollanukkaran , Bruce Richardson , Thomas Monjalon Date: Sat, 25 May 2019 14:43:45 -0400 Message-Id: <20190525184346.27932-2-nhorman@tuxdriver.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190525184346.27932-1-nhorman@tuxdriver.com> References: <20190525184346.27932-1-nhorman@tuxdriver.com> MIME-Version: 1.0 X-Spam-Score: -2.9 (--) X-Spam-Status: No Subject: [dpdk-dev] [RFC PATCH 1/2] Add __rte_internal tag for functions and version target 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" This tag is meant to be used on function prototypes to identify functions that are only meant to be used by internal DPDK libraries (i.e. libraries that are built while building the SDK itself, as identified by the defining of the BUILDING_RTE_SDK macro). When that flag is not set, it will resolve to an error function attribute, causing build breakage for any compilation unit attempting to build it Validate the use of this tag in much the same way we validate __rte_experimental. By adding an INTERNAL version to library map files, we can exempt internal-only functions from ABI checking, and handle them to ensure that symbols we wish to only be for internal use between dpdk libraries are properly tagged with __rte_experimental Note this patch updates the check-experimental-syms.sh script, which normally only check the EXPERIMENTAL section to also check the INTERNAL section now. As such its been renamed to the now more appropriate check-special-syms.sh Signed-off-by: Neil Horman CC: Jerin Jacob Kollanukkaran CC: Bruce Richardson CC: Thomas Monjalon --- buildtools/check-experimental-syms.sh | 24 +++++++++++++++++++++- lib/librte_eal/common/include/rte_compat.h | 12 +++++++++++ mk/internal/rte.compile-pre.mk | 6 +++--- mk/target/generic/rte.vars.mk | 2 +- 4 files changed, 39 insertions(+), 5 deletions(-) diff --git a/buildtools/check-experimental-syms.sh b/buildtools/check-experimental-syms.sh index 7d1f3a568..63682c677 100755 --- a/buildtools/check-experimental-syms.sh +++ b/buildtools/check-experimental-syms.sh @@ -31,10 +31,32 @@ do cat >&2 <<- END_OF_MESSAGE $SYM is not flagged as experimental but is listed in version map - Please add __rte_experimental to the definition of $SYM + Please add __rte_experimental to the definition/prototype of $SYM END_OF_MESSAGE exit 1 fi done + +for i in `awk 'BEGIN {found=0} + /.*INTERNAL.*/ {found=1} + /.*}.*;/ {found=0} + /.*;/ {if (found == 1) print $1}' $MAPFILE` +do + SYM=`echo $i | sed -e"s/;//"` + objdump -t $OBJFILE | grep -q "\.text.*$SYM$" + IN_TEXT=$? + objdump -t $OBJFILE | grep -q "\.text\.internal.*$SYM$" + IN_EXP=$? + if [ $IN_TEXT -eq 0 -a $IN_EXP -ne 0 ] + then + cat >&2 <<- END_OF_MESSAGE + $SYM is not flagged as internal + but is listed in version map + Please add __rte_internal to the definition/prototype of $SYM + END_OF_MESSAGE + exit 1 + fi +done + exit 0 diff --git a/lib/librte_eal/common/include/rte_compat.h b/lib/librte_eal/common/include/rte_compat.h index 92ff28faf..739e8485c 100644 --- a/lib/librte_eal/common/include/rte_compat.h +++ b/lib/librte_eal/common/include/rte_compat.h @@ -89,4 +89,16 @@ __attribute__((section(".text.experimental"))) #endif +/* + * __rte_internal tags mark functions as internal only, If specified in public + * header files, this tag will resolve to an error directive, preventing + * external applications from attempting to make calls to functions not meant + * for consumption outside the dpdk library + */ +#ifdef BUILDING_RTE_SDK +#define __rte_internal __attribute__((section(".text.internal"))) +#else +#define __rte_internal __attribute__((error("This function cannot be used outside of the core DPDK library"), \ + section(".text.internal"))) +#endif #endif /* _RTE_COMPAT_H_ */ diff --git a/mk/internal/rte.compile-pre.mk b/mk/internal/rte.compile-pre.mk index 0cf3791b4..f1d97ef76 100644 --- a/mk/internal/rte.compile-pre.mk +++ b/mk/internal/rte.compile-pre.mk @@ -56,8 +56,8 @@ C_TO_O = $(CC) -Wp,-MD,$(call obj2dep,$(@)).tmp $(CPPFLAGS) $(CFLAGS) \ C_TO_O_STR = $(subst ','\'',$(C_TO_O)) #'# fix syntax highlight C_TO_O_DISP = $(if $(V),"$(C_TO_O_STR)"," CC $(@)") endif -EXPERIMENTAL_CHECK = $(RTE_SDK)/buildtools/check-experimental-syms.sh -CHECK_EXPERIMENTAL = $(EXPERIMENTAL_CHECK) $(SRCDIR)/$(EXPORT_MAP) $@ +SPECIAL_SYM_CHECK = $(RTE_SDK)/buildtools/check-special-syms.sh +CHECK_SPECIAL_SYMS = $(SPECIAL_SYM_CHECK) $(SRCDIR)/$(EXPORT_MAP) $@ PMDINFO_GEN = $(RTE_SDK_BIN)/app/dpdk-pmdinfogen $@ $@.pmd.c PMDINFO_CC = $(CC) $(CPPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@.pmd.o $@.pmd.c @@ -75,7 +75,7 @@ C_TO_O_DO = @set -e; \ echo $(C_TO_O_DISP); \ $(C_TO_O) && \ $(PMDINFO_TO_O) && \ - $(CHECK_EXPERIMENTAL) && \ + $(CHECK_SPECIAL_SYMS) && \ echo $(C_TO_O_CMD) > $(call obj2cmd,$(@)) && \ sed 's,'$@':,dep_'$@' =,' $(call obj2dep,$(@)).tmp > $(call obj2dep,$(@)) && \ rm -f $(call obj2dep,$(@)).tmp diff --git a/mk/target/generic/rte.vars.mk b/mk/target/generic/rte.vars.mk index 25a578ad7..ed6a0c87b 100644 --- a/mk/target/generic/rte.vars.mk +++ b/mk/target/generic/rte.vars.mk @@ -96,7 +96,7 @@ LDFLAGS += -L$(RTE_OUTPUT)/lib # defined. ifeq ($(BUILDING_RTE_SDK),1) # building sdk -CFLAGS += -include $(RTE_OUTPUT)/include/rte_config.h +CFLAGS += -include $(RTE_OUTPUT)/include/rte_config.h -DBUILDING_RTE_SDK else # if we are building an external application, include SDK's lib and # includes too From patchwork Sat May 25 18:43:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Horman X-Patchwork-Id: 53700 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id F2DD01B946; Sat, 25 May 2019 20:44:44 +0200 (CEST) Received: from smtp.tuxdriver.com (charlotte.tuxdriver.com [70.61.120.58]) by dpdk.org (Postfix) with ESMTP id 41A9F4F91 for ; Sat, 25 May 2019 20:44:43 +0200 (CEST) Received: from cpe-2606-a000-111b-405a-0-0-0-162e.dyn6.twc.com ([2606:a000:111b:405a::162e] helo=hmswarspite.think-freely.org) by smtp.tuxdriver.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1hUbeY-00069b-J3; Sat, 25 May 2019 14:44:40 -0400 Received: from hmswarspite.think-freely.org (localhost [127.0.0.1]) by hmswarspite.think-freely.org (8.15.2/8.15.2) with ESMTP id x4PIhtWj028304; Sat, 25 May 2019 14:43:55 -0400 Received: (from nhorman@localhost) by hmswarspite.think-freely.org (8.15.2/8.15.2/Submit) id x4PIhtrS028303; Sat, 25 May 2019 14:43:55 -0400 From: Neil Horman To: dev@dpdk.org Cc: Neil Horman , Jerin Jacob Kollanukkaran , Bruce Richardson , Thomas Monjalon Date: Sat, 25 May 2019 14:43:46 -0400 Message-Id: <20190525184346.27932-3-nhorman@tuxdriver.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190525184346.27932-1-nhorman@tuxdriver.com> References: <20190525184346.27932-1-nhorman@tuxdriver.com> MIME-Version: 1.0 X-Spam-Score: -2.9 (--) X-Spam-Status: No Subject: [dpdk-dev] [RFC PATCH 2/2] Convert dpaa driver to tag internal-only symbols appropriately 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" make use of the new __rte_internal tag to specify symbols that should only be used by dpdk provided libraries (as specified by the BUILDING_RTE_SDK cflag Signed-off-by: Neil Horman CC: Jerin Jacob Kollanukkaran CC: Bruce Richardson CC: Thomas Monjalon --- ...rimental-syms.sh => check-special-syms.sh} | 0 drivers/bus/dpaa/include/fsl_bman.h | 12 ++-- drivers/bus/dpaa/include/fsl_fman.h | 50 ++++++++-------- drivers/bus/dpaa/include/fsl_qman.h | 60 +++++++++---------- drivers/bus/dpaa/include/fsl_usd.h | 12 ++-- drivers/bus/dpaa/include/netcfg.h | 4 +- drivers/bus/dpaa/include/of.h | 6 +- drivers/bus/dpaa/rte_bus_dpaa_version.map | 47 ++++++--------- 8 files changed, 90 insertions(+), 101 deletions(-) rename buildtools/{check-experimental-syms.sh => check-special-syms.sh} (100%) diff --git a/buildtools/check-experimental-syms.sh b/buildtools/check-special-syms.sh similarity index 100% rename from buildtools/check-experimental-syms.sh rename to buildtools/check-special-syms.sh diff --git a/drivers/bus/dpaa/include/fsl_bman.h b/drivers/bus/dpaa/include/fsl_bman.h index 0c74aba44..1835acf16 100644 --- a/drivers/bus/dpaa/include/fsl_bman.h +++ b/drivers/bus/dpaa/include/fsl_bman.h @@ -264,13 +264,13 @@ int bman_shutdown_pool(u32 bpid); * the structure provided by the caller can be released or reused after the * function returns. */ -struct bman_pool *bman_new_pool(const struct bman_pool_params *params); +struct bman_pool __rte_internal *bman_new_pool(const struct bman_pool_params *params); /** * bman_free_pool - Deallocates a Buffer Pool object * @pool: the pool object to release */ -void bman_free_pool(struct bman_pool *pool); +void __rte_internal bman_free_pool(struct bman_pool *pool); /** * bman_get_params - Returns a pool object's parameters. @@ -279,7 +279,7 @@ void bman_free_pool(struct bman_pool *pool); * The returned pointer refers to state within the pool object so must not be * modified and can no longer be read once the pool object is destroyed. */ -const struct bman_pool_params *bman_get_params(const struct bman_pool *pool); +const struct bman_pool_params __rte_internal *bman_get_params(const struct bman_pool *pool); /** * bman_release - Release buffer(s) to the buffer pool @@ -289,7 +289,7 @@ const struct bman_pool_params *bman_get_params(const struct bman_pool *pool); * @flags: bit-mask of BMAN_RELEASE_FLAG_*** options * */ -int bman_release(struct bman_pool *pool, const struct bm_buffer *bufs, u8 num, +int __rte_internal bman_release(struct bman_pool *pool, const struct bm_buffer *bufs, u8 num, u32 flags); /** @@ -302,7 +302,7 @@ int bman_release(struct bman_pool *pool, const struct bm_buffer *bufs, u8 num, * The return value will be the number of buffers obtained from the pool, or a * negative error code if a h/w error or pool starvation was encountered. */ -int bman_acquire(struct bman_pool *pool, struct bm_buffer *bufs, u8 num, +int __rte_internal bman_acquire(struct bman_pool *pool, struct bm_buffer *bufs, u8 num, u32 flags); /** @@ -317,7 +317,7 @@ int bman_query_pools(struct bm_pool_state *state); * * Return the number of the free buffers */ -u32 bman_query_free_buffers(struct bman_pool *pool); +u32 __rte_internal bman_query_free_buffers(struct bman_pool *pool); /** * bman_update_pool_thresholds - Change the buffer pool's depletion thresholds diff --git a/drivers/bus/dpaa/include/fsl_fman.h b/drivers/bus/dpaa/include/fsl_fman.h index 1d1ce8671..bd8218b3d 100644 --- a/drivers/bus/dpaa/include/fsl_fman.h +++ b/drivers/bus/dpaa/include/fsl_fman.h @@ -43,19 +43,19 @@ struct fm_status_t { } __attribute__ ((__packed__)); /* Set MAC address for a particular interface */ -int fman_if_add_mac_addr(struct fman_if *p, uint8_t *eth, uint8_t addr_num); +int __rte_internal fman_if_add_mac_addr(struct fman_if *p, uint8_t *eth, uint8_t addr_num); /* Remove a MAC address for a particular interface */ -void fman_if_clear_mac_addr(struct fman_if *p, uint8_t addr_num); +void __rte_internal fman_if_clear_mac_addr(struct fman_if *p, uint8_t addr_num); /* Get the FMAN statistics */ -void fman_if_stats_get(struct fman_if *p, struct rte_eth_stats *stats); +void __rte_internal fman_if_stats_get(struct fman_if *p, struct rte_eth_stats *stats); /* Reset the FMAN statistics */ -void fman_if_stats_reset(struct fman_if *p); +void __rte_internal fman_if_stats_reset(struct fman_if *p); /* Get all of the FMAN statistics */ -void fman_if_stats_get_all(struct fman_if *p, uint64_t *value, int n); +void __rte_internal fman_if_stats_get_all(struct fman_if *p, uint64_t *value, int n); /* Set ignore pause option for a specific interface */ void fman_if_set_rx_ignore_pause_frames(struct fman_if *p, bool enable); @@ -64,33 +64,33 @@ void fman_if_set_rx_ignore_pause_frames(struct fman_if *p, bool enable); void fman_if_conf_max_frame_len(struct fman_if *p, unsigned int max_frame_len); /* Enable/disable Rx promiscuous mode on specified interface */ -void fman_if_promiscuous_enable(struct fman_if *p); -void fman_if_promiscuous_disable(struct fman_if *p); +void __rte_internal fman_if_promiscuous_enable(struct fman_if *p); +void __rte_internal fman_if_promiscuous_disable(struct fman_if *p); /* Enable/disable Rx on specific interfaces */ -void fman_if_enable_rx(struct fman_if *p); -void fman_if_disable_rx(struct fman_if *p); +void __rte_internal fman_if_enable_rx(struct fman_if *p); +void __rte_internal fman_if_disable_rx(struct fman_if *p); /* Enable/disable loopback on specific interfaces */ -void fman_if_loopback_enable(struct fman_if *p); -void fman_if_loopback_disable(struct fman_if *p); +void __rte_internal fman_if_loopback_enable(struct fman_if *p); +void __rte_internal fman_if_loopback_disable(struct fman_if *p); /* Set buffer pool on specific interface */ -void fman_if_set_bp(struct fman_if *fm_if, unsigned int num, int bpid, +void __rte_internal fman_if_set_bp(struct fman_if *fm_if, unsigned int num, int bpid, size_t bufsize); /* Get Flow Control threshold parameters on specific interface */ -int fman_if_get_fc_threshold(struct fman_if *fm_if); +int __rte_internal fman_if_get_fc_threshold(struct fman_if *fm_if); /* Enable and Set Flow Control threshold parameters on specific interface */ -int fman_if_set_fc_threshold(struct fman_if *fm_if, +int __rte_internal fman_if_set_fc_threshold(struct fman_if *fm_if, u32 high_water, u32 low_water, u32 bpid); /* Get Flow Control pause quanta on specific interface */ -int fman_if_get_fc_quanta(struct fman_if *fm_if); +int __rte_internal fman_if_get_fc_quanta(struct fman_if *fm_if); /* Set Flow Control pause quanta on specific interface */ -int fman_if_set_fc_quanta(struct fman_if *fm_if, u16 pause_quanta); +int __rte_internal fman_if_set_fc_quanta(struct fman_if *fm_if, u16 pause_quanta); /* Set default error fqid on specific interface */ void fman_if_set_err_fqid(struct fman_if *fm_if, uint32_t err_fqid); @@ -99,36 +99,36 @@ void fman_if_set_err_fqid(struct fman_if *fm_if, uint32_t err_fqid); int fman_if_get_ic_params(struct fman_if *fm_if, struct fman_if_ic_params *icp); /* Set IC transfer params */ -int fman_if_set_ic_params(struct fman_if *fm_if, +int __rte_internal fman_if_set_ic_params(struct fman_if *fm_if, const struct fman_if_ic_params *icp); /* Get interface fd->offset value */ -int fman_if_get_fdoff(struct fman_if *fm_if); +int __rte_internal fman_if_get_fdoff(struct fman_if *fm_if); /* Set interface fd->offset value */ -void fman_if_set_fdoff(struct fman_if *fm_if, uint32_t fd_offset); +void __rte_internal fman_if_set_fdoff(struct fman_if *fm_if, uint32_t fd_offset); /* Get interface SG enable status value */ -int fman_if_get_sg_enable(struct fman_if *fm_if); +int __rte_internal fman_if_get_sg_enable(struct fman_if *fm_if); /* Set interface SG support mode */ -void fman_if_set_sg(struct fman_if *fm_if, int enable); +void __rte_internal fman_if_set_sg(struct fman_if *fm_if, int enable); /* Get interface Max Frame length (MTU) */ uint16_t fman_if_get_maxfrm(struct fman_if *fm_if); /* Set interface Max Frame length (MTU) */ -void fman_if_set_maxfrm(struct fman_if *fm_if, uint16_t max_frm); +void __rte_internal fman_if_set_maxfrm(struct fman_if *fm_if, uint16_t max_frm); /* Set interface next invoked action for dequeue operation */ void fman_if_set_dnia(struct fman_if *fm_if, uint32_t nia); /* discard error packets on rx */ -void fman_if_discard_rx_errors(struct fman_if *fm_if); +void __rte_internal fman_if_discard_rx_errors(struct fman_if *fm_if); -void fman_if_set_mcast_filter_table(struct fman_if *p); +void __rte_internal fman_if_set_mcast_filter_table(struct fman_if *p); -void fman_if_reset_mcast_filter_table(struct fman_if *p); +void __rte_internal fman_if_reset_mcast_filter_table(struct fman_if *p); int fman_if_add_hash_mac_addr(struct fman_if *p, uint8_t *eth); diff --git a/drivers/bus/dpaa/include/fsl_qman.h b/drivers/bus/dpaa/include/fsl_qman.h index e5cccbbea..85c0b9e25 100644 --- a/drivers/bus/dpaa/include/fsl_qman.h +++ b/drivers/bus/dpaa/include/fsl_qman.h @@ -1311,7 +1311,7 @@ struct qman_cgr { #define QMAN_CGR_MODE_FRAME 0x00000001 #ifdef CONFIG_FSL_QMAN_FQ_LOOKUP -void qman_set_fq_lookup_table(void **table); +void __rte_internal qman_set_fq_lookup_table(void **table); #endif /** @@ -1319,7 +1319,7 @@ void qman_set_fq_lookup_table(void **table); */ int qman_get_portal_index(void); -u32 qman_portal_dequeue(struct rte_event ev[], unsigned int poll_limit, +u32 __rte_internal qman_portal_dequeue(struct rte_event ev[], unsigned int poll_limit, void **bufs); /** @@ -1330,7 +1330,7 @@ u32 qman_portal_dequeue(struct rte_event ev[], unsigned int poll_limit, * processed via qman_poll_***() functions). Returns zero for success, or * -EINVAL if the current CPU is sharing a portal hosted on another CPU. */ -int qman_irqsource_add(u32 bits); +int __rte_internal qman_irqsource_add(u32 bits); /** * qman_irqsource_remove - remove processing sources from being interrupt-driven @@ -1340,7 +1340,7 @@ int qman_irqsource_add(u32 bits); * instead be processed via qman_poll_***() functions. Returns zero for success, * or -EINVAL if the current CPU is sharing a portal hosted on another CPU. */ -int qman_irqsource_remove(u32 bits); +int __rte_internal qman_irqsource_remove(u32 bits); /** * qman_affine_channel - return the channel ID of an portal @@ -1352,7 +1352,7 @@ int qman_irqsource_remove(u32 bits); */ u16 qman_affine_channel(int cpu); -unsigned int qman_portal_poll_rx(unsigned int poll_limit, +unsigned int __rte_internal qman_portal_poll_rx(unsigned int poll_limit, void **bufs, struct qman_portal *q); /** @@ -1363,7 +1363,7 @@ unsigned int qman_portal_poll_rx(unsigned int poll_limit, * * This function will issue a volatile dequeue command to the QMAN. */ -int qman_set_vdq(struct qman_fq *fq, u16 num, uint32_t vdqcr_flags); +int __rte_internal qman_set_vdq(struct qman_fq *fq, u16 num, uint32_t vdqcr_flags); /** * qman_dequeue - Get the DQRR entry after volatile dequeue command @@ -1373,7 +1373,7 @@ int qman_set_vdq(struct qman_fq *fq, u16 num, uint32_t vdqcr_flags); * is issued. It will keep returning NULL until there is no packet available on * the DQRR. */ -struct qm_dqrr_entry *qman_dequeue(struct qman_fq *fq); +struct qm_dqrr_entry __rte_internal *qman_dequeue(struct qman_fq *fq); /** * qman_dqrr_consume - Consume the DQRR entriy after volatile dequeue @@ -1384,7 +1384,7 @@ struct qm_dqrr_entry *qman_dequeue(struct qman_fq *fq); * This will consume the DQRR enrey and make it available for next volatile * dequeue. */ -void qman_dqrr_consume(struct qman_fq *fq, +void __rte_internal qman_dqrr_consume(struct qman_fq *fq, struct qm_dqrr_entry *dq); /** @@ -1397,7 +1397,7 @@ void qman_dqrr_consume(struct qman_fq *fq, * this function will return -EINVAL, otherwise the return value is >=0 and * represents the number of DQRR entries processed. */ -int qman_poll_dqrr(unsigned int limit); +int __rte_internal qman_poll_dqrr(unsigned int limit); /** * qman_poll @@ -1443,7 +1443,7 @@ void qman_start_dequeues(void); * (SDQCR). The requested pools are limited to those the portal has dequeue * access to. */ -void qman_static_dequeue_add(u32 pools, struct qman_portal *qm); +void __rte_internal qman_static_dequeue_add(u32 pools, struct qman_portal *qm); /** * qman_static_dequeue_del - Remove pool channels from the portal SDQCR @@ -1490,7 +1490,7 @@ void qman_dca(const struct qm_dqrr_entry *dq, int park_request); * function must be called from the same CPU as that which processed the DQRR * entry in the first place. */ -void qman_dca_index(u8 index, int park_request); +void __rte_internal qman_dca_index(u8 index, int park_request); /** * qman_eqcr_is_empty - Determine if portal's EQCR is empty @@ -1547,7 +1547,7 @@ void qman_set_dc_ern(qman_cb_dc_ern handler, int affine); * a frame queue object based on that, rather than assuming/requiring that it be * Out of Service. */ -int qman_create_fq(u32 fqid, u32 flags, struct qman_fq *fq); +int __rte_internal qman_create_fq(u32 fqid, u32 flags, struct qman_fq *fq); /** * qman_destroy_fq - Deallocates a FQ @@ -1565,7 +1565,7 @@ void qman_destroy_fq(struct qman_fq *fq, u32 flags); * qman_fq_fqid - Queries the frame queue ID of a FQ object * @fq: the frame queue object to query */ -u32 qman_fq_fqid(struct qman_fq *fq); +u32 __rte_internal qman_fq_fqid(struct qman_fq *fq); /** * qman_fq_state - Queries the state of a FQ object @@ -1577,7 +1577,7 @@ u32 qman_fq_fqid(struct qman_fq *fq); * This captures the state, as seen by the driver, at the time the function * executes. */ -void qman_fq_state(struct qman_fq *fq, enum qman_fq_state *state, u32 *flags); +void __rte_internal qman_fq_state(struct qman_fq *fq, enum qman_fq_state *state, u32 *flags); /** * qman_init_fq - Initialises FQ fields, leaves the FQ "parked" or "scheduled" @@ -1613,7 +1613,7 @@ void qman_fq_state(struct qman_fq *fq, enum qman_fq_state *state, u32 *flags); * context_a.address fields and will leave the stashing fields provided by the * user alone, otherwise it will zero out the context_a.stashing fields. */ -int qman_init_fq(struct qman_fq *fq, u32 flags, struct qm_mcc_initfq *opts); +int __rte_internal qman_init_fq(struct qman_fq *fq, u32 flags, struct qm_mcc_initfq *opts); /** * qman_schedule_fq - Schedules a FQ @@ -1642,7 +1642,7 @@ int qman_schedule_fq(struct qman_fq *fq); * caller should be prepared to accept the callback as the function is called, * not only once it has returned. */ -int qman_retire_fq(struct qman_fq *fq, u32 *flags); +int __rte_internal qman_retire_fq(struct qman_fq *fq, u32 *flags); /** * qman_oos_fq - Puts a FQ "out of service" @@ -1651,7 +1651,7 @@ int qman_retire_fq(struct qman_fq *fq, u32 *flags); * The frame queue must be retired and empty, and if any order restoration list * was released as ERNs at the time of retirement, they must all be consumed. */ -int qman_oos_fq(struct qman_fq *fq); +int __rte_internal qman_oos_fq(struct qman_fq *fq); /** * qman_fq_flow_control - Set the XON/XOFF state of a FQ @@ -1684,14 +1684,14 @@ int qman_query_fq_has_pkts(struct qman_fq *fq); * @fq: the frame queue object to be queried * @np: storage for the queried FQD fields */ -int qman_query_fq_np(struct qman_fq *fq, struct qm_mcr_queryfq_np *np); +int __rte_internal qman_query_fq_np(struct qman_fq *fq, struct qm_mcr_queryfq_np *np); /** * qman_query_fq_frmcnt - Queries fq frame count * @fq: the frame queue object to be queried * @frm_cnt: number of frames in the queue */ -int qman_query_fq_frm_cnt(struct qman_fq *fq, u32 *frm_cnt); +int __rte_internal qman_query_fq_frm_cnt(struct qman_fq *fq, u32 *frm_cnt); /** * qman_query_wq - Queries work queue lengths @@ -1721,7 +1721,7 @@ int qman_query_wq(u8 query_dedicated, struct qm_mcr_querywq *wq); * callback, or by waiting for the QMAN_FQ_STATE_VDQCR bit to disappear from the * "flags" retrieved from qman_fq_state(). */ -int qman_volatile_dequeue(struct qman_fq *fq, u32 flags, u32 vdqcr); +int __rte_internal qman_volatile_dequeue(struct qman_fq *fq, u32 flags, u32 vdqcr); /** * qman_enqueue - Enqueue a frame to a frame queue @@ -1756,9 +1756,9 @@ int qman_volatile_dequeue(struct qman_fq *fq, u32 flags, u32 vdqcr); * of an already busy hardware resource by throttling many of the to-be-dropped * enqueues "at the source". */ -int qman_enqueue(struct qman_fq *fq, const struct qm_fd *fd, u32 flags); +int __rte_internal qman_enqueue(struct qman_fq *fq, const struct qm_fd *fd, u32 flags); -int qman_enqueue_multi(struct qman_fq *fq, const struct qm_fd *fd, u32 *flags, +int __rte_internal qman_enqueue_multi(struct qman_fq *fq, const struct qm_fd *fd, u32 *flags, int frames_to_send); /** @@ -1772,7 +1772,7 @@ int qman_enqueue_multi(struct qman_fq *fq, const struct qm_fd *fd, u32 *flags, * to be processed by different frame queues. */ int -qman_enqueue_multi_fq(struct qman_fq *fq[], const struct qm_fd *fd, +__rte_internal qman_enqueue_multi_fq(struct qman_fq *fq[], const struct qm_fd *fd, int frames_to_send); typedef int (*qman_cb_precommit) (void *arg); @@ -1859,7 +1859,7 @@ int qman_shutdown_fq(u32 fqid); * @fqid: the base FQID of the range to deallocate * @count: the number of FQIDs in the range */ -int qman_reserve_fqid_range(u32 fqid, unsigned int count); +int __rte_internal qman_reserve_fqid_range(u32 fqid, unsigned int count); static inline int qman_reserve_fqid(u32 fqid) { return qman_reserve_fqid_range(fqid, 1); @@ -1878,7 +1878,7 @@ static inline int qman_reserve_fqid(u32 fqid) * than requested (though alignment will be as requested). If @partial is zero, * the return value will either be 'count' or negative. */ -int qman_alloc_pool_range(u32 *result, u32 count, u32 align, int partial); +int __rte_internal qman_alloc_pool_range(u32 *result, u32 count, u32 align, int partial); static inline int qman_alloc_pool(u32 *result) { int ret = qman_alloc_pool_range(result, 1, 0, 0); @@ -1925,7 +1925,7 @@ void qman_seed_pool_range(u32 id, unsigned int count); * any unspecified parameters) will be used rather than a modify hw hardware * (which only modifies the specified parameters). */ -int qman_create_cgr(struct qman_cgr *cgr, u32 flags, +int __rte_internal qman_create_cgr(struct qman_cgr *cgr, u32 flags, struct qm_mcc_initcgr *opts); /** @@ -1947,7 +1947,7 @@ int qman_create_cgr_to_dcp(struct qman_cgr *cgr, u32 flags, u16 dcp_portal, * is executed. This must be excuted on the same affine portal on which it was * created. */ -int qman_delete_cgr(struct qman_cgr *cgr); +int __rte_internal qman_delete_cgr(struct qman_cgr *cgr); /** * qman_modify_cgr - Modify CGR fields @@ -1963,7 +1963,7 @@ int qman_delete_cgr(struct qman_cgr *cgr); * unspecified parameters) will be used rather than a modify hw hardware (which * only modifies the specified parameters). */ -int qman_modify_cgr(struct qman_cgr *cgr, u32 flags, +int __rte_internal qman_modify_cgr(struct qman_cgr *cgr, u32 flags, struct qm_mcc_initcgr *opts); /** @@ -1991,7 +1991,7 @@ int qman_query_congestion(struct qm_mcr_querycongestion *congestion); * than requested (though alignment will be as requested). If @partial is zero, * the return value will either be 'count' or negative. */ -int qman_alloc_cgrid_range(u32 *result, u32 count, u32 align, int partial); +int __rte_internal qman_alloc_cgrid_range(u32 *result, u32 count, u32 align, int partial); static inline int qman_alloc_cgrid(u32 *result) { int ret = qman_alloc_cgrid_range(result, 1, 0, 0); @@ -2004,7 +2004,7 @@ static inline int qman_alloc_cgrid(u32 *result) * @id: the base CGR ID of the range to deallocate * @count: the number of CGR IDs in the range */ -void qman_release_cgrid_range(u32 id, unsigned int count); +void __rte_internal qman_release_cgrid_range(u32 id, unsigned int count); static inline void qman_release_cgrid(u32 id) { qman_release_cgrid_range(id, 1); diff --git a/drivers/bus/dpaa/include/fsl_usd.h b/drivers/bus/dpaa/include/fsl_usd.h index ec1ab7cee..062c0ce73 100644 --- a/drivers/bus/dpaa/include/fsl_usd.h +++ b/drivers/bus/dpaa/include/fsl_usd.h @@ -56,7 +56,7 @@ int bman_allocate_raw_portal(struct dpaa_raw_portal *portal); int bman_free_raw_portal(struct dpaa_raw_portal *portal); /* Obtain thread-local UIO file-descriptors */ -int qman_thread_fd(void); +int __rte_internal qman_thread_fd(void); int bman_thread_fd(void); /* Post-process interrupts. NB, the kernel IRQ handler disables the interrupt @@ -64,14 +64,14 @@ int bman_thread_fd(void); * processing is complete. As such, it is essential to call this before going * into another blocking read/select/poll. */ -void qman_thread_irq(void); -void bman_thread_irq(void); +void __rte_internal qman_thread_irq(void); +void __rte_internal bman_thread_irq(void); -void qman_clear_irq(void); +void __rte_internal qman_clear_irq(void); /* Global setup */ -int qman_global_init(void); -int bman_global_init(void); +int __rte_internal qman_global_init(void); +int __rte_internal bman_global_init(void); /* Direct portal create and destroy */ struct qman_portal *fsl_qman_portal_create(void); diff --git a/drivers/bus/dpaa/include/netcfg.h b/drivers/bus/dpaa/include/netcfg.h index 7818de68b..b9da869ae 100644 --- a/drivers/bus/dpaa/include/netcfg.h +++ b/drivers/bus/dpaa/include/netcfg.h @@ -46,12 +46,12 @@ struct netcfg_interface { * cfg_file: FMC config XML file * Returns the configuration information in newly allocated memory. */ -struct netcfg_info *netcfg_acquire(void); +struct netcfg_info __rte_internal *netcfg_acquire(void); /* cfg_ptr: configuration information pointer. * Frees the resources allocated by the configuration layer. */ -void netcfg_release(struct netcfg_info *cfg_ptr); +void __rte_internal netcfg_release(struct netcfg_info *cfg_ptr); #ifdef RTE_LIBRTE_DPAA_DEBUG_DRIVER /* cfg_ptr: configuration information pointer. diff --git a/drivers/bus/dpaa/include/of.h b/drivers/bus/dpaa/include/of.h index 7ea7608fc..d1cb2f38f 100644 --- a/drivers/bus/dpaa/include/of.h +++ b/drivers/bus/dpaa/include/of.h @@ -87,7 +87,7 @@ struct dt_file { uint64_t buf[OF_FILE_BUF_MAX >> 3]; }; -const struct device_node *of_find_compatible_node( +const __rte_internal struct device_node *of_find_compatible_node( const struct device_node *from, const char *type __always_unused, const char *compatible) @@ -98,7 +98,7 @@ const struct device_node *of_find_compatible_node( dev_node != NULL; \ dev_node = of_find_compatible_node(dev_node, type, compatible)) -const void *of_get_property(const struct device_node *from, const char *name, +const __rte_internal void *of_get_property(const struct device_node *from, const char *name, size_t *lenp) __attribute__((nonnull(2))); bool of_device_is_available(const struct device_node *dev_node); @@ -109,7 +109,7 @@ const struct device_node *of_get_parent(const struct device_node *dev_node); const struct device_node *of_get_next_child(const struct device_node *dev_node, const struct device_node *prev); -const void *of_get_mac_address(const struct device_node *np); +const void __rte_internal *of_get_mac_address(const struct device_node *np); #define for_each_child_node(parent, child) \ for (child = of_get_next_child(parent, NULL); child != NULL; \ diff --git a/drivers/bus/dpaa/rte_bus_dpaa_version.map b/drivers/bus/dpaa/rte_bus_dpaa_version.map index c88deaf7f..ac5f0493a 100644 --- a/drivers/bus/dpaa/rte_bus_dpaa_version.map +++ b/drivers/bus/dpaa/rte_bus_dpaa_version.map @@ -1,4 +1,4 @@ -DPDK_17.11 { +DPDK_INTERNAL { global: bman_acquire; @@ -57,17 +57,6 @@ DPDK_17.11 { qman_set_vdq; qman_reserve_fqid_range; qman_volatile_dequeue; - rte_dpaa_driver_register; - rte_dpaa_driver_unregister; - rte_dpaa_mem_ptov; - rte_dpaa_portal_init; - - local: *; -}; - -DPDK_18.02 { - global: - dpaa_logtype_eventdev; dpaa_svr_family; per_lcore_dpaa_io; @@ -87,23 +76,10 @@ DPDK_18.02 { qman_release_cgrid_range; qman_retire_fq; qman_static_dequeue_add; - rte_dpaa_portal_fq_close; - rte_dpaa_portal_fq_init; - - local: *; -} DPDK_17.11; - -DPDK_18.08 { - global: fman_if_get_sg_enable; fman_if_set_sg; of_get_mac_address; - local: *; -} DPDK_18.02; - -DPDK_18.11 { - global: bman_thread_irq; fman_if_get_sg_enable; fman_if_set_sg; @@ -113,13 +89,26 @@ DPDK_18.11 { qman_irqsource_remove; qman_thread_fd; qman_thread_irq; + qman_set_fq_lookup_table; +}; + +DPDK_17.11 { + global: + + rte_dpaa_driver_register; + rte_dpaa_driver_unregister; + rte_dpaa_mem_ptov; + rte_dpaa_portal_init; local: *; -} DPDK_18.08; +}; -DPDK_19.05 { +DPDK_18.02 { global: - qman_set_fq_lookup_table; + + rte_dpaa_portal_fq_close; + rte_dpaa_portal_fq_init; local: *; -} DPDK_18.11; +} DPDK_17.11; +