From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 01157A00C3; Thu, 14 May 2020 09:42:49 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 75D811D681; Thu, 14 May 2020 09:42:48 +0200 (CEST) Received: from qrelay153.mxroute.com (qrelay153.mxroute.com [172.82.139.153]) by dpdk.org (Postfix) with ESMTP id 1495F1D676 for ; Thu, 14 May 2020 09:42:45 +0200 (CEST) Received: from filter004.mxroute.com ([149.28.56.236] 149.28.56.236.vultr.com) (Authenticated sender: mN4UYu2MZsgR) by qrelay153.mxroute.com (ZoneMTA) with ESMTPA id 1721222ad5d000add6.001 for ; Thu, 14 May 2020 07:42:42 +0000 X-Zone-Loop: 9ed6f4829f5e565d36fde0de8e766d0fd5aa5e956321 X-Originating-IP: [149.28.56.236] Received: from galaxy.mxroute.com (unknown [23.92.70.113]) by filter004.mxroute.com (Postfix) with ESMTPS id 7DA333EA26; Thu, 14 May 2020 07:42:36 +0000 (UTC) Received: from [192.198.151.44] by galaxy.mxroute.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.91) (envelope-from ) id 1jZ84Q-0000zS-3i; Thu, 14 May 2020 03:14:18 -0400 To: Kevin Traynor , akhil.goyal@nxp.com, dev@dpdk.org Cc: hemant.agrawal@nxp.com, david.marchand@redhat.com, thomas@monjalon.net, stable@dpdk.org References: <20200513135030.14291-1-akhil.goyal@nxp.com> <0a3c0209-8438-2586-e300-4dbee671e563@redhat.com> From: Ray Kinsella Autocrypt: addr=mdr@ashroe.eu; keydata= mQINBFv8B3wBEAC+5ImcgbIvadt3axrTnt7Sxch3FsmWTTomXfB8YiuHT8KL8L/bFRQSL1f6 ASCHu3M89EjYazlY+vJUWLr0BhK5t/YI7bQzrOuYrl9K94vlLwzD19s/zB/g5YGGR5plJr0s JtJsFGEv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YBgAAKCRB0l1of+wIKm3KlD/9w/LOG5rtgtCUWPl4B3pZvGpNym6XdK8cop9saOnE85zWf u+sKWCrxNgYkYP7aZrYMPwqDvilxhbTsIJl5HhPgpTO1b0i+c0n1Tij3EElj5UCg3q8mEc17 c+5jRrY3oz77g7E3oPftAjaq1ybbXjY4K32o3JHFR6I8wX3m9wJZJe1+Y+UVrrjY65gZFxcA thNVnWKErarVQGjeNgHV4N1uF3pIx3kT1N4GSnxhoz4Bki91kvkbBhUgYfNflGURfZT3wIKK +d50jd7kqRouXUCzTdzmDh7jnYrcEFM4nvyaYu0JjSS5R672d9SK5LVIfWmoUGzqD4AVmUW8 pcv461+PXchuS8+zpltR9zajl72Q3ymlT4BTAQOlCWkD0snBoKNUB5d2EXPNV13nA0qlm4U2 GpROfJMQXjV6fyYRvttKYfM5xYKgRgtP0z5lTAbsjg9WFKq0Fndh7kUlmHjuAIwKIV4Tzo75 QO2zC0/NTaTjmrtiXhP+vkC4pcrOGNsbHuaqvsc/ZZ0siXyYsqbctj/sCd8ka2r94u+c7o4l BGaAm+FtwAfEAkXHu4y5Phuv2IRR+x1wTey1U1RaEPgN8xq0LQ1OitX4t2mQwjdPihZQBCnZ wzOrkbzlJMNrMKJpEgulmxAHmYJKgvZHXZXtLJSejFjR0GdHJcL5rwVOMWB8cg== Message-ID: Date: Thu, 14 May 2020 08:42:32 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <0a3c0209-8438-2586-e300-4dbee671e563@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-AuthUser: mdr@ashroe.eu Subject: Re: [dpdk-dev] [PATCH] drivers/crypto: fix gcc 10 no-common errors 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" Tidy solution. On 13/05/2020 17:40, Kevin Traynor wrote: > On 13/05/2020 14:50, akhil.goyal@nxp.com wrote: >> From: Akhil Goyal >> >> gcc 10 defaults to -fno-common and as a result when linking >> with crypto drivers: >> >> drivers/librte_pmd_dpaa_sec.a(crypto_dpaa_sec_dpaa_sec.c.o): >> (.bss+0x4): multiple definition of `rta_sec_era'; >> drivers/librte_pmd_caam_jr.a(crypto_caam_jr_caam_jr.c.o): >> (.bss+0x0): first defined here >> >> drivers/librte_pmd_dpaa2_sec.a(crypto_dpaa2_sec_dpaa2_sec_dpseci.c.o): >> (.data+0x0): multiple definition of `rta_sec_era'; >> drivers/librte_pmd_caam_jr.a(crypto_caam_jr_caam_jr.c.o): >> (.bss+0x0): first defined here >> >> This patch fixes the blunt workaround in the following commit. >> >> Fixes: 50b03f3b8eaf ("drivers/crypto: disable gcc 10 no-common errors") >> >> Bugzilla ID: 469 >> Cc: stable@dpdk.org >> >> Signed-off-by: Akhil Goyal >> --- >> This patch is not tested on GCC 10. >> @kevin Please verify on your setup if it is fixing the GCC 10 >> compilation. >> > > Passing with gcc 10 on my setup. Internal symbol part looks ok to me, > but might be best to get review from Ray. > > Tested-by: Kevin Traynor > >> >> drivers/common/dpaax/Makefile | 3 ++- >> drivers/common/dpaax/caamflib.c | 16 ++++++++++++++++ >> drivers/common/dpaax/meson.build | 4 +++- >> .../common/dpaax/rte_common_dpaax_version.map | 4 ++++ >> drivers/crypto/caam_jr/Makefile | 7 ------- >> drivers/crypto/caam_jr/caam_jr.c | 2 -- >> drivers/crypto/caam_jr/meson.build | 5 ----- >> drivers/crypto/dpaa2_sec/Makefile | 7 ------- >> drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 4 ++-- >> drivers/crypto/dpaa2_sec/meson.build | 5 ----- >> drivers/crypto/dpaa_sec/Makefile | 7 ------- >> drivers/crypto/dpaa_sec/dpaa_sec.c | 2 -- >> drivers/crypto/dpaa_sec/meson.build | 5 ----- >> 13 files changed, 27 insertions(+), 44 deletions(-) >> create mode 100644 drivers/common/dpaax/caamflib.c >> >> diff --git a/drivers/common/dpaax/Makefile b/drivers/common/dpaax/Makefile >> index 15b0b38d0..2f4b924fd 100644 >> --- a/drivers/common/dpaax/Makefile >> +++ b/drivers/common/dpaax/Makefile >> @@ -15,6 +15,7 @@ CFLAGS += -Wno-pointer-arith >> CFLAGS += -Wno-cast-qual >> >> CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax >> +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax/caamflib >> >> # versioning export map >> EXPORT_MAP := rte_common_dpaax_version.map >> @@ -22,7 +23,7 @@ EXPORT_MAP := rte_common_dpaax_version.map >> # >> # all source are stored in SRCS-y >> # >> -SRCS-y += dpaax_iova_table.c dpaa_of.c >> +SRCS-y += dpaax_iova_table.c dpaa_of.c caamflib.c >> >> LDLIBS += -lrte_eal >> >> diff --git a/drivers/common/dpaax/caamflib.c b/drivers/common/dpaax/caamflib.c >> new file mode 100644 >> index 000000000..55e20281c >> --- /dev/null >> +++ b/drivers/common/dpaax/caamflib.c >> @@ -0,0 +1,16 @@ >> +/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) >> + * >> + * Copyright 2020 NXP >> + * >> + */ >> + >> +#include >> + >> +/* >> + * SEC HW block revision. >> + * >> + * This *must not be confused with SEC version*: >> + * - SEC HW block revision format is "v" >> + * - SEC revision format is "x.y" >> + */ >> +enum rta_sec_era rta_sec_era; >> diff --git a/drivers/common/dpaax/meson.build b/drivers/common/dpaax/meson.build >> index ff2d1a507..0b8bf7bd5 100644 >> --- a/drivers/common/dpaax/meson.build >> +++ b/drivers/common/dpaax/meson.build >> @@ -6,7 +6,9 @@ if not is_linux >> reason = 'only supported on linux' >> endif >> >> -sources = files('dpaax_iova_table.c', 'dpaa_of.c') >> +sources = files('dpaax_iova_table.c', 'dpaa_of.c', 'caamflib.c') >> + >> +includes += include_directories('caamflib') >> >> cflags += ['-D_GNU_SOURCE'] >> if cc.has_argument('-Wno-cast-qual') >> diff --git a/drivers/common/dpaax/rte_common_dpaax_version.map b/drivers/common/dpaax/rte_common_dpaax_version.map >> index f72eba761..837ce01af 100644 >> --- a/drivers/common/dpaax/rte_common_dpaax_version.map >> +++ b/drivers/common/dpaax/rte_common_dpaax_version.map >> @@ -21,3 +21,7 @@ DPDK_20.0 { >> >> local: *; >> }; >> + >> +INTERNAL { >> + rta_sec_era; >> +}; >> diff --git a/drivers/crypto/caam_jr/Makefile b/drivers/crypto/caam_jr/Makefile >> index 10848884c..89d323817 100644 >> --- a/drivers/crypto/caam_jr/Makefile >> +++ b/drivers/crypto/caam_jr/Makefile >> @@ -14,13 +14,6 @@ CFLAGS += -D _GNU_SOURCE >> CFLAGS += -O3 >> CFLAGS += $(WERROR_FLAGS) >> >> -# FIXME: temporary solution for Bugzilla 469 >> -ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y) >> -ifeq ($(shell test $(GCC_VERSION) -ge 100 && echo 1), 1) >> -CFLAGS += -fcommon >> -endif >> -endif >> - >> CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa/include >> CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax >> CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax/caamflib/ >> diff --git a/drivers/crypto/caam_jr/caam_jr.c b/drivers/crypto/caam_jr/caam_jr.c >> index 5a29dd169..45003ba25 100644 >> --- a/drivers/crypto/caam_jr/caam_jr.c >> +++ b/drivers/crypto/caam_jr/caam_jr.c >> @@ -37,8 +37,6 @@ >> static uint8_t cryptodev_driver_id; >> int caam_jr_logtype; >> >> -enum rta_sec_era rta_sec_era; >> - >> /* Lists the states possible for the SEC user space driver. */ >> enum sec_driver_state_e { >> SEC_DRIVER_STATE_IDLE, /* Driver not initialized */ >> diff --git a/drivers/crypto/caam_jr/meson.build b/drivers/crypto/caam_jr/meson.build >> index 551b13632..f8b5250a9 100644 >> --- a/drivers/crypto/caam_jr/meson.build >> +++ b/drivers/crypto/caam_jr/meson.build >> @@ -12,11 +12,6 @@ sources = files('caam_jr_capabilities.c', >> 'caam_jr_uio.c', >> 'caam_jr.c') >> >> -# FIXME: temporary solution for Bugzilla 469 >> -if (toolchain == 'gcc' and cc.version().version_compare('>=10.0.0')) >> - cflags += '-fcommon' >> -endif >> - >> includes += include_directories('../../bus/dpaa/include/') >> includes += include_directories('../../common/dpaax/') >> includes += include_directories('../../common/dpaax/caamflib/') >> diff --git a/drivers/crypto/dpaa2_sec/Makefile b/drivers/crypto/dpaa2_sec/Makefile >> index 8ce637db6..a0a279557 100644 >> --- a/drivers/crypto/dpaa2_sec/Makefile >> +++ b/drivers/crypto/dpaa2_sec/Makefile >> @@ -19,13 +19,6 @@ CFLAGS += -Wno-implicit-fallthrough >> endif >> endif >> >> -# FIXME: temporary solution for Bugzilla 469 >> -ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y) >> -ifeq ($(shell test $(GCC_VERSION) -ge 100 && echo 1), 1) >> -CFLAGS += -fcommon >> -endif >> -endif >> - >> CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax >> CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax/caamflib >> CFLAGS += -I$(RTE_SDK)/drivers/crypto/dpaa2_sec/ >> diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c >> index fe34e644c..6459a025b 100644 >> --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c >> +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c >> @@ -56,8 +56,6 @@ >> #define SEC_FLC_DHR_OUTBOUND -114 >> #define SEC_FLC_DHR_INBOUND 0 >> >> -enum rta_sec_era rta_sec_era = RTA_SEC_ERA_8; >> - >> static uint8_t cryptodev_driver_id; >> >> int dpaa2_logtype_sec; >> @@ -3870,6 +3868,8 @@ cryptodev_dpaa2_sec_probe(struct rte_dpaa2_driver *dpaa2_drv __rte_unused, >> >> if (dpaa2_svr_family == SVR_LX2160A) >> rta_set_sec_era(RTA_SEC_ERA_10); >> + else >> + rta_set_sec_era(RTA_SEC_ERA_8); >> >> DPAA2_SEC_INFO("2-SEC ERA is %d", rta_get_sec_era()); >> >> diff --git a/drivers/crypto/dpaa2_sec/meson.build b/drivers/crypto/dpaa2_sec/meson.build >> index 505ad9414..cb1c2d049 100644 >> --- a/drivers/crypto/dpaa2_sec/meson.build >> +++ b/drivers/crypto/dpaa2_sec/meson.build >> @@ -10,9 +10,4 @@ deps += ['security', 'mempool_dpaa2'] >> sources = files('dpaa2_sec_dpseci.c', >> 'mc/dpseci.c') >> >> -# FIXME: temporary solution for Bugzilla 469 >> -if (toolchain == 'gcc' and cc.version().version_compare('>=10.0.0')) >> - cflags += '-fcommon' >> -endif >> - >> includes += include_directories('mc', '../../common/dpaax', '../../common/dpaax/caamflib') >> diff --git a/drivers/crypto/dpaa_sec/Makefile b/drivers/crypto/dpaa_sec/Makefile >> index 6cf392cb3..ea266962a 100644 >> --- a/drivers/crypto/dpaa_sec/Makefile >> +++ b/drivers/crypto/dpaa_sec/Makefile >> @@ -13,13 +13,6 @@ LIB = librte_pmd_dpaa_sec.a >> CFLAGS += -O3 >> CFLAGS += $(WERROR_FLAGS) >> >> -# FIXME: temporary solution for Bugzilla 469 >> -ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y) >> -ifeq ($(shell test $(GCC_VERSION) -ge 100 && echo 1), 1) >> -CFLAGS += -fcommon >> -endif >> -endif >> - >> CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa >> CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa/include >> CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa/base/qbman >> diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c >> index 25dcbd259..a9bfb8685 100644 >> --- a/drivers/crypto/dpaa_sec/dpaa_sec.c >> +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c >> @@ -43,8 +43,6 @@ >> #include >> #include >> >> -enum rta_sec_era rta_sec_era; >> - >> int dpaa_logtype_sec; >> >> static uint8_t cryptodev_driver_id; >> diff --git a/drivers/crypto/dpaa_sec/meson.build b/drivers/crypto/dpaa_sec/meson.build >> index f5e660457..7d422d8d5 100644 >> --- a/drivers/crypto/dpaa_sec/meson.build >> +++ b/drivers/crypto/dpaa_sec/meson.build >> @@ -9,11 +9,6 @@ endif >> deps += ['bus_dpaa', 'mempool_dpaa', 'security'] >> sources = files('dpaa_sec.c') >> >> -# FIXME: temporary solution for Bugzilla 469 >> -if (toolchain == 'gcc' and cc.version().version_compare('>=10.0.0')) >> - cflags += '-fcommon' >> -endif >> - >> includes += include_directories('../../bus/dpaa/include') >> includes += include_directories('../../common/dpaax') >> includes += include_directories('../../common/dpaax/caamflib/') >> > Acked-by: Ray Kinsella