From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id A26B0A0096 for ; Wed, 5 Jun 2019 18:15:02 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BAA0C1BBD1; Wed, 5 Jun 2019 18:15:01 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 2A6BE1BA96 for ; Wed, 5 Jun 2019 18:15:00 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x55GCJ9k018549; Wed, 5 Jun 2019 09:14:59 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pfpt0818; bh=GsxrNomnSkq3zQY/ugGaN49pkpLx9aAUQ6eIoNfM2xs=; b=wlznD9u9WVEHDw+SZ4xgD1HCPglSvqFSnGF/3jLiRU7hjJ4cvUV0jDXQxaQZ5xgxVDVu ISkQAWllHEzfUHHhBvxmjEoRwHmtv60Ptt1N7a+9pZM+b8Aysgx5946GdkzJBZSBniYU uO88UAKy5/EFhkkND2wahAU+nAznMGvKEI9kYldYlvyk/XgwwHLiO0gY85PpXACgb/Mz Tu9ks4XxZG+rXFnO5TXdA1xyRQLyI/m1XS4V8TEva0vBlvu6OjewHlKm2d9BaEvEuFZf 4N/RnTmiBgIhef2RwGSc/onPFyh/AHKJEM3fvMJWh5VACG4+QpoGBQFbOhRNGG0r27e5 8A== Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0b-0016f401.pphosted.com with ESMTP id 2sx3kfb337-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 05 Jun 2019 09:14:59 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 5 Jun 2019 09:14:58 -0700 Received: from NAM03-DM3-obe.outbound.protection.outlook.com (104.47.41.50) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Wed, 5 Jun 2019 09:14:56 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector2-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GsxrNomnSkq3zQY/ugGaN49pkpLx9aAUQ6eIoNfM2xs=; b=BaQanPQnw6YbYjbreMsS73MXVE7CJzzqqHtXnoRSdBnDU+zRK9LhNGOyPelFIDobul9kckF4ZL9cJBbqmMu5dV4JK/F+Vcgd526MZU1EQwSyRERQ/TzHSxk4yszABRPQkZYnHoGchPY58EwHWIL8TED5zvC3ay3y+tU7r7MEnOc= Received: from BYAPR18MB2424.namprd18.prod.outlook.com (20.179.91.149) by BYAPR18MB2920.namprd18.prod.outlook.com (20.179.59.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1965.12; Wed, 5 Jun 2019 16:14:56 +0000 Received: from BYAPR18MB2424.namprd18.prod.outlook.com ([fe80::1ce4:557d:eeb8:843c]) by BYAPR18MB2424.namprd18.prod.outlook.com ([fe80::1ce4:557d:eeb8:843c%7]) with mapi id 15.20.1965.011; Wed, 5 Jun 2019 16:14:56 +0000 From: Jerin Jacob Kollanukkaran To: Neil Horman , "dev@dpdk.org" CC: Bruce Richardson , Thomas Monjalon Thread-Topic: [EXT] [RFC PATCH 1/2] Add __rte_internal tag for functions and version target Thread-Index: AQHVEyntGp9AOB4oYEKRzmQkgAp8vKaNSw/g Date: Wed, 5 Jun 2019 16:14:56 +0000 Message-ID: References: <20190525184346.27932-1-nhorman@tuxdriver.com> <20190525184346.27932-2-nhorman@tuxdriver.com> In-Reply-To: <20190525184346.27932-2-nhorman@tuxdriver.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [122.178.234.223] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 9e8a01ec-ff02-431e-6d74-08d6e9d0f335 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600148)(711020)(4605104)(1401327)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7193020); SRVR:BYAPR18MB2920; x-ms-traffictypediagnostic: BYAPR18MB2920: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6430; x-forefront-prvs: 00594E8DBA x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(39860400002)(396003)(366004)(346002)(376002)(189003)(199004)(13464003)(66066001)(478600001)(66556008)(66476007)(229853002)(64756008)(7736002)(66446008)(316002)(26005)(76116006)(74316002)(186003)(73956011)(66946007)(68736007)(9686003)(14454004)(86362001)(6116002)(102836004)(2906002)(3846002)(8936002)(71190400001)(55016002)(71200400001)(4326008)(6246003)(6436002)(25786009)(81166006)(5660300002)(8676002)(305945005)(476003)(6506007)(446003)(53546011)(2501003)(7696005)(76176011)(11346002)(486006)(99286004)(33656002)(110136005)(52536014)(53936002)(14444005)(54906003)(256004)(81156014); DIR:OUT; SFP:1101; SCL:1; SRVR:BYAPR18MB2920; H:BYAPR18MB2424.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: marvell.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: oWxuD2CeLJIvvKCS+yWuNj4KDdgwoWBG7HCPXrE1/Etu3IMs6BgEZ0ZWhyFOkp2fpyGzEYLPHt3wQHZDby6Mm0CD2qV8sfrCTHSFZEeJ5T0Ocrxfat0CRC8ay5SXbdgUO3M2nAIJS+1GUjtT4AB63S24uj8sXm5JEMK2OXriW9t4I+u01XZoLbkzwn9QY29/IIZNE18pgaoPiyjtbuqLMJyRj0K328myqHHzA9qfTUhvEtX66GZVkpogXivLcppgSG/4Nr5ZDu6H7e2Z1qDgD4l2dh8mzAYNc8ne/LY/1Aj+L1Sy7XZ+xvtJEKSYzD8YQfNiCEryHUardwWaGGtJj5viaIuzToF9bLlBchJZ1maVxsZMxIr7+fXuvmLZnyUgMxo5xSiOhxc/cpgPJqM44yCc8vYaUw9UH0HbDWGgGI8= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 9e8a01ec-ff02-431e-6d74-08d6e9d0f335 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Jun 2019 16:14:56.0729 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: jerinj@marvell.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR18MB2920 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-06-05_09:, , signatures=0 Subject: Re: [dpdk-dev] [EXT] [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" > -----Original Message----- > From: Neil Horman > Sent: Sunday, May 26, 2019 12:14 AM > To: dev@dpdk.org > Cc: Neil Horman ; Jerin Jacob Kollanukkaran > ; Bruce Richardson ; > Thomas Monjalon > Subject: [EXT] [RFC PATCH 1/2] Add __rte_internal tag for functions and > version target > 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 a= n > error function attribute, causing build breakage for any compilation unit > attempting to build it >=20 > 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 >=20 > 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 >=20 > 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(-) >=20 > 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=3D0} > + /.*INTERNAL.*/ {found=3D1} > + /.*}.*;/ {found=3D0} > + /.*;/ {if (found =3D=3D 1) print $1}' $MAPFILE` do > + SYM=3D`echo $i | sed -e"s/;//"` > + objdump -t $OBJFILE | grep -q "\.text.*$SYM$" > + IN_TEXT=3D$? > + objdump -t $OBJFILE | grep -q "\.text\.internal.*$SYM$" I think, it should be OK for cross compilation case. But please cross check= . > + IN_EXP=3D$? > + 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 >=20 > 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 It is a public header file, How about, having __rte_internal In internal header file so that only SDK components can use it. > @@ -89,4 +89,16 @@ __attribute__((section(".text.experimental"))) >=20 > #endif >=20 > +/* > + * __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"))) Sometimes, we may have global variables like variable for dynamic logging e= tc. If so, I think, it is better to change something not starting with .text > +#else > +#define __rte_internal __attribute__((error("This function cannot be use= d > outside of the core DPDK library"), \ > + section(".text.internal"))) Since the above statement is an error, Do we need section attribute here?