From patchwork Mon Aug 7 12:04:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerin Jacob X-Patchwork-Id: 27474 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 [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id A9F08374C; Mon, 7 Aug 2017 14:04:52 +0200 (CEST) Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0085.outbound.protection.outlook.com [104.47.33.85]) by dpdk.org (Postfix) with ESMTP id 36F03330D for ; Mon, 7 Aug 2017 14:04:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=Pw81wp2QDvx+6FDPTyoo3gVn3kEPpJjmt+/E6dSYea4=; b=OZ3Jr9HXxb3NlfwJz2M68xXVYTcY4yYP+RabDMJxKRhLPQBOiOyhKoir7LB9fzL+YhslnRWZ1VlPN9TQNg99lAGA3+nPN1L5kE14KeQnsgPvxFbhsJZMQn1Nl5PWj/RphbEyn6FDYCeeU8KFQ7IyTUYxTGqO3Fyb3cbOeAsEshM= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.JacobKollanukkaran@cavium.com; Received: from jerin.caveonetworks.com (111.93.218.67) by BN3PR07MB2514.namprd07.prod.outlook.com (10.167.4.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1320.16; Mon, 7 Aug 2017 12:04:46 +0000 From: Jerin Jacob To: dev@dpdk.org Cc: thomas@monjalon.net, bruce.richardson@intel.com, Jerin Jacob Date: Mon, 7 Aug 2017 17:34:08 +0530 Message-Id: <20170807120408.21975-1-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.14.0 MIME-Version: 1.0 X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: MA1PR01CA0074.INDPRD01.PROD.OUTLOOK.COM (10.174.56.14) To BN3PR07MB2514.namprd07.prod.outlook.com (10.167.4.139) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 31a63a58-39d1-45a4-f6c7-08d4dd8c8068 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:BN3PR07MB2514; X-Microsoft-Exchange-Diagnostics: 1; BN3PR07MB2514; 3:AxU6vZ7+MuJH28foy4nZdGJtFwGHioDVmKJxedRH9MNclYoqwnHRCFNXazimleEw9jMpn+6M3GKOx3U2GxW8B2kekD6KSD9gBQIEkTk0UNg8EiVDZBZeklr4nOSHuL5A8pFpRQulXf0kgEnFsXUylkqkzl/umS6Wv65Qbl3AYD4whZoiwO2PtH/371DI76UWtGXH0562xKO+aJerA/5rckQ0M8SUE1oUgjnn2ncrh99Cg83Wj/5OdegYD1H6AdM2; 25:8T+xIOweQtJG0dYTHwgf7gKm818CGzhR/YYSulmERBluZ5K4S9VXLrVtXcns9PDjXstl7CH2cHgEeZcCs+i3W7wddgyWu7Q3LMSwC0tbmb2GqDjGW1Zmk9GlZpukT7JFwSv17H79TsVMiJvGTPBVnCUuthigUCKaSgDsLyrLiNWHF1QoyFP0Gpn46ftHUjE2Rv3gFrWs4nY75y0/+8YtJC9F2ER+gTpGqfZ3LdoDOY3LNlzsL2nRsisXUG1Cyg5OWodT04s4D6pp5sc8TPBaRt/yGtQoh1bk3fyq4MJWfqrKUaUTn2xZRHGzSnxZRli+RqM+RGa8k0VM+clWlrZAKg==; 31:9Zr04sKSjznWJP5sp60/ysG078KzpFxMkdPrNQmMefG9w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x3z3CIcQcCeN0NtbpuIHPZQNn/hcSpk+kb72XuMBTRQSLyzXDNfgtvItM X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(3002001)(93006095)(10201501046)(100000703101)(100105400095)(6041248)(20161123562025)(20161123564025)(20161123560025)(20161123558100)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN3PR07MB2514; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN3PR07MB2514; X-Forefront-PRVS: 0392679D18 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(7370300001)(6009001)(39400400002)(39850400002)(39840400002)(39450400003)(39410400002)(189002)(199003)(42186005)(5003940100001)(38730400002)(107886003)(110136004)(6666003)(42882006)(6916009)(25786009)(81166006)(81156014)(47776003)(33646002)(6486002)(1076002)(4326008)(50986999)(69596002)(53936002)(478600001)(3846002)(6116002)(189998001)(6506006)(5009440100003)(72206003)(101416001)(6512007)(7736002)(48376002)(97736004)(7350300001)(50466002)(5660300001)(305945005)(575784001)(53416004)(36756003)(8676002)(66066001)(50226002)(68736007)(105586002)(106356001)(2351001)(2906002)(2361001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR07MB2514; H:jerin.caveonetworks.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR07MB2514; 23:srArybi3tEaY5Qd8gal3OSI7u7P3OxphjiC15rkxN?= SCM9WKekAZjvVmSHVYFb6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JCA/paqLIAcSQC+47xRCRiCtmIoNsn441bsK1IOujV8oD2YCSz2qs6fKVQzcs325uDWTl9E6K/aNxWn8Or/EE1t32/FMN3OigYqo= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2017 12:04:46.8886 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR07MB2514 Subject: [dpdk-dev] [PATCH] eal: change init macro as exec environment specific 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" baremetal execution environments may have a different method to enable RTE_INIT instead of using compiler constructor scheme. Move RTE_INIT* definition under exec-env to support different execution environments. Signed-off-by: Jerin Jacob --- app/test-eventdev/evt_test.h | 2 +- lib/librte_eal/bsdapp/eal/Makefile | 2 +- .../bsdapp/eal/include/exec-env/rte_eal.h | 51 ++++++++++++++++++++++ lib/librte_eal/common/eal_common_log.c | 2 + lib/librte_eal/common/include/rte_bus.h | 2 + lib/librte_eal/common/include/rte_eal.h | 6 --- lib/librte_eal/common/include/rte_tailq.h | 2 + lib/librte_eal/linuxapp/eal/Makefile | 2 +- .../linuxapp/eal/include/exec-env/rte_eal.h | 51 ++++++++++++++++++++++ 9 files changed, 111 insertions(+), 9 deletions(-) create mode 100644 lib/librte_eal/bsdapp/eal/include/exec-env/rte_eal.h create mode 100644 lib/librte_eal/linuxapp/eal/include/exec-env/rte_eal.h diff --git a/app/test-eventdev/evt_test.h b/app/test-eventdev/evt_test.h index 17bdd1650..f63f9a814 100644 --- a/app/test-eventdev/evt_test.h +++ b/app/test-eventdev/evt_test.h @@ -37,7 +37,7 @@ #include #include -#include +#include enum evt_test_result { EVT_TEST_SUCCESS, diff --git a/lib/librte_eal/bsdapp/eal/Makefile b/lib/librte_eal/bsdapp/eal/Makefile index 05517a2dc..2f5574f79 100644 --- a/lib/librte_eal/bsdapp/eal/Makefile +++ b/lib/librte_eal/bsdapp/eal/Makefile @@ -107,7 +107,7 @@ CFLAGS_eal_thread.o += -Wno-return-type CFLAGS_eal_hpet.o += -Wno-return-type endif -INC := rte_interrupts.h +INC := rte_interrupts.h rte_eal.h SYMLINK-$(CONFIG_RTE_EXEC_ENV_BSDAPP)-include/exec-env := \ $(addprefix include/exec-env/,$(INC)) diff --git a/lib/librte_eal/bsdapp/eal/include/exec-env/rte_eal.h b/lib/librte_eal/bsdapp/eal/include/exec-env/rte_eal.h new file mode 100644 index 000000000..1f3222f01 --- /dev/null +++ b/lib/librte_eal/bsdapp/eal/include/exec-env/rte_eal.h @@ -0,0 +1,51 @@ +/*- + * BSD LICENSE + * + * Copyright(c) 2010-2017 Intel Corporation. All rights reserved. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _BSDAPP_RTE_EAL_H_ +#define _BSDAPP_RTE_EAL_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#define RTE_INIT(func) \ +static void __attribute__((constructor, used)) func(void) + +#define RTE_INIT_PRIO(func, prio) \ +static void __attribute__((constructor(prio), used)) func(void) + +#ifdef __cplusplus +} +#endif + +#endif /* _BSDAPP_RTE_EAL_H_ */ diff --git a/lib/librte_eal/common/eal_common_log.c b/lib/librte_eal/common/eal_common_log.c index 0e3b93209..236a662b0 100644 --- a/lib/librte_eal/common/eal_common_log.c +++ b/lib/librte_eal/common/eal_common_log.c @@ -43,6 +43,8 @@ #include #include +#include + #include "eal_private.h" /* global log structure */ diff --git a/lib/librte_eal/common/include/rte_bus.h b/lib/librte_eal/common/include/rte_bus.h index c79368d3c..52e13bd0d 100644 --- a/lib/librte_eal/common/include/rte_bus.h +++ b/lib/librte_eal/common/include/rte_bus.h @@ -52,6 +52,8 @@ extern "C" { #include #include +#include + /** Double linked list of buses */ TAILQ_HEAD(rte_bus_list, rte_bus); diff --git a/lib/librte_eal/common/include/rte_eal.h b/lib/librte_eal/common/include/rte_eal.h index 0e7363d77..cce5160bd 100644 --- a/lib/librte_eal/common/include/rte_eal.h +++ b/lib/librte_eal/common/include/rte_eal.h @@ -287,12 +287,6 @@ static inline int rte_gettid(void) return RTE_PER_LCORE(_thread_id); } -#define RTE_INIT(func) \ -static void __attribute__((constructor, used)) func(void) - -#define RTE_INIT_PRIO(func, prio) \ -static void __attribute__((constructor(prio), used)) func(void) - #ifdef __cplusplus } #endif diff --git a/lib/librte_eal/common/include/rte_tailq.h b/lib/librte_eal/common/include/rte_tailq.h index 3aae098ae..6a5ca3731 100644 --- a/lib/librte_eal/common/include/rte_tailq.h +++ b/lib/librte_eal/common/include/rte_tailq.h @@ -48,6 +48,8 @@ extern "C" { #include #include +#include + /** dummy structure type used by the rte_tailq APIs */ struct rte_tailq_entry { TAILQ_ENTRY(rte_tailq_entry) next; /**< Pointer entries for a tailq list */ diff --git a/lib/librte_eal/linuxapp/eal/Makefile b/lib/librte_eal/linuxapp/eal/Makefile index e6ab6c30f..ec8ffddf4 100644 --- a/lib/librte_eal/linuxapp/eal/Makefile +++ b/lib/librte_eal/linuxapp/eal/Makefile @@ -130,7 +130,7 @@ ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y) CFLAGS_eal_thread.o += -Wno-return-type endif -INC := rte_interrupts.h rte_kni_common.h rte_dom0_common.h +INC := rte_interrupts.h rte_kni_common.h rte_dom0_common.h rte_eal.h SYMLINK-$(CONFIG_RTE_EXEC_ENV_LINUXAPP)-include/exec-env := \ $(addprefix include/exec-env/,$(INC)) diff --git a/lib/librte_eal/linuxapp/eal/include/exec-env/rte_eal.h b/lib/librte_eal/linuxapp/eal/include/exec-env/rte_eal.h new file mode 100644 index 000000000..bac4924a6 --- /dev/null +++ b/lib/librte_eal/linuxapp/eal/include/exec-env/rte_eal.h @@ -0,0 +1,51 @@ +/*- + * BSD LICENSE + * + * Copyright(c) 2010-2017 Intel Corporation. All rights reserved. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _LINUXAPP_RTE_EAL_H_ +#define _LINUXAPP_RTE_EAL_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#define RTE_INIT(func) \ +static void __attribute__((constructor, used)) func(void) + +#define RTE_INIT_PRIO(func, prio) \ +static void __attribute__((constructor(prio), used)) func(void) + +#ifdef __cplusplus +} +#endif + +#endif /* _LINUXAPP_RTE_EAL_H_ */