From patchwork Sat Apr 28 09:54:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marvin Liu X-Patchwork-Id: 39154 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 81C645F2C; Sat, 28 Apr 2018 04:06:06 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 4A1C05B34 for ; Sat, 28 Apr 2018 04:06:03 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Apr 2018 19:06:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,337,1520924400"; d="scan'208";a="35253658" Received: from dpdk-test32.sh.intel.com ([10.67.119.183]) by fmsmga007.fm.intel.com with ESMTP; 27 Apr 2018 19:06:00 -0700 From: Marvin Liu To: dev@dpdk.org Cc: Marvin Liu Date: Sat, 28 Apr 2018 17:54:07 +0800 Message-Id: <1524909247-6581-1-git-send-email-yong.liu@intel.com> X-Mailer: git-send-email 1.9.3 Subject: [dpdk-dev] [PATCH] mk: using initial-exec model for thread local variable 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" When building share library, thread-local storage model will be changed to global-dynamic. It will cost additional protect for read thread local variable. By now only lcore id is this kind of varaible and not need to dynamic share with other threads. So make TLS model back to initial-exec like static library for better performance. Signed-off-by: Marvin Liu Tested-by: Zhiyong Yang diff --git a/mk/toolchain/gcc/rte.vars.mk b/mk/toolchain/gcc/rte.vars.mk index 7e4531b..7b5e71c 100644 --- a/mk/toolchain/gcc/rte.vars.mk +++ b/mk/toolchain/gcc/rte.vars.mk @@ -43,6 +43,10 @@ ifeq (,$(findstring -O0,$(EXTRA_CFLAGS))) endif endif +ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y) +TOOLCHAIN_CFLAGS += -ftls-model=initial-exec +endif + WERROR_FLAGS := -W -Wall -Wstrict-prototypes -Wmissing-prototypes WERROR_FLAGS += -Wmissing-declarations -Wold-style-definition -Wpointer-arith WERROR_FLAGS += -Wcast-align -Wnested-externs -Wcast-qual