From patchwork Sat Apr 25 06:04:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wang, Haiyue" X-Patchwork-Id: 69292 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 165EAA00C2; Sat, 25 Apr 2020 08:10:51 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A944C1C1C6; Sat, 25 Apr 2020 08:10:36 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id E4DB71C1B4 for ; Sat, 25 Apr 2020 08:10:34 +0200 (CEST) IronPort-SDR: 39iS1rSLi/4wUBLmJkoId9IIkExa98j1A5E362B3DOJg7UIbLV36YU+tJog/SByLs5RsaTeEvp bNwYsGQ0s72w== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Apr 2020 23:10:34 -0700 IronPort-SDR: 55sSyWHhaYwhG9kmdam3tSgiIcEvbdTbiOXMzXDk1Vfe3EG3SMA9FpBUE07PMIeDAT/bkhnUEh KiaU8MMV3Dog== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,314,1583222400"; d="scan'208";a="281099176" Received: from npg-dpdk-haiyue-3.sh.intel.com ([10.67.119.46]) by fmsmga004.fm.intel.com with ESMTP; 24 Apr 2020 23:10:32 -0700 From: Haiyue Wang To: dev@dpdk.org, thomas@monjalon.net, david.marchand@redhat.com, bruce.richardson@intel.com, ferruh.yigit@intel.com, nhorman@tuxdriver.com, mdr@ashroe.eu Cc: Haiyue Wang Date: Sat, 25 Apr 2020 14:04:36 +0800 Message-Id: <20200425060441.36874-2-haiyue.wang@intel.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200425060441.36874-1-haiyue.wang@intel.com> References: <20190613142344.9188-1-nhorman@tuxdriver.com> <20200425060441.36874-1-haiyue.wang@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v6 1/6] eal: add internal ABI tag definition 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" Introduce the __rte_internal tag to mark internal ABI function which is used only by the drivers or other libraries. Signed-off-by: Haiyue Wang --- lib/librte_eal/include/rte_compat.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/librte_eal/include/rte_compat.h b/lib/librte_eal/include/rte_compat.h index 3eb33784b..4cd8f68d6 100644 --- a/lib/librte_eal/include/rte_compat.h +++ b/lib/librte_eal/include/rte_compat.h @@ -19,4 +19,17 @@ __attribute__((section(".text.experimental"))) #endif +#ifndef ALLOW_INTERNAL_API + +#define __rte_internal \ +__attribute__((error("Symbol is not public ABI"), \ +section(".text.internal"))) + +#else + +#define __rte_internal \ +__attribute__((section(".text.internal"))) + +#endif + #endif /* _RTE_COMPAT_H_ */ From patchwork Sat Apr 25 06:04:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wang, Haiyue" X-Patchwork-Id: 69293 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 689B8A00C2; Sat, 25 Apr 2020 08:10:59 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id ECDDA1C1BD; Sat, 25 Apr 2020 08:10:39 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id EDBB41C1C9 for ; Sat, 25 Apr 2020 08:10:36 +0200 (CEST) IronPort-SDR: B5KzmbNK3ytAFX7DQGfIWzVDZaH0VYXYcvFtOwzmtm8/9gN691khHTDuDGnF6sDDpkh5cRRVZt XHytnl55tnWw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Apr 2020 23:10:36 -0700 IronPort-SDR: ONzM1Z8ofVLNPUoXXpM1GXbuZ8qHoACqGh/3LuYxzTRus++DoUgE9Lmr9afRpt92XZLO9Dj5vI UD2Erb/LhleQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,314,1583222400"; d="scan'208";a="281099186" Received: from npg-dpdk-haiyue-3.sh.intel.com ([10.67.119.46]) by fmsmga004.fm.intel.com with ESMTP; 24 Apr 2020 23:10:34 -0700 From: Haiyue Wang To: dev@dpdk.org, thomas@monjalon.net, david.marchand@redhat.com, bruce.richardson@intel.com, ferruh.yigit@intel.com, nhorman@tuxdriver.com, mdr@ashroe.eu Cc: Haiyue Wang Date: Sat, 25 Apr 2020 14:04:37 +0800 Message-Id: <20200425060441.36874-3-haiyue.wang@intel.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200425060441.36874-1-haiyue.wang@intel.com> References: <20190613142344.9188-1-nhorman@tuxdriver.com> <20200425060441.36874-1-haiyue.wang@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v6 2/6] build: enable internal API tag 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" Allow the drivers and libraries to use the internal tag for marking internal ABI symbols. Signed-off-by: Haiyue Wang --- drivers/meson.build | 5 ++++- lib/meson.build | 5 ++++- mk/target/generic/rte.vars.mk | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/meson.build b/drivers/meson.build index 4d8f842ab..f3dd23dd4 100644 --- a/drivers/meson.build +++ b/drivers/meson.build @@ -20,7 +20,10 @@ dpdk_driver_classes = ['common', disabled_drivers = run_command(list_dir_globs, get_option('disable_drivers'), ).stdout().split() -default_cflags = machine_args + ['-DALLOW_EXPERIMENTAL_API'] +default_cflags = machine_args +default_cflags += ['-DALLOW_EXPERIMENTAL_API'] +default_cflags += ['-DALLOW_INTERNAL_API'] + if cc.has_argument('-Wno-format-truncation') default_cflags += '-Wno-format-truncation' endif diff --git a/lib/meson.build b/lib/meson.build index c28b8df83..8697941ae 100644 --- a/lib/meson.build +++ b/lib/meson.build @@ -38,7 +38,10 @@ if is_windows libraries = ['kvargs','eal'] # only supported libraries for windows endif -default_cflags = machine_args + ['-DALLOW_EXPERIMENTAL_API'] +default_cflags = machine_args +default_cflags += ['-DALLOW_EXPERIMENTAL_API'] +default_cflags += ['-DALLOW_INTERNAL_API'] + if cc.has_argument('-Wno-format-truncation') default_cflags += '-Wno-format-truncation' endif diff --git a/mk/target/generic/rte.vars.mk b/mk/target/generic/rte.vars.mk index ec2672897..11b0418e5 100644 --- a/mk/target/generic/rte.vars.mk +++ b/mk/target/generic/rte.vars.mk @@ -106,6 +106,7 @@ ifeq ($(BUILDING_RTE_SDK),1) # building sdk CFLAGS += -include $(RTE_OUTPUT)/include/rte_config.h CFLAGS += -DALLOW_EXPERIMENTAL_API +CFLAGS += -DALLOW_INTERNAL_API else # if we are building an external application, include SDK's lib and # includes too From patchwork Sat Apr 25 06:04:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wang, Haiyue" X-Patchwork-Id: 69294 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 66A70A00C2; Sat, 25 Apr 2020 08:11:06 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 48BB51C1D4; Sat, 25 Apr 2020 08:10:41 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 23DBA1C197 for ; Sat, 25 Apr 2020 08:10:38 +0200 (CEST) IronPort-SDR: HjsB5WjK3G90yoQE2za4drR/3QeTwD6O2xiOGztIsb/sQFYT43E6LuEifDtpMDc2qChQeyEDHO 1Nt9FWGA84ww== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Apr 2020 23:10:38 -0700 IronPort-SDR: G6GKNvdSVFKYlZR+FkgCSW6H7bk+rszZlCcaTloWC5W4+drD8HVUIIqBnlbWokOENy15SIG9fT F3Nki00ct2Ig== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,314,1583222400"; d="scan'208";a="281099193" Received: from npg-dpdk-haiyue-3.sh.intel.com ([10.67.119.46]) by fmsmga004.fm.intel.com with ESMTP; 24 Apr 2020 23:10:36 -0700 From: Haiyue Wang To: dev@dpdk.org, thomas@monjalon.net, david.marchand@redhat.com, bruce.richardson@intel.com, ferruh.yigit@intel.com, nhorman@tuxdriver.com, mdr@ashroe.eu Cc: Haiyue Wang Date: Sat, 25 Apr 2020 14:04:38 +0800 Message-Id: <20200425060441.36874-4-haiyue.wang@intel.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200425060441.36874-1-haiyue.wang@intel.com> References: <20190613142344.9188-1-nhorman@tuxdriver.com> <20200425060441.36874-1-haiyue.wang@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v6 3/6] mk: add internal tag check 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" Add checks during build to ensure that all symbols in the INTERNAL version map section have __internal tags on their definitions, and enable the warnings needed to announce their use. Signed-off-by: Haiyue Wang --- ...-experimental-syms.sh => check-symbols.sh} | 31 +++++++++++++++++++ mk/internal/rte.compile-pre.mk | 6 ++-- 2 files changed, 34 insertions(+), 3 deletions(-) rename buildtools/{check-experimental-syms.sh => check-symbols.sh} (61%) diff --git a/buildtools/check-experimental-syms.sh b/buildtools/check-symbols.sh similarity index 61% rename from buildtools/check-experimental-syms.sh rename to buildtools/check-symbols.sh index f3603e5ba..3df57c322 100755 --- a/buildtools/check-experimental-syms.sh +++ b/buildtools/check-symbols.sh @@ -54,4 +54,35 @@ do } done +for SYM in `$LIST_SYMBOL -S INTERNAL $MAPFILE |cut -d ' ' -f 3` +do + if grep -q "\.text.*[[:space:]]$SYM$" $DUMPFILE && + ! grep -q "\.text\.internal.*[[:space:]]$SYM$" $DUMPFILE + 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 of $SYM + END_OF_MESSAGE + ret=1 + fi +done + +# Filter out symbols suffixed with a . for icc +for SYM in `awk '{ + if ($2 != "l" && $4 == ".text.internal" && !($NF ~ /\.$/)) { + print $NF + } +}' $DUMPFILE` +do + $LIST_SYMBOL -S INTERNAL -s $SYM -q $MAPFILE || { + cat >&2 <<- END_OF_MESSAGE + $SYM is flagged as internal + but is not listed in version map + Please add $SYM to the version map + END_OF_MESSAGE + ret=1 + } +done + exit $ret diff --git a/mk/internal/rte.compile-pre.mk b/mk/internal/rte.compile-pre.mk index 82fe098f7..df05b5576 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) $@ +CHECK_SYMBOLS_SCRIPT = $(RTE_SDK)/buildtools/check-symbols.sh +CHECK_SYMBOLS = $(CHECK_SYMBOLS_SCRIPT) $(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_SYMBOLS) && \ echo $(C_TO_O_CMD) > $(call obj2cmd,$(@)) && \ sed 's,'$@':,dep_'$@' =,' $(call obj2dep,$(@)).tmp > $(call obj2dep,$(@)) && \ rm -f $(call obj2dep,$(@)).tmp From patchwork Sat Apr 25 06:04:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wang, Haiyue" X-Patchwork-Id: 69295 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0DD1BA00C2; Sat, 25 Apr 2020 08:11:16 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CBC7B1C1B6; Sat, 25 Apr 2020 08:10:44 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 381C11C1D2 for ; Sat, 25 Apr 2020 08:10:41 +0200 (CEST) IronPort-SDR: NI4ZGF5XfUwmerYckciMrbqDOhumwgEK2EiDgpbVLYloT7qg4pDiis6zmbF/bVsjJSeUWwfc/T Je4K4/VY6fJg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Apr 2020 23:10:40 -0700 IronPort-SDR: ZnAZJRXODaAYrCGrb0kSa0tLdE2CidTqOyS027DIYnGRWgpHDTLFw/aFyZMxo6LCw7xegF/x4h i6sfVu2bdOsA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,314,1583222400"; d="scan'208";a="281099200" Received: from npg-dpdk-haiyue-3.sh.intel.com ([10.67.119.46]) by fmsmga004.fm.intel.com with ESMTP; 24 Apr 2020 23:10:39 -0700 From: Haiyue Wang To: dev@dpdk.org, thomas@monjalon.net, david.marchand@redhat.com, bruce.richardson@intel.com, ferruh.yigit@intel.com, nhorman@tuxdriver.com, mdr@ashroe.eu Cc: Haiyue Wang Date: Sat, 25 Apr 2020 14:04:39 +0800 Message-Id: <20200425060441.36874-5-haiyue.wang@intel.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200425060441.36874-1-haiyue.wang@intel.com> References: <20190613142344.9188-1-nhorman@tuxdriver.com> <20200425060441.36874-1-haiyue.wang@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v6 4/6] devtools: ignore internal ABI check 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" Ignore the internal version ABI check, this kind of ABI is used only by drivers and libraries. Signed-off-by: Haiyue Wang --- devtools/libabigail.abignore | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/devtools/libabigail.abignore b/devtools/libabigail.abignore index 1911890a7..986a52771 100644 --- a/devtools/libabigail.abignore +++ b/devtools/libabigail.abignore @@ -3,6 +3,11 @@ [suppress_variable] symbol_version = EXPERIMENTAL +[suppress_function] + symbol_version = INTERNAL +[suppress_variable] + symbol_version = INTERNAL + ; Explicit ignore for driver-only ABI [suppress_type] name = rte_cryptodev_ops From patchwork Sat Apr 25 06:04:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wang, Haiyue" X-Patchwork-Id: 69296 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3085EA00C2; Sat, 25 Apr 2020 08:11:22 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 99EF61C1F6; Sat, 25 Apr 2020 08:10:46 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 2D7651C1E5 for ; Sat, 25 Apr 2020 08:10:43 +0200 (CEST) IronPort-SDR: EiyM352CKN93Xl9eX2ie/Vas/1GhSRS5YkXUXEmiv9ma6qv69X784DVKJ2iwJhVuP0np03XeXO RXUTZTr2vPdA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Apr 2020 23:10:42 -0700 IronPort-SDR: ReKVz6GmOFjH/9Eyc58NJUOJfaMFOjsBsnBEsN81uLxISFI7GYveJMwHdpV6V7HoOI6SH7MB06 KZTZazntqnJw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,314,1583222400"; d="scan'208";a="281099208" Received: from npg-dpdk-haiyue-3.sh.intel.com ([10.67.119.46]) by fmsmga004.fm.intel.com with ESMTP; 24 Apr 2020 23:10:41 -0700 From: Haiyue Wang To: dev@dpdk.org, thomas@monjalon.net, david.marchand@redhat.com, bruce.richardson@intel.com, ferruh.yigit@intel.com, nhorman@tuxdriver.com, mdr@ashroe.eu Cc: Haiyue Wang Date: Sat, 25 Apr 2020 14:04:40 +0800 Message-Id: <20200425060441.36874-6-haiyue.wang@intel.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200425060441.36874-1-haiyue.wang@intel.com> References: <20190613142344.9188-1-nhorman@tuxdriver.com> <20200425060441.36874-1-haiyue.wang@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v6 5/6] devtools: exempt internal ABI checking 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" No need to restrict the ABI on symbols that are only used by core libraries. Signed-off-by: Haiyue Wang --- devtools/check-symbol-change.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/devtools/check-symbol-change.sh b/devtools/check-symbol-change.sh index ed2178e36..7b6d5f40f 100755 --- a/devtools/check-symbol-change.sh +++ b/devtools/check-symbol-change.sh @@ -91,6 +91,13 @@ check_for_rule_violations() if [ "$ar" = "add" ] then + if [ "$secname" = "INTERNAL" ] + then + # these are absolved from any further checking + echo "Skipping symbol $symname in INTERNAL" + continue + fi + if [ "$secname" = "unknown" ] then # Just inform the user of this occurrence, but @@ -148,6 +155,7 @@ check_for_rule_violations() else if ! grep -q "$mname $symname .* add" "$mapdb" && \ + [ "$secname" != "INTERNAL" ] && \ [ "$secname" != "EXPERIMENTAL" ] then # Just inform users that non-experimenal From patchwork Sat Apr 25 06:04:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wang, Haiyue" X-Patchwork-Id: 69297 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id A100FA00C2; Sat, 25 Apr 2020 08:11:31 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0E8D31C208; Sat, 25 Apr 2020 08:10:49 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 2ACA31C1EA for ; Sat, 25 Apr 2020 08:10:45 +0200 (CEST) IronPort-SDR: Me/ZSxbYx9sJBF/eD88xnU9B75/whzyI/E6XfGK7FXFrZ71Kh18aXUS489rB9cDcnUHgNJTYDS 1T2NezLfkpPg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Apr 2020 23:10:44 -0700 IronPort-SDR: gpTjcYDL6k5EpDAjK1e6iWzZ3uUo6XieqPYu094qWQQ3byQtkOAnHvs2dT6GGtQKStylDNdqAm gsiHGMZdKeWQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,314,1583222400"; d="scan'208";a="281099215" Received: from npg-dpdk-haiyue-3.sh.intel.com ([10.67.119.46]) by fmsmga004.fm.intel.com with ESMTP; 24 Apr 2020 23:10:43 -0700 From: Haiyue Wang To: dev@dpdk.org, thomas@monjalon.net, david.marchand@redhat.com, bruce.richardson@intel.com, ferruh.yigit@intel.com, nhorman@tuxdriver.com, mdr@ashroe.eu Cc: Haiyue Wang Date: Sat, 25 Apr 2020 14:04:41 +0800 Message-Id: <20200425060441.36874-7-haiyue.wang@intel.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200425060441.36874-1-haiyue.wang@intel.com> References: <20190613142344.9188-1-nhorman@tuxdriver.com> <20200425060441.36874-1-haiyue.wang@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v6 6/6] devtools: enforce internal tag at the beginning 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" Move the internal tag on a separate line and make it the first thing of function prototypes. Signed-off-by: Haiyue Wang --- devtools/checkpatches.sh | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh index c30ce64cc..42b833e0d 100755 --- a/devtools/checkpatches.sh +++ b/devtools/checkpatches.sh @@ -111,6 +111,37 @@ check_experimental_tags() { # return $res } +check_internal_tags() { # + res=0 + + cat "$1" |awk ' + BEGIN { + current_file = ""; + ret = 0; + } + /^+++ b\// { + current_file = $2; + } + /^+.*__rte_internal/ { + if (current_file ~ ".c$" ) { + print "Please only put __rte_internal tags in " \ + "headers ("current_file")"; + ret = 1; + } + if ($1 != "+__rte_internal" || $2 != "") { + print "__rte_internal must appear alone on the line" \ + " immediately preceding the return type of" \ + " a function." + ret = 1; + } + } + END { + exit ret; + }' || res=1 + + return $res +} + number=0 range='origin/master..' quiet=false @@ -194,6 +225,14 @@ check () { # ret=1 fi + ! $verbose || printf '\nChecking __rte_internal tags:\n' + report=$(check_internal_tags "$tmpinput") + if [ $? -ne 0 ] ; then + $headline_printed || print_headline "$3" + printf '%s\n' "$report" + ret=1 + fi + if [ "$tmpinput" != "$1" ]; then rm -f "$tmpinput" trap - INT