From patchwork Tue Oct 22 11:54:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Andrzej Ostruszka [C]" X-Patchwork-Id: 61642 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 440114C8E; Tue, 22 Oct 2019 13:54:22 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 91D691BEC5 for ; Tue, 22 Oct 2019 13:54:21 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x9MBeNnb014346; Tue, 22 Oct 2019 04:54:20 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0818; bh=NQYnnbBBEGD5fydU90FbXDn9DQEpFbDeT8XMahZlfNs=; b=QmobpDGsN7Bk7U2L2kI1lI8oFfY9SULHZbGVqaAsMOYzNbB0LZ4xLv6e2rJi/ZPoeMxN QRVjjlS8KXuvSFIzJ1jvk34oV2kZA9IgwOU5a0HRIkO3lbf85ZL34i7xIeNvvHSaQ5X7 ytr+iklakfDYfJDZFmvnSOFEB9TVHaFpSE2z7Ag6uwJbeBJID2jHeHh8H/CulpQDGCy2 iFlNtWfFxWpU9E15ctkGMocy3ymRNHnDkV14B/3aLO39bz3XvC+uP/A0xiy4T14nIE1D J5fv8Vsgu8bw9/mqWml3fWGINXX3eIgp0D8KdW5WcMte6zRc3/JJN35X6R0BVcOIVDOo nw== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0a-0016f401.pphosted.com with ESMTP id 2vsyjh8abr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 22 Oct 2019 04:54:19 -0700 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 22 Oct 2019 04:54:18 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Tue, 22 Oct 2019 04:54:18 -0700 Received: from amok.marvell.com (unknown [10.95.130.40]) by maili.marvell.com (Postfix) with ESMTP id 659843F703F; Tue, 22 Oct 2019 04:54:15 -0700 (PDT) From: Andrzej Ostruszka To: , Aaron Conole , Michael Santana , Thomas Monjalon , John McNamara , Marko Kovacevic , David Hunt , Bruce Richardson , Vladimir Medvedkin , Robert Sanford , Erik Gabriel Carrillo CC: , Date: Tue, 22 Oct 2019 13:54:03 +0200 Message-ID: <20191022115412.8837-2-aostruszka@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191022115412.8837-1-aostruszka@marvell.com> References: <20190917075754.8310-1-amo@semihalf.com> <20191022115412.8837-1-aostruszka@marvell.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,1.0.8 definitions=2019-10-22_03:2019-10-22,2019-10-22 signatures=0 Subject: [dpdk-dev] [PATCH v4 01/10] build: add an option to enable LTO build 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" This patch adds an option to enable link time optimization. In addition to LTO option itself (-flto) fat-lto-objects are being used. This is because during the build pmdinfogen scans the generated ELF objects to find this_pmd_name* symbol in symbol table. Without fat-lto-objects gcc produces ELF only with extra symbols for internal use during linking. Signed-off-by: Andrzej Ostruszka Acked-by: Bruce Richardson --- .travis.yml | 7 ++++ config/common_base | 5 +++ config/meson.build | 13 +++++++ doc/guides/prog_guide/lto.rst | 36 ++++++++++++++++++++ doc/guides/rel_notes/release_19_11.rst | 8 +++++ lib/librte_distributor/rte_distributor.c | 18 +++++----- lib/librte_distributor/rte_distributor_v20.c | 18 +++++----- lib/librte_lpm/rte_lpm.c | 28 +++++++-------- lib/librte_lpm/rte_lpm6.c | 16 ++++----- lib/librte_timer/rte_timer.c | 20 +++++------ mk/toolchain/gcc/rte.toolchain-compat.mk | 4 +++ mk/toolchain/gcc/rte.vars.mk | 12 +++++++ mk/toolchain/icc/rte.vars.mk | 8 +++++ 13 files changed, 143 insertions(+), 50 deletions(-) create mode 100644 doc/guides/prog_guide/lto.rst diff --git a/.travis.yml b/.travis.yml index 781f9f666..70d221852 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,6 +31,7 @@ env: - DEF_LIB="static" OPTS="-Denable_kmods=false" - DEF_LIB="shared" OPTS="-Denable_kmods=false" - DEF_LIB="shared" RUN_TESTS=1 BUILD_DOCS=1 + - DEF_LIB="shared" OPTS="-Db_lto=true" matrix: include: @@ -100,6 +101,12 @@ matrix: apt: packages: - *extra_packages + - env: DEF_LIB="shared" OPTS="-Db_lto=true" EXTRA_PACKAGES=1 + compiler: gcc + addons: + apt: + packages: + - *extra_packages script: ./.ci/${TRAVIS_OS_NAME}-build.sh diff --git a/config/common_base b/config/common_base index 8ef75c203..73a55fdec 100644 --- a/config/common_base +++ b/config/common_base @@ -49,6 +49,11 @@ CONFIG_RTE_FORCE_INTRINSICS=n # CONFIG_RTE_ARCH_STRICT_ALIGN=n +# +# Enable link time optimization +# +CONFIG_RTE_ENABLE_LTO=n + # # Compile to share library # diff --git a/config/meson.build b/config/meson.build index 2bafea530..1a5093118 100644 --- a/config/meson.build +++ b/config/meson.build @@ -196,3 +196,16 @@ add_project_arguments('-D_GNU_SOURCE', language: 'c') if is_freebsd add_project_arguments('-D__BSD_VISIBLE', language: 'c') endif + +if get_option('b_lto') + if cc.has_argument('-ffat-lto-objects') + add_project_arguments('-ffat-lto-objects', language: 'c') + else + error('compiler does not support fat LTO objects - please turn LTO off') + endif + # workaround for gcc bug 81440 + if cc.get_id() == 'gcc' and cc.version().version_compare('<8.0') + add_project_arguments('-Wno-lto-type-mismatch', language: 'c') + add_project_link_arguments('-Wno-lto-type-mismatch', language: 'c') + endif +endif diff --git a/doc/guides/prog_guide/lto.rst b/doc/guides/prog_guide/lto.rst new file mode 100644 index 000000000..b6daabc86 --- /dev/null +++ b/doc/guides/prog_guide/lto.rst @@ -0,0 +1,36 @@ +Link Time Optimization +====================== + +The DPDK framework supports compilation with link time optimization +turned on. This depends obviously on the capabilities of the compiler +to do "whole program" optimization at link time and is available only +for compilers that support that feature (gcc and icc). To be more +specific compiler have to support creation of ELF objects containing +both normal code and internal representation (fat-lto-objects). This is +required since during build some code is generated by parsing produced +ELF objects (pmdinfogen). + +The amount of performance gain that one can get from LTO depends on the +compiler and the code that is being compiled. However LTO is also +useful for additional code analysis done by the compiler. In particular +due to interprocedural analysis compiler can produce additional warnings +about variables that might be used uninitialized. Some of these +warnings might be "false positives" though and you might need to +explicitly initialize variable in order to silence the compiler. + +Link time optimization can be enabled for whole DPDK framework by +setting: + +.. code-block:: console + CONFIG_ENABLE_LTO=y + +in config file for the case of make based build and by: + +.. code-block:: console + meson build -Db_lto=true + ninja -C build + +for the case of meson based build. + +Please note that turning LTO on causes considerable extension of +compilation time. diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst index 8490d897c..97b4f4083 100644 --- a/doc/guides/rel_notes/release_19_11.rst +++ b/doc/guides/rel_notes/release_19_11.rst @@ -56,6 +56,14 @@ New Features Also, make sure to start the actual text at the margin. ========================================================= +**Added build support for Link Time Optimization.** + + LTO is an optimization technique used by the compiler to perform whole + program analysis and optimization at link time. In order to do that + compilers store their internal representation of the source code that + the linker uses at the final stage of compilation process. + + See :doc:`../prog_guide/lto` for more information: Removed Items ------------- diff --git a/lib/librte_distributor/rte_distributor.c b/lib/librte_distributor/rte_distributor.c index 21eb1fb0a..848250f4a 100644 --- a/lib/librte_distributor/rte_distributor.c +++ b/lib/librte_distributor/rte_distributor.c @@ -32,7 +32,7 @@ EAL_REGISTER_TAILQ(rte_dist_burst_tailq) /**** Burst Packet APIs called by workers ****/ -void +void __vsym rte_distributor_request_pkt_v1705(struct rte_distributor *d, unsigned int worker_id, struct rte_mbuf **oldpkt, unsigned int count) @@ -84,7 +84,7 @@ MAP_STATIC_SYMBOL(void rte_distributor_request_pkt(struct rte_distributor *d, unsigned int count), rte_distributor_request_pkt_v1705); -int +int __vsym rte_distributor_poll_pkt_v1705(struct rte_distributor *d, unsigned int worker_id, struct rte_mbuf **pkts) { @@ -124,7 +124,7 @@ MAP_STATIC_SYMBOL(int rte_distributor_poll_pkt(struct rte_distributor *d, unsigned int worker_id, struct rte_mbuf **pkts), rte_distributor_poll_pkt_v1705); -int +int __vsym rte_distributor_get_pkt_v1705(struct rte_distributor *d, unsigned int worker_id, struct rte_mbuf **pkts, struct rte_mbuf **oldpkt, unsigned int return_count) @@ -159,7 +159,7 @@ MAP_STATIC_SYMBOL(int rte_distributor_get_pkt(struct rte_distributor *d, struct rte_mbuf **oldpkt, unsigned int return_count), rte_distributor_get_pkt_v1705); -int +int __vsym rte_distributor_return_pkt_v1705(struct rte_distributor *d, unsigned int worker_id, struct rte_mbuf **oldpkt, int num) { @@ -335,7 +335,7 @@ release(struct rte_distributor *d, unsigned int wkr) /* process a set of packets to distribute them to workers */ -int +int __vsym rte_distributor_process_v1705(struct rte_distributor *d, struct rte_mbuf **mbufs, unsigned int num_mbufs) { @@ -476,7 +476,7 @@ MAP_STATIC_SYMBOL(int rte_distributor_process(struct rte_distributor *d, rte_distributor_process_v1705); /* return to the caller, packets returned from workers */ -int +int __vsym rte_distributor_returned_pkts_v1705(struct rte_distributor *d, struct rte_mbuf **mbufs, unsigned int max_mbufs) { @@ -526,7 +526,7 @@ total_outstanding(const struct rte_distributor *d) * Flush the distributor, so that there are no outstanding packets in flight or * queued up. */ -int +int __vsym rte_distributor_flush_v1705(struct rte_distributor *d) { unsigned int flushed; @@ -561,7 +561,7 @@ MAP_STATIC_SYMBOL(int rte_distributor_flush(struct rte_distributor *d), rte_distributor_flush_v1705); /* clears the internal returns array in the distributor */ -void +void __vsym rte_distributor_clear_returns_v1705(struct rte_distributor *d) { unsigned int wkr; @@ -581,7 +581,7 @@ MAP_STATIC_SYMBOL(void rte_distributor_clear_returns(struct rte_distributor *d), rte_distributor_clear_returns_v1705); /* creates a distributor instance */ -struct rte_distributor * +struct rte_distributor * __vsym rte_distributor_create_v1705(const char *name, unsigned int socket_id, unsigned int num_workers, diff --git a/lib/librte_distributor/rte_distributor_v20.c b/lib/librte_distributor/rte_distributor_v20.c index cdc0969a8..31c766421 100644 --- a/lib/librte_distributor/rte_distributor_v20.c +++ b/lib/librte_distributor/rte_distributor_v20.c @@ -27,7 +27,7 @@ EAL_REGISTER_TAILQ(rte_distributor_tailq) /**** APIs called by workers ****/ -void +void __vsym rte_distributor_request_pkt_v20(struct rte_distributor_v20 *d, unsigned worker_id, struct rte_mbuf *oldpkt) { @@ -40,7 +40,7 @@ rte_distributor_request_pkt_v20(struct rte_distributor_v20 *d, } VERSION_SYMBOL(rte_distributor_request_pkt, _v20, 2.0); -struct rte_mbuf * +struct rte_mbuf * __vsym rte_distributor_poll_pkt_v20(struct rte_distributor_v20 *d, unsigned worker_id) { @@ -54,7 +54,7 @@ rte_distributor_poll_pkt_v20(struct rte_distributor_v20 *d, } VERSION_SYMBOL(rte_distributor_poll_pkt, _v20, 2.0); -struct rte_mbuf * +struct rte_mbuf * __vsym rte_distributor_get_pkt_v20(struct rte_distributor_v20 *d, unsigned worker_id, struct rte_mbuf *oldpkt) { @@ -66,7 +66,7 @@ rte_distributor_get_pkt_v20(struct rte_distributor_v20 *d, } VERSION_SYMBOL(rte_distributor_get_pkt, _v20, 2.0); -int +int __vsym rte_distributor_return_pkt_v20(struct rte_distributor_v20 *d, unsigned worker_id, struct rte_mbuf *oldpkt) { @@ -191,7 +191,7 @@ process_returns(struct rte_distributor_v20 *d) } /* process a set of packets to distribute them to workers */ -int +int __vsym rte_distributor_process_v20(struct rte_distributor_v20 *d, struct rte_mbuf **mbufs, unsigned num_mbufs) { @@ -296,7 +296,7 @@ rte_distributor_process_v20(struct rte_distributor_v20 *d, VERSION_SYMBOL(rte_distributor_process, _v20, 2.0); /* return to the caller, packets returned from workers */ -int +int __vsym rte_distributor_returned_pkts_v20(struct rte_distributor_v20 *d, struct rte_mbuf **mbufs, unsigned max_mbufs) { @@ -334,7 +334,7 @@ total_outstanding(const struct rte_distributor_v20 *d) /* flush the distributor, so that there are no outstanding packets in flight or * queued up. */ -int +int __vsym rte_distributor_flush_v20(struct rte_distributor_v20 *d) { const unsigned flushed = total_outstanding(d); @@ -347,7 +347,7 @@ rte_distributor_flush_v20(struct rte_distributor_v20 *d) VERSION_SYMBOL(rte_distributor_flush, _v20, 2.0); /* clears the internal returns array in the distributor */ -void +void __vsym rte_distributor_clear_returns_v20(struct rte_distributor_v20 *d) { d->returns.start = d->returns.count = 0; @@ -358,7 +358,7 @@ rte_distributor_clear_returns_v20(struct rte_distributor_v20 *d) VERSION_SYMBOL(rte_distributor_clear_returns, _v20, 2.0); /* creates a distributor instance */ -struct rte_distributor_v20 * +struct rte_distributor_v20 * __vsym rte_distributor_create_v20(const char *name, unsigned socket_id, unsigned num_workers) diff --git a/lib/librte_lpm/rte_lpm.c b/lib/librte_lpm/rte_lpm.c index 3a929a1b1..a2fba8d61 100644 --- a/lib/librte_lpm/rte_lpm.c +++ b/lib/librte_lpm/rte_lpm.c @@ -89,7 +89,7 @@ depth_to_range(uint8_t depth) /* * Find an existing lpm table and return a pointer to it. */ -struct rte_lpm_v20 * +struct rte_lpm_v20 * __vsym rte_lpm_find_existing_v20(const char *name) { struct rte_lpm_v20 *l = NULL; @@ -115,7 +115,7 @@ rte_lpm_find_existing_v20(const char *name) } VERSION_SYMBOL(rte_lpm_find_existing, _v20, 2.0); -struct rte_lpm * +struct rte_lpm * __vsym rte_lpm_find_existing_v1604(const char *name) { struct rte_lpm *l = NULL; @@ -146,7 +146,7 @@ MAP_STATIC_SYMBOL(struct rte_lpm *rte_lpm_find_existing(const char *name), /* * Allocates memory for LPM object */ -struct rte_lpm_v20 * +struct rte_lpm_v20 * __vsym rte_lpm_create_v20(const char *name, int socket_id, int max_rules, __rte_unused int flags) { @@ -219,7 +219,7 @@ rte_lpm_create_v20(const char *name, int socket_id, int max_rules, } VERSION_SYMBOL(rte_lpm_create, _v20, 2.0); -struct rte_lpm * +struct rte_lpm * __vsym rte_lpm_create_v1604(const char *name, int socket_id, const struct rte_lpm_config *config) { @@ -328,7 +328,7 @@ MAP_STATIC_SYMBOL( /* * Deallocates memory for given LPM table. */ -void +void __vsym rte_lpm_free_v20(struct rte_lpm_v20 *lpm) { struct rte_lpm_list *lpm_list; @@ -357,7 +357,7 @@ rte_lpm_free_v20(struct rte_lpm_v20 *lpm) } VERSION_SYMBOL(rte_lpm_free, _v20, 2.0); -void +void __vsym rte_lpm_free_v1604(struct rte_lpm *lpm) { struct rte_lpm_list *lpm_list; @@ -1176,7 +1176,7 @@ add_depth_big_v1604(struct rte_lpm *lpm, uint32_t ip_masked, uint8_t depth, /* * Add a route */ -int +int __vsym rte_lpm_add_v20(struct rte_lpm_v20 *lpm, uint32_t ip, uint8_t depth, uint8_t next_hop) { @@ -1217,7 +1217,7 @@ rte_lpm_add_v20(struct rte_lpm_v20 *lpm, uint32_t ip, uint8_t depth, } VERSION_SYMBOL(rte_lpm_add, _v20, 2.0); -int +int __vsym rte_lpm_add_v1604(struct rte_lpm *lpm, uint32_t ip, uint8_t depth, uint32_t next_hop) { @@ -1263,7 +1263,7 @@ MAP_STATIC_SYMBOL(int rte_lpm_add(struct rte_lpm *lpm, uint32_t ip, /* * Look for a rule in the high-level rules table */ -int +int __vsym rte_lpm_is_rule_present_v20(struct rte_lpm_v20 *lpm, uint32_t ip, uint8_t depth, uint8_t *next_hop) { @@ -1290,7 +1290,7 @@ uint8_t *next_hop) } VERSION_SYMBOL(rte_lpm_is_rule_present, _v20, 2.0); -int +int __vsym rte_lpm_is_rule_present_v1604(struct rte_lpm *lpm, uint32_t ip, uint8_t depth, uint32_t *next_hop) { @@ -1843,7 +1843,7 @@ delete_depth_big_v1604(struct rte_lpm *lpm, uint32_t ip_masked, /* * Deletes a rule */ -int +int __vsym rte_lpm_delete_v20(struct rte_lpm_v20 *lpm, uint32_t ip, uint8_t depth) { int32_t rule_to_delete_index, sub_rule_index; @@ -1897,7 +1897,7 @@ rte_lpm_delete_v20(struct rte_lpm_v20 *lpm, uint32_t ip, uint8_t depth) } VERSION_SYMBOL(rte_lpm_delete, _v20, 2.0); -int +int __vsym rte_lpm_delete_v1604(struct rte_lpm *lpm, uint32_t ip, uint8_t depth) { int32_t rule_to_delete_index, sub_rule_index; @@ -1956,7 +1956,7 @@ MAP_STATIC_SYMBOL(int rte_lpm_delete(struct rte_lpm *lpm, uint32_t ip, /* * Delete all rules from the LPM table. */ -void +void __vsym rte_lpm_delete_all_v20(struct rte_lpm_v20 *lpm) { /* Zero rule information. */ @@ -1973,7 +1973,7 @@ rte_lpm_delete_all_v20(struct rte_lpm_v20 *lpm) } VERSION_SYMBOL(rte_lpm_delete_all, _v20, 2.0); -void +void __vsym rte_lpm_delete_all_v1604(struct rte_lpm *lpm) { /* Zero rule information. */ diff --git a/lib/librte_lpm/rte_lpm6.c b/lib/librte_lpm/rte_lpm6.c index 9b8aeb972..49a7fea1d 100644 --- a/lib/librte_lpm/rte_lpm6.c +++ b/lib/librte_lpm/rte_lpm6.c @@ -811,7 +811,7 @@ add_step(struct rte_lpm6 *lpm, struct rte_lpm6_tbl_entry *tbl, /* * Add a route */ -int +int __vsym rte_lpm6_add_v20(struct rte_lpm6 *lpm, uint8_t *ip, uint8_t depth, uint8_t next_hop) { @@ -861,7 +861,7 @@ simulate_add(struct rte_lpm6 *lpm, const uint8_t *masked_ip, uint8_t depth) return 0; } -int +int __vsym rte_lpm6_add_v1705(struct rte_lpm6 *lpm, uint8_t *ip, uint8_t depth, uint32_t next_hop) { @@ -954,7 +954,7 @@ lookup_step(const struct rte_lpm6 *lpm, const struct rte_lpm6_tbl_entry *tbl, /* * Looks up an IP */ -int +int __vsym rte_lpm6_lookup_v20(const struct rte_lpm6 *lpm, uint8_t *ip, uint8_t *next_hop) { uint32_t next_hop32 = 0; @@ -972,7 +972,7 @@ rte_lpm6_lookup_v20(const struct rte_lpm6 *lpm, uint8_t *ip, uint8_t *next_hop) } VERSION_SYMBOL(rte_lpm6_lookup, _v20, 2.0); -int +int __vsym rte_lpm6_lookup_v1705(const struct rte_lpm6 *lpm, uint8_t *ip, uint32_t *next_hop) { @@ -1007,7 +1007,7 @@ MAP_STATIC_SYMBOL(int rte_lpm6_lookup(const struct rte_lpm6 *lpm, uint8_t *ip, /* * Looks up a group of IP addresses */ -int +int __vsym rte_lpm6_lookup_bulk_func_v20(const struct rte_lpm6 *lpm, uint8_t ips[][RTE_LPM6_IPV6_ADDR_SIZE], int16_t * next_hops, unsigned n) @@ -1048,7 +1048,7 @@ rte_lpm6_lookup_bulk_func_v20(const struct rte_lpm6 *lpm, } VERSION_SYMBOL(rte_lpm6_lookup_bulk_func, _v20, 2.0); -int +int __vsym rte_lpm6_lookup_bulk_func_v1705(const struct rte_lpm6 *lpm, uint8_t ips[][RTE_LPM6_IPV6_ADDR_SIZE], int32_t *next_hops, unsigned int n) @@ -1098,7 +1098,7 @@ MAP_STATIC_SYMBOL(int rte_lpm6_lookup_bulk_func(const struct rte_lpm6 *lpm, /* * Look for a rule in the high-level rules table */ -int +int __vsym rte_lpm6_is_rule_present_v20(struct rte_lpm6 *lpm, uint8_t *ip, uint8_t depth, uint8_t *next_hop) { @@ -1118,7 +1118,7 @@ rte_lpm6_is_rule_present_v20(struct rte_lpm6 *lpm, uint8_t *ip, uint8_t depth, } VERSION_SYMBOL(rte_lpm6_is_rule_present, _v20, 2.0); -int +int __vsym rte_lpm6_is_rule_present_v1705(struct rte_lpm6 *lpm, uint8_t *ip, uint8_t depth, uint32_t *next_hop) { diff --git a/lib/librte_timer/rte_timer.c b/lib/librte_timer/rte_timer.c index bdcf05d06..e560ace06 100644 --- a/lib/librte_timer/rte_timer.c +++ b/lib/librte_timer/rte_timer.c @@ -131,7 +131,7 @@ rte_timer_data_dealloc(uint32_t id) return 0; } -void +void __vsym rte_timer_subsystem_init_v20(void) { unsigned lcore_id; @@ -153,7 +153,7 @@ VERSION_SYMBOL(rte_timer_subsystem_init, _v20, 2.0); * secondary processes should be empty, the zeroth entry can be shared by * multiple processes. */ -int +int __vsym rte_timer_subsystem_init_v1905(void) { const struct rte_memzone *mz; @@ -551,7 +551,7 @@ __rte_timer_reset(struct rte_timer *tim, uint64_t expire, } /* Reset and start the timer associated with the timer handle tim */ -int +int __vsym rte_timer_reset_v20(struct rte_timer *tim, uint64_t ticks, enum rte_timer_type type, unsigned int tim_lcore, rte_timer_cb_t fct, void *arg) @@ -574,7 +574,7 @@ rte_timer_reset_v20(struct rte_timer *tim, uint64_t ticks, } VERSION_SYMBOL(rte_timer_reset, _v20, 2.0); -int +int __vsym rte_timer_reset_v1905(struct rte_timer *tim, uint64_t ticks, enum rte_timer_type type, unsigned int tim_lcore, rte_timer_cb_t fct, void *arg) @@ -657,14 +657,14 @@ __rte_timer_stop(struct rte_timer *tim, int local_is_locked, } /* Stop the timer associated with the timer handle tim */ -int +int __vsym rte_timer_stop_v20(struct rte_timer *tim) { return __rte_timer_stop(tim, 0, &default_timer_data); } VERSION_SYMBOL(rte_timer_stop, _v20, 2.0); -int +int __vsym rte_timer_stop_v1905(struct rte_timer *tim) { return rte_timer_alt_stop(default_data_id, tim); @@ -817,14 +817,14 @@ __rte_timer_manage(struct rte_timer_data *timer_data) priv_timer[lcore_id].running_tim = NULL; } -void +void __vsym rte_timer_manage_v20(void) { __rte_timer_manage(&default_timer_data); } VERSION_SYMBOL(rte_timer_manage, _v20, 2.0); -int +int __vsym rte_timer_manage_v1905(void) { struct rte_timer_data *timer_data; @@ -1074,14 +1074,14 @@ __rte_timer_dump_stats(struct rte_timer_data *timer_data __rte_unused, FILE *f) #endif } -void +void __vsym rte_timer_dump_stats_v20(FILE *f) { __rte_timer_dump_stats(&default_timer_data, f); } VERSION_SYMBOL(rte_timer_dump_stats, _v20, 2.0); -int +int __vsym rte_timer_dump_stats_v1905(FILE *f) { return rte_timer_alt_dump_stats(default_data_id, f); diff --git a/mk/toolchain/gcc/rte.toolchain-compat.mk b/mk/toolchain/gcc/rte.toolchain-compat.mk index ea40a11c0..ad4fad83c 100644 --- a/mk/toolchain/gcc/rte.toolchain-compat.mk +++ b/mk/toolchain/gcc/rte.toolchain-compat.mk @@ -88,6 +88,10 @@ else MACHINE_CFLAGS := $(filter-out -march% -mtune% -msse%,$(MACHINE_CFLAGS)) endif + ifeq ($(shell test $(GCC_VERSION) -lt 45 && echo 1), 1) + CONFIG_RTE_ENABLE_LTO=n + endif + # Disable thunderx PMD for gcc < 4.7 ifeq ($(shell test $(GCC_VERSION) -lt 47 && echo 1), 1) CONFIG_RTE_LIBRTE_THUNDERX_NICVF_PMD=d diff --git a/mk/toolchain/gcc/rte.vars.mk b/mk/toolchain/gcc/rte.vars.mk index b852fcfd7..9fc704193 100644 --- a/mk/toolchain/gcc/rte.vars.mk +++ b/mk/toolchain/gcc/rte.vars.mk @@ -62,6 +62,18 @@ endif # process cpu flags include $(RTE_SDK)/mk/toolchain/$(RTE_TOOLCHAIN)/rte.toolchain-compat.mk +ifeq ($(CONFIG_RTE_ENABLE_LTO),y) +# 'fat-lto' is used since pmdinfogen needs to have 'this_pmd_nameX' +# exported in symbol table and without this option only internal +# representation is present. +TOOLCHAIN_CFLAGS += -flto -ffat-lto-objects +TOOLCHAIN_LDFLAGS += -flto +# workaround for GCC bug 81440 +ifeq ($(shell test $(GCC_VERSION) -lt 80 && echo 1), 1) +WERROR_FLAGS += -Wno-lto-type-mismatch +endif +endif + # workaround GCC bug with warning "missing initializer" for "= {0}" ifeq ($(shell test $(GCC_VERSION) -lt 47 && echo 1), 1) WERROR_FLAGS += -Wno-missing-field-initializers diff --git a/mk/toolchain/icc/rte.vars.mk b/mk/toolchain/icc/rte.vars.mk index aa1422bf1..8aa87aa1e 100644 --- a/mk/toolchain/icc/rte.vars.mk +++ b/mk/toolchain/icc/rte.vars.mk @@ -54,5 +54,13 @@ endif # process cpu flags include $(RTE_SDK)/mk/toolchain/$(RTE_TOOLCHAIN)/rte.toolchain-compat.mk +ifeq ($(CONFIG_RTE_ENABLE_LTO),y) +# 'fat-lto' is used since pmdinfogen needs to have 'this_pmd_nameX' +# exported in symbol table and without this option only internal +# representation is present. +TOOLCHAIN_CFLAGS += -flto -ffat-lto-objects +TOOLCHAIN_LDFLAGS += -flto +endif + export CC AS AR LD OBJCOPY OBJDUMP STRIP READELF export TOOLCHAIN_CFLAGS TOOLCHAIN_LDFLAGS TOOLCHAIN_ASFLAGS From patchwork Tue Oct 22 11:54:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Andrzej Ostruszka [C]" X-Patchwork-Id: 61643 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 B5ACA1BED8; Tue, 22 Oct 2019 13:54:25 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 699111BECB for ; Tue, 22 Oct 2019 13:54:23 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x9MBeB9j013979; Tue, 22 Oct 2019 04:54:22 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=pfpt0818; bh=Oo/f8X4wXkUlBUfEOVISYkkGRwFIZCc+9ekgdpPmvw4=; b=HYar7s5MsoNWItGqFKH6YSJRpfYtqUkGL9BN/Hl90oISl8jk3j6R7PAMqotYZSz6Yju8 qB/6Z4bBE4uu3f2Dr8hbH1DjDjWDbfCIwP85VWzidn4yOAL0YITrA6czG+KNEV6D8n8v FHcNf4Tbv1rQohsZmJ+faw/jz88oOgGMSPlZYJ4RP9JKohvDACeIjGEFXQg6MCbPUlKQ LL17QWmjJ35Tlgk0O3wCK1rfUX6uxAm/euKYUYVMhBWqrYqsPZr7DXmQacJepLQF3XZ3 Hx7dpaTz8JaS65ymj2qGgldc1lbJVHEbx5sI3GyDTkI3oTMG+hIvudDKV/TObMZ2Neju Tw== Received: from sc-exch01.marvell.com ([199.233.58.181]) by mx0a-0016f401.pphosted.com with ESMTP id 2vsyjh8ac2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 22 Oct 2019 04:54:22 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 22 Oct 2019 04:54:20 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Tue, 22 Oct 2019 04:54:20 -0700 Received: from amok.marvell.com (unknown [10.95.130.40]) by maili.marvell.com (Postfix) with ESMTP id 293773F7040; Tue, 22 Oct 2019 04:54:18 -0700 (PDT) From: Andrzej Ostruszka To: , Erik Gabriel Carrillo , "Jerin Jacob" CC: , Date: Tue, 22 Oct 2019 13:54:04 +0200 Message-ID: <20191022115412.8837-3-aostruszka@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191022115412.8837-1-aostruszka@marvell.com> References: <20190917075754.8310-1-amo@semihalf.com> <20191022115412.8837-1-aostruszka@marvell.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,1.0.8 definitions=2019-10-22_03:2019-10-22,2019-10-22 signatures=0 Subject: [dpdk-dev] [PATCH v4 02/10] eventdev: fix possible use of uninitialized var 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" Fix the logic for the case of event queue allowing all schedule types. Compiler warning pointing to this error (with LTO enabled): error: ‘sched_type’ may be used uninitialized in this function [-Werror=maybe-uninitialized] if ((ret < 0 && ret != -EOVERFLOW) || Fixes: 6750b21bd6af ("eventdev: add default software timer adapter") Signed-off-by: Andrzej Ostruszka --- lib/librte_eventdev/rte_event_timer_adapter.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/librte_eventdev/rte_event_timer_adapter.c b/lib/librte_eventdev/rte_event_timer_adapter.c index 5ce399eca..161e21a68 100644 --- a/lib/librte_eventdev/rte_event_timer_adapter.c +++ b/lib/librte_eventdev/rte_event_timer_adapter.c @@ -706,11 +706,11 @@ check_destination_event_queue(struct rte_event_timer *evtim, RTE_EVENT_QUEUE_ATTR_SCHEDULE_TYPE, &sched_type); - if ((ret < 0 && ret != -EOVERFLOW) || - evtim->ev.sched_type != sched_type) - return -1; + if ((ret == 0 && evtim->ev.sched_type == sched_type) || + ret == -EOVERFLOW) + return 0; - return 0; + return -1; } static int From patchwork Tue Oct 22 11:54:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Andrzej Ostruszka [C]" X-Patchwork-Id: 61644 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 865621BEDF; Tue, 22 Oct 2019 13:54:28 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id A606C1BEC9 for ; Tue, 22 Oct 2019 13:54:24 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x9MBdM65006144; Tue, 22 Oct 2019 04:54:24 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=pfpt0818; bh=TsJmaAL0NkccMvwOA5ARJlAqYwW5+D8YZrxS9C05fX0=; b=lavLYVFkgHchm0deM0yvVdSEQ5hJ1QRaStezlBzCZcoX5Q4pOB+9yojp/bKl93AYyvXv HPoTsrPGr8Oa4SkvsIcCjWWl5qO+qVcx+ICw4cWJo2/Rzx1nBcI/wObmOmcZoeFGvmyX Au4RBXL8AVeMOGbbwLL+StA6t8DADZxgYNktdpnGPjXKuFIjSQSkKH0oDC22kzKqbspt On8Glm2qL2UVywEL4dHJemasDl8UFY/cNPVi/CSNt3jnnAqM3F+Q+kCympDnsXwydSfc WdkucfV75Q9PjP5YFl/n42Z1eBkIxSNfC7fQz3cB6feZX/oiNS/JRidDZp9olahGjBrf Bw== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0b-0016f401.pphosted.com with ESMTP id 2vsw610stf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 22 Oct 2019 04:54:23 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 22 Oct 2019 04:54:22 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Tue, 22 Oct 2019 04:54:22 -0700 Received: from amok.marvell.com (unknown [10.95.130.40]) by maili.marvell.com (Postfix) with ESMTP id 22A963F703F; Tue, 22 Oct 2019 04:54:20 -0700 (PDT) From: Andrzej Ostruszka To: , Jerin Jacob CC: , Date: Tue, 22 Oct 2019 13:54:05 +0200 Message-ID: <20191022115412.8837-4-aostruszka@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191022115412.8837-1-aostruszka@marvell.com> References: <20190917075754.8310-1-amo@semihalf.com> <20191022115412.8837-1-aostruszka@marvell.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,1.0.8 definitions=2019-10-22_03:2019-10-22,2019-10-22 signatures=0 Subject: [dpdk-dev] [PATCH v4 03/10] app/eventdev: clean LTO build warnings (maybe-uninitialized) 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" During LTO build compiler reports some 'false positive' warnings about variables being possibly used uninitialized. This patch silences these warnings. Exemplary compiler warning to suppress (with LTO enabled): error: ‘service_id’ may be used uninitialized in this function [-Werror=maybe-uninitialized] ret = evt_service_setup(service_id); Signed-off-by: Andrzej Ostruszka --- app/test-eventdev/test_perf_common.c | 2 +- app/test-eventdev/test_pipeline_common.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/test-eventdev/test_perf_common.c b/app/test-eventdev/test_perf_common.c index aa925a7ef..a974685cb 100644 --- a/app/test-eventdev/test_perf_common.c +++ b/app/test-eventdev/test_perf_common.c @@ -439,7 +439,7 @@ perf_event_timer_adapter_setup(struct test_perf *t) if (!(adapter_info.caps & RTE_EVENT_TIMER_ADAPTER_CAP_INTERNAL_PORT)) { - uint32_t service_id; + uint32_t service_id = -1U; rte_event_timer_adapter_service_id_get(wl, &service_id); diff --git a/app/test-eventdev/test_pipeline_common.c b/app/test-eventdev/test_pipeline_common.c index 16c49b860..813d0cf44 100644 --- a/app/test-eventdev/test_pipeline_common.c +++ b/app/test-eventdev/test_pipeline_common.c @@ -306,7 +306,7 @@ pipeline_event_rx_adapter_setup(struct evt_options *opt, uint8_t stride, } if (!(cap & RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT)) { - uint32_t service_id; + uint32_t service_id = -1U; rte_event_eth_rx_adapter_service_id_get(prod, &service_id); @@ -358,7 +358,7 @@ pipeline_event_tx_adapter_setup(struct evt_options *opt, } if (!(cap & RTE_EVENT_ETH_TX_ADAPTER_CAP_INTERNAL_PORT)) { - uint32_t service_id; + uint32_t service_id = -1U; rte_event_eth_tx_adapter_service_id_get(consm, &service_id); From patchwork Tue Oct 22 11:54:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Andrzej Ostruszka [C]" X-Patchwork-Id: 61645 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 958811BEE8; Tue, 22 Oct 2019 13:54:30 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 359641BEDB for ; Tue, 22 Oct 2019 13:54:26 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x9MBfddx015564; Tue, 22 Oct 2019 04:54:25 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=pfpt0818; bh=WtvEUYqBckyrkeuEw6xumA+/HgwP3du6EeauYxeRtMw=; b=b4ljnFTeRvfjVnVfwkyX7rxubvoXzyUKtiSAhBdCsAUPQgFO06Rgq4JswkJi+g29Skwn CPoYSuOI/Y9zgeJ/D70LQOZQNiVk7MfhVjEx2JFbYxXeiXJtP49tr1c5QxOnahEsNChH owm+Yka5R691YSFzrGkyGuqWANnZXMe6ftEk2dRLACAW7ZcnfJjzOyPYwMTiJVY8ybM6 SDpH/h59z+XIFIVFscknYIVb2n23xbbYWhoXotK+9ifx+SzGsHysbbpNDK7nWxHLEzIM ztuBhgEmPuaTN9qlLGZMSMBIPAtoFdKsztTrtsyw4WGo9uMbs4iyd6qn3IiWAMsJF1aF hw== Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0a-0016f401.pphosted.com with ESMTP id 2vsyjh8ac9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 22 Oct 2019 04:54:25 -0700 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 22 Oct 2019 04:54:24 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Tue, 22 Oct 2019 04:54:24 -0700 Received: from amok.marvell.com (unknown [10.95.130.40]) by maili.marvell.com (Postfix) with ESMTP id D2E0B3F7040; Tue, 22 Oct 2019 04:54:22 -0700 (PDT) From: Andrzej Ostruszka To: , Pavan Nikhilesh , Jerin Jacob CC: , Date: Tue, 22 Oct 2019 13:54:06 +0200 Message-ID: <20191022115412.8837-5-aostruszka@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191022115412.8837-1-aostruszka@marvell.com> References: <20190917075754.8310-1-amo@semihalf.com> <20191022115412.8837-1-aostruszka@marvell.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,1.0.8 definitions=2019-10-22_03:2019-10-22,2019-10-22 signatures=0 Subject: [dpdk-dev] [PATCH v4 04/10] event/octeontx2: clean LTO build warnings (maybe-uninitialized) 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" During LTO build compiler reports some 'false positive' warnings about variables being possibly used uninitialized. This patch silences these warnings. Exemplary compiler warning to suppress (with LTO enabled): error: ‘chunk’ may be used uninitialized in this function [-Werror=maybe-uninitialized] bkt->current_chunk = (uintptr_t)chunk; Signed-off-by: Andrzej Ostruszka --- drivers/event/octeontx2/otx2_tim_worker.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/event/octeontx2/otx2_tim_worker.h b/drivers/event/octeontx2/otx2_tim_worker.h index b193e2cab..50db6543c 100644 --- a/drivers/event/octeontx2/otx2_tim_worker.h +++ b/drivers/event/octeontx2/otx2_tim_worker.h @@ -337,7 +337,7 @@ tim_add_entry_brst(struct otx2_tim_ring * const tim_ring, const struct otx2_tim_ent *ents, const uint16_t nb_timers, const uint8_t flags) { - struct otx2_tim_ent *chunk; + struct otx2_tim_ent *chunk = NULL; struct otx2_tim_bkt *bkt; uint16_t chunk_remainder; uint16_t index = 0; From patchwork Tue Oct 22 11:54:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Andrzej Ostruszka [C]" X-Patchwork-Id: 61646 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 3FFD41BEF0; Tue, 22 Oct 2019 13:54:33 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 3598B1BEE3 for ; Tue, 22 Oct 2019 13:54:30 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x9MBeUOs014357; Tue, 22 Oct 2019 04:54:28 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=pfpt0818; bh=zUC9hTqMxCcFUGosYMDTyS1xGS9DIRRdY1DIS1wI0p8=; b=aEAZNQsK7uymWgW2jT3X5XhIM51ioASY9i3BaLHyotx+48YJIj4EJ1sHvFrZq+XH+WWQ RJZ7Vxlqj3RwQ7TKhIerRRINigRzujj8I9K6Yl9McB4rKEMfUinnXLLcbacjxbzGRJGm Y3tXSgLyqwxKFLMA+igE4sneloDYNIpkpZzP0O9a33WltppEYSa4JtR801xRo3ruj7AY /u8RW/1IqYzW0GxtU+QZx2BEnUHdisqy4bzcqvMRfjOGtHnX0shj4P3ewKbWx8w1Dc3q dVUq3m8TPZ9X7kCakXkAO8icqcP//mEyPZtZKcWgCIomg6C+anjK45hRh0Ii8Ufsfy/W mw== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0a-0016f401.pphosted.com with ESMTP id 2vsyjh8acg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 22 Oct 2019 04:54:28 -0700 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 22 Oct 2019 04:54:27 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Tue, 22 Oct 2019 04:54:27 -0700 Received: from amok.marvell.com (unknown [10.95.130.40]) by maili.marvell.com (Postfix) with ESMTP id CC6473F703F; Tue, 22 Oct 2019 04:54:24 -0700 (PDT) From: Andrzej Ostruszka To: , Yipeng Wang , Sameh Gobriel , Bruce Richardson , Pablo de Lara , Chas Williams , Anatoly Burakov CC: , Date: Tue, 22 Oct 2019 13:54:07 +0200 Message-ID: <20191022115412.8837-6-aostruszka@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191022115412.8837-1-aostruszka@marvell.com> References: <20190917075754.8310-1-amo@semihalf.com> <20191022115412.8837-1-aostruszka@marvell.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,1.0.8 definitions=2019-10-22_03:2019-10-22,2019-10-22 signatures=0 Subject: [dpdk-dev] [PATCH v4 05/10] app/test: clean LTO build warnings (maybe-uninitialized) 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" During LTO build compiler reports some 'false positive' warnings about variables being possibly used uninitialized. This patch silences these warnings. Exemplary compiler warning to suppress (with LTO enabled): error: ‘stats.greatest_free_size’ may be used uninitialized in this function [-Werror=maybe-uninitialized] return len - overhead; Signed-off-by: Andrzej Ostruszka --- app/test/test_hash_readwrite.c | 2 +- app/test/test_link_bonding_mode4.c | 10 ++++++++-- app/test/test_memzone.c | 3 ++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/app/test/test_hash_readwrite.c b/app/test/test_hash_readwrite.c index 4376b099b..615767fb6 100644 --- a/app/test/test_hash_readwrite.c +++ b/app/test/test_hash_readwrite.c @@ -298,7 +298,7 @@ test_rw_reader(void *arg) begin = rte_rdtsc_precise(); for (i = 0; i < read_cnt; i++) { - void *data; + void *data = arg; rte_hash_lookup_data(tbl_rw_test_param.h, tbl_rw_test_param.keys + i, &data); diff --git a/app/test/test_link_bonding_mode4.c b/app/test/test_link_bonding_mode4.c index bbb4e9cce..5f7df1b5e 100644 --- a/app/test/test_link_bonding_mode4.c +++ b/app/test/test_link_bonding_mode4.c @@ -224,7 +224,7 @@ configure_ethdev(uint16_t port_id, uint8_t start) static int add_slave(struct slave_conf *slave, uint8_t start) { - struct rte_ether_addr addr, addr_check; + struct rte_ether_addr addr, addr_check = { { 0 } }; /* Some sanity check */ RTE_VERIFY(test_params.slave_ports <= slave && @@ -578,7 +578,13 @@ bond_get_update_timeout_ms(void) { struct rte_eth_bond_8023ad_conf conf; - rte_eth_bond_8023ad_conf_get(test_params.bonded_port_id, &conf); + if (rte_eth_bond_8023ad_conf_get(test_params.bonded_port_id, &conf) < 0) { + RTE_LOG(DEBUG, EAL, "Failed to get bonding configuration: " + "%s at %d\n", __func__, __LINE__); + RTE_TEST_TRACE_FAILURE(__FILE__, __LINE__, __func__); + return 0; + } + return conf.update_timeout_ms; } diff --git a/app/test/test_memzone.c b/app/test/test_memzone.c index 7501b63c5..c284dcb44 100644 --- a/app/test/test_memzone.c +++ b/app/test/test_memzone.c @@ -476,7 +476,8 @@ find_max_block_free_size(unsigned int align, unsigned int socket_id) struct rte_malloc_socket_stats stats; size_t len, overhead; - rte_malloc_get_socket_stats(socket_id, &stats); + if (rte_malloc_get_socket_stats(socket_id, &stats) < 0) + return 0; len = stats.greatest_free_size; overhead = MALLOC_ELEM_OVERHEAD; From patchwork Tue Oct 22 11:54:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Andrzej Ostruszka [C]" X-Patchwork-Id: 61647 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 CB6E61BEF8; Tue, 22 Oct 2019 13:54:35 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 2A26F1BEE3 for ; Tue, 22 Oct 2019 13:54:31 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x9MBdiM2006241; Tue, 22 Oct 2019 04:54:30 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=pfpt0818; bh=gqXBXTjSiHItbzkOwXLgvY5f5DYoFZdXLldApmsQoso=; b=wLyAY0Y2SvL4OodfhvbODYjXsU4rFjeUl2CiiRVLLUfaaJLlJmCIiVEnTGWWMxhZnQXd VVVVQOu70Yr0+YIzSC56PzHTbIcVnENu0gmXm2VQuh0+IHDDs3tYf0qePK/bxhY3Aa97 KQAReybZh/NEEjxJDRVFRpYg3jGHO8xG1j1WbxpW8HQsLU+Qh3B79clHr7dsz0TzRUas iXNfExdxIaAuz66E/F1o3tvTmY6iJ0cjzqQcO/KHKWHbZdOP/Vit72JuBKCj8oTgPrZA Q7ok0oqPSniD5XBo6XVLHObHAB/WToV7xTounQizi46AS++OQ7MHEKuVqWn+kmNpADIF Jg== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0b-0016f401.pphosted.com with ESMTP id 2vsw610su1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 22 Oct 2019 04:54:30 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 22 Oct 2019 04:54:29 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Tue, 22 Oct 2019 04:54:29 -0700 Received: from amok.marvell.com (unknown [10.95.130.40]) by maili.marvell.com (Postfix) with ESMTP id 8E9BB3F7040; Tue, 22 Oct 2019 04:54:27 -0700 (PDT) From: Andrzej Ostruszka To: , Hemant Agrawal , Sachin Saxena CC: , Date: Tue, 22 Oct 2019 13:54:08 +0200 Message-ID: <20191022115412.8837-7-aostruszka@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191022115412.8837-1-aostruszka@marvell.com> References: <20190917075754.8310-1-amo@semihalf.com> <20191022115412.8837-1-aostruszka@marvell.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,1.0.8 definitions=2019-10-22_03:2019-10-22,2019-10-22 signatures=0 Subject: [dpdk-dev] [PATCH v4 06/10] net/dpaa2: fix possible use of uninitialized vars 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" This patch fixes 'maybe-uninitialized' warnings reported by compiler when using LTO. Compiler warning pointing to this error (with LTO enabled): error: ‘kg_cfg.extracts[0].masks[0].mask’ may be used uninitialized in this function [-Werror=maybe-uninitialized] extr->masks[j].mask = cfg->extracts[i].masks[j].mask; Fixes: 16bbc98a3e63 ("bus/fslmc: update MC to 10.3.x") Signed-off-by: Andrzej Ostruszka --- drivers/net/dpaa2/base/dpaa2_hw_dpni.c | 1 + drivers/net/dpaa2/mc/dpkg.c | 2 +- drivers/net/dpaa2/mc/dpni.c | 9 ++++++--- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/dpaa2/base/dpaa2_hw_dpni.c b/drivers/net/dpaa2/base/dpaa2_hw_dpni.c index 56e2e56a3..2f6534a31 100644 --- a/drivers/net/dpaa2/base/dpaa2_hw_dpni.c +++ b/drivers/net/dpaa2/base/dpaa2_hw_dpni.c @@ -51,6 +51,7 @@ rte_pmd_dpaa2_set_custom_hash(uint16_t port_id, kg_cfg.extracts[0].type = DPKG_EXTRACT_FROM_DATA; kg_cfg.extracts[0].extract.from_data.offset = offset; kg_cfg.extracts[0].extract.from_data.size = size; + kg_cfg.extracts[0].num_of_byte_masks = 0; kg_cfg.num_extracts = 1; ret = dpkg_prepare_key_cfg(&kg_cfg, p_params); diff --git a/drivers/net/dpaa2/mc/dpkg.c b/drivers/net/dpaa2/mc/dpkg.c index 80f94f40e..7aa63ea12 100644 --- a/drivers/net/dpaa2/mc/dpkg.c +++ b/drivers/net/dpaa2/mc/dpkg.c @@ -63,7 +63,7 @@ dpkg_prepare_key_cfg(const struct dpkg_profile_cfg *cfg, uint8_t *key_cfg_buf) dpkg_set_field(extr->extract_type, EXTRACT_TYPE, cfg->extracts[i].type); - for (j = 0; j < DPKG_NUM_OF_MASKS; j++) { + for (j = 0; j < extr->num_of_byte_masks; j++) { extr->masks[j].mask = cfg->extracts[i].masks[j].mask; extr->masks[j].offset = cfg->extracts[i].masks[j].offset; diff --git a/drivers/net/dpaa2/mc/dpni.c b/drivers/net/dpaa2/mc/dpni.c index 362cd476f..b74a1a317 100644 --- a/drivers/net/dpaa2/mc/dpni.c +++ b/drivers/net/dpaa2/mc/dpni.c @@ -1803,10 +1803,13 @@ int dpni_set_congestion_notification(struct fsl_mc_io *mc_io, cmd_params->qtype = qtype; cmd_params->tc = tc_id; cmd_params->congestion_point = cfg->cg_point; - cmd_params->cgid = (uint8_t)cfg->cgid; - cmd_params->dest_id = cpu_to_le32(cfg->dest_cfg.dest_id); + if (cfg->cg_point == DPNI_CP_CONGESTION_GROUP) + cmd_params->cgid = (uint8_t)cfg->cgid; + if (cfg->dest_cfg.dest_type != DPNI_DEST_NONE) { + cmd_params->dest_id = cpu_to_le32(cfg->dest_cfg.dest_id); + cmd_params->dest_priority = cfg->dest_cfg.priority; + } cmd_params->notification_mode = cpu_to_le16(cfg->notification_mode); - cmd_params->dest_priority = cfg->dest_cfg.priority; cmd_params->message_iova = cpu_to_le64(cfg->message_iova); cmd_params->message_ctx = cpu_to_le64(cfg->message_ctx); cmd_params->threshold_entry = cpu_to_le32(cfg->threshold_entry); From patchwork Tue Oct 22 11:54:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Andrzej Ostruszka [C]" X-Patchwork-Id: 61648 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 B51241BEFD; Tue, 22 Oct 2019 13:54:38 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 979381BEED for ; Tue, 22 Oct 2019 13:54:32 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x9MBg7g5015671; Tue, 22 Oct 2019 04:54:31 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=pfpt0818; bh=RETDJ72H+sFGrRYB8z/HJt4ON0TykTqv8NA9rJqqQtw=; b=jq7j/r1RO1ts7Nr0LpjZQwrt8h94CLxunALQjZWnXoBJ1boIYLZfQRuWH6G/Jtr+ivTW zd8CQg8Gs0dcp1yNV5e77/sLX9FuX1kS8sBheSP/8SxnyGGS12FEm/q9Q0JL++byQYgL HZjEqiiYrwa314etYCX9jR1Y4vJwDbl4H+7I9BHYtpPt+OqZD6y5vxWjyo/PBxFhl82K XlB+pHuiWWsr0U3SjqGuQhHi/+t6oE3q4BX780gnITzi+lV17kUlIFSG0qRS18VW1K9J KyLBa/uTHmlaXVME1VCxYsoXE5XseknusAzC5Zf6Vuf1Zgs+RpiP8TtBWPukYxrzvM96 cg== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0a-0016f401.pphosted.com with ESMTP id 2vsyjh8act-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 22 Oct 2019 04:54:31 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 22 Oct 2019 04:54:30 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Tue, 22 Oct 2019 04:54:30 -0700 Received: from amok.marvell.com (unknown [10.95.130.40]) by maili.marvell.com (Postfix) with ESMTP id 7FB073F703F; Tue, 22 Oct 2019 04:54:29 -0700 (PDT) From: Andrzej Ostruszka To: , Wenzhuo Lu CC: , Date: Tue, 22 Oct 2019 13:54:09 +0200 Message-ID: <20191022115412.8837-8-aostruszka@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191022115412.8837-1-aostruszka@marvell.com> References: <20190917075754.8310-1-amo@semihalf.com> <20191022115412.8837-1-aostruszka@marvell.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,1.0.8 definitions=2019-10-22_03:2019-10-22,2019-10-22 signatures=0 Subject: [dpdk-dev] [PATCH v4 07/10] net/e1000: clean LTO build warnings (maybe-uninitialized) 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" During LTO build compiler reports some 'false positive' warnings about variables being possibly used uninitialized. This patch silences these warnings. Exemplary compiler warning to suppress (with LTO enabled): error: ‘link’ may be used uninitialized in this function [-Werror=maybe-uninitialized] if (link) { Signed-off-by: Andrzej Ostruszka --- drivers/net/e1000/base/e1000_82543.c | 2 +- drivers/net/e1000/base/e1000_ich8lan.c | 2 +- drivers/net/e1000/base/e1000_phy.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/e1000/base/e1000_82543.c b/drivers/net/e1000/base/e1000_82543.c index 810899eb6..dfde2a8b9 100644 --- a/drivers/net/e1000/base/e1000_82543.c +++ b/drivers/net/e1000/base/e1000_82543.c @@ -1027,7 +1027,7 @@ STATIC s32 e1000_setup_copper_link_82543(struct e1000_hw *hw) { u32 ctrl; s32 ret_val; - bool link; + bool link = true; DEBUGFUNC("e1000_setup_copper_link_82543"); diff --git a/drivers/net/e1000/base/e1000_ich8lan.c b/drivers/net/e1000/base/e1000_ich8lan.c index accc6ea01..5241cf698 100644 --- a/drivers/net/e1000/base/e1000_ich8lan.c +++ b/drivers/net/e1000/base/e1000_ich8lan.c @@ -5533,7 +5533,7 @@ void e1000_igp3_phy_powerdown_workaround_ich8lan(struct e1000_hw *hw) void e1000_gig_downshift_workaround_ich8lan(struct e1000_hw *hw) { s32 ret_val; - u16 reg_data; + u16 reg_data = 0; DEBUGFUNC("e1000_gig_downshift_workaround_ich8lan"); diff --git a/drivers/net/e1000/base/e1000_phy.c b/drivers/net/e1000/base/e1000_phy.c index 7d08f836f..956c06747 100644 --- a/drivers/net/e1000/base/e1000_phy.c +++ b/drivers/net/e1000/base/e1000_phy.c @@ -1664,7 +1664,7 @@ s32 e1000_copper_link_autoneg(struct e1000_hw *hw) s32 e1000_setup_copper_link_generic(struct e1000_hw *hw) { s32 ret_val; - bool link; + bool link = true; DEBUGFUNC("e1000_setup_copper_link_generic"); From patchwork Tue Oct 22 11:54:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Andrzej Ostruszka [C]" X-Patchwork-Id: 61649 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 4D7B31BF10; Tue, 22 Oct 2019 13:54:42 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id C80F41BEF8 for ; Tue, 22 Oct 2019 13:54:34 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x9MBg7g6015671; Tue, 22 Oct 2019 04:54:34 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=pfpt0818; bh=s/P/Pr8lzJXRAPrdT0EvbeYKSVQMC9uft3lrmh+xgOw=; b=Xl2BUa6bh7sk84qW2GqJxnYrobahugJy4cWzOKo3+wpzajoMd8toVcYeKrKxzE1xNFsk UFUyS+HPepe6o6Ta8LMHXNE9KBxRrFVrRLtldt4Bd1I3lWQikvAJVfgHh0xnEf35J7fb GnnNadkETP1LRgBEEOBdBd9aKdFWBAXKh7Y/BGGuwPyearcsrAN7W0Lmz5FrXBhn+WV2 qpZ6bs6nLhJOKqYBxSZ+z7QKmmraC8ei3AFeVj2A4TrSGkXF1/YClgh90s6TRGhhWKcs aJ4gtktTOTx//Yhr5m3NOelt8GxuurIb22gFLMc7jrgKOUYJhjdX7/vCo4TuNqBrXkFL GA== Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0a-0016f401.pphosted.com with ESMTP id 2vsyjh8ad0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 22 Oct 2019 04:54:34 -0700 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 22 Oct 2019 04:54:32 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Tue, 22 Oct 2019 04:54:32 -0700 Received: from amok.marvell.com (unknown [10.95.130.40]) by maili.marvell.com (Postfix) with ESMTP id 3B22D3F7040; Tue, 22 Oct 2019 04:54:31 -0700 (PDT) From: Andrzej Ostruszka To: , Beilei Xing , Qi Zhang CC: , Date: Tue, 22 Oct 2019 13:54:10 +0200 Message-ID: <20191022115412.8837-9-aostruszka@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191022115412.8837-1-aostruszka@marvell.com> References: <20190917075754.8310-1-amo@semihalf.com> <20191022115412.8837-1-aostruszka@marvell.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,1.0.8 definitions=2019-10-22_03:2019-10-22,2019-10-22 signatures=0 Subject: [dpdk-dev] [PATCH v4 08/10] net/i40e: clean LTO build warnings (maybe-uninitialized) 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" During LTO build compiler reports some 'false positive' warnings about variables being possibly used uninitialized. This patch silences these warnings. Exemplary compiler warning to suppress (with LTO enabled): error: ‘filter_idx’ may be used uninitialized in this function [-Werror=maybe-uninitialized] PMD_DRV_LOG(INFO, "Added port %d with AQ command with index %d", Signed-off-by: Andrzej Ostruszka --- drivers/net/i40e/i40e_ethdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 4e40b7ab5..525a6b69b 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -8376,7 +8376,7 @@ static int i40e_add_vxlan_port(struct i40e_pf *pf, uint16_t port, int udp_type) { int idx, ret; - uint8_t filter_idx; + uint8_t filter_idx = 0; struct i40e_hw *hw = I40E_PF_TO_HW(pf); idx = i40e_get_vxlan_port_idx(pf, port); From patchwork Tue Oct 22 11:54:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Andrzej Ostruszka [C]" X-Patchwork-Id: 61650 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 DAB451BF21; Tue, 22 Oct 2019 13:54:46 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 564C71BEC5 for ; Tue, 22 Oct 2019 13:54:36 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x9MBe7Br013847; Tue, 22 Oct 2019 04:54:35 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=pfpt0818; bh=njxDrBYvdUWUj+eG7Fs23O3TqZSfquraKwmr3l7cD04=; b=ynemGUYWf3ZUFCQjbuWf6MU0JqqusjqMl3tF+pF0S38frpS/3635R9q+K3RkAvcqqD2U FfHwnOEOV9mmhZ96V5qrZQj5lYCDB9xzVqfDJQR/GPlDbaRypcYozPZtNKROt8yehYUX E+gLSHMu6MaC6XepQue1RzChOzbU+6rl3qx2pBv+J4upsx+ozt9TxyzjqhAwf2ez74ly IqWK7ORvW/hyunR43KdHkwdxDm8VwFgmhSnjlLC5qHuSaBmQbpn5LgUHyYd6TFtGndsM 8W9rDCO9FgAbzaSiE21lq578v4Cz4Grff+hsHwJJrPV4dCf6p5Cnw3puOn8r97OcZSHY LA== Received: from sc-exch01.marvell.com ([199.233.58.181]) by mx0a-0016f401.pphosted.com with ESMTP id 2vsyjh8ad1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 22 Oct 2019 04:54:35 -0700 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 22 Oct 2019 04:54:34 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Tue, 22 Oct 2019 04:54:34 -0700 Received: from amok.marvell.com (unknown [10.95.130.40]) by maili.marvell.com (Postfix) with ESMTP id 325A03F703F; Tue, 22 Oct 2019 04:54:33 -0700 (PDT) From: Andrzej Ostruszka To: , Xiao Wang CC: , Date: Tue, 22 Oct 2019 13:54:11 +0200 Message-ID: <20191022115412.8837-10-aostruszka@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191022115412.8837-1-aostruszka@marvell.com> References: <20190917075754.8310-1-amo@semihalf.com> <20191022115412.8837-1-aostruszka@marvell.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,1.0.8 definitions=2019-10-22_03:2019-10-22,2019-10-22 signatures=0 Subject: [dpdk-dev] [PATCH v4 09/10] net/ifc: clean LTO build warnings (maybe-uninitialized) 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" During LTO build compiler reports some 'false positive' warnings about variables being possibly used uninitialized. This patch silences these warnings. Exemplary compiler warning to suppress (with LTO enabled): error: ‘features’ may be used uninitialized in this function [-Werror=maybe-uninitialized] if (RTE_VHOST_NEED_LOG(features)) { Signed-off-by: Andrzej Ostruszka --- drivers/net/ifc/ifcvf_vdpa.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/net/ifc/ifcvf_vdpa.c b/drivers/net/ifc/ifcvf_vdpa.c index 8de9ef199..4cdff8712 100644 --- a/drivers/net/ifc/ifcvf_vdpa.c +++ b/drivers/net/ifc/ifcvf_vdpa.c @@ -304,8 +304,8 @@ vdpa_ifcvf_stop(struct ifcvf_internal *internal) struct ifcvf_hw *hw = &internal->hw; uint32_t i; int vid; - uint64_t features; - uint64_t log_base, log_size; + uint64_t features = 0; + uint64_t log_base = 0, log_size = 0; uint64_t len; vid = internal->vid; @@ -348,6 +348,8 @@ vdpa_enable_vfio_intr(struct ifcvf_internal *internal, bool m_rx) struct rte_vhost_vring vring; int fd; + vring.callfd = -1; + nr_vring = rte_vhost_get_vring_num(internal->vid); irq_set = (struct vfio_irq_set *)irq_set_buf; @@ -442,6 +444,7 @@ notify_relay(void *arg) } internal->epfd = epfd; + vring.kickfd = -1; for (qid = 0; qid < q_num; qid++) { ev.events = EPOLLIN | EPOLLPRI; rte_vhost_get_vhost_vring(internal->vid, qid, &vring); @@ -577,7 +580,7 @@ m_ifcvf_start(struct ifcvf_internal *internal) struct ifcvf_hw *hw = &internal->hw; uint32_t i, nr_vring; int vid, ret; - struct rte_vhost_vring vq; + struct rte_vhost_vring vq = { 0 }; void *vring_buf; uint64_t m_vring_iova = IFCVF_MEDIATED_VRING; uint64_t size; @@ -721,6 +724,7 @@ vring_relay(void *arg) } internal->epfd = epfd; + vring.kickfd = -1; for (qid = 0; qid < q_num; qid++) { ev.events = EPOLLIN | EPOLLPRI; rte_vhost_get_vhost_vring(vid, qid, &vring); @@ -930,11 +934,11 @@ ifcvf_dev_close(int vid) static int ifcvf_set_features(int vid) { - uint64_t features; + uint64_t features = 0; int did; struct internal_list *list; struct ifcvf_internal *internal; - uint64_t log_base, log_size; + uint64_t log_base = 0, log_size = 0; did = rte_vhost_get_vdpa_device_id(vid); list = find_internal_resource_by_did(did); From patchwork Tue Oct 22 11:54:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Andrzej Ostruszka [C]" X-Patchwork-Id: 61651 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 A007D1BF25; Tue, 22 Oct 2019 13:54:49 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id A0B801BEEF for ; Tue, 22 Oct 2019 13:54:38 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x9MBdea8006226; Tue, 22 Oct 2019 04:54:38 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=pfpt0818; bh=OD2dnjHtAjQsbUHJoI0dGlyxfDUfBSB5NH8la7/Y9Ws=; b=emf+WoQ9EUF30pts/M/bVU2NXqu/Wrx0A+3TtKrMpX3UgQaC7pKlZrzE1b0kgVtc4p6u 8rvl4gB79MHHF9I2gZE4lhPlDhE5Mz2rPbecZbqtA7w3ssk/xFCF8QG94YRoG9RYnhks 4fcRh8vIsggEOHiCuzApbqy8magdAmXUaqISCEaYEOyU6aEmkWEkRCJ6UcwvnHRpsQRw H0tqdVR0y8/9ut//npWLFqzQyDflT39X0M/AvZHq1FAkgSwXynoi3HxgXf3iV6SwVUJL nLhQlUynOXq8vTmFaPcpg7wnyNxTSlsK/dOZe/31cx66gfUKyZ3JyTmRY0C23mR8xnVJ mQ== Received: from sc-exch01.marvell.com ([199.233.58.181]) by mx0b-0016f401.pphosted.com with ESMTP id 2vsw610sud-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 22 Oct 2019 04:54:37 -0700 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 22 Oct 2019 04:54:36 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Tue, 22 Oct 2019 04:54:36 -0700 Received: from amok.marvell.com (unknown [10.95.130.40]) by maili.marvell.com (Postfix) with ESMTP id E6A1E3F7040; Tue, 22 Oct 2019 04:54:34 -0700 (PDT) From: Andrzej Ostruszka To: , Rasesh Mody , Shahed Shaikh CC: , Date: Tue, 22 Oct 2019 13:54:12 +0200 Message-ID: <20191022115412.8837-11-aostruszka@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191022115412.8837-1-aostruszka@marvell.com> References: <20190917075754.8310-1-amo@semihalf.com> <20191022115412.8837-1-aostruszka@marvell.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,1.0.8 definitions=2019-10-22_03:2019-10-22,2019-10-22 signatures=0 Subject: [dpdk-dev] [PATCH v4 10/10] net/qede: clean LTO build warnings (maybe-uninitialized) 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" During LTO build compiler reports some 'false positive' warnings about variables being possibly used uninitialized. This patch silences these warnings. Exemplary compiler warning to suppress (with LTO enabled): error: ‘transceiver_type’ may be used uninitialized in this function [-Werror=maybe-uninitialized] switch (transceiver_type) { Signed-off-by: Andrzej Ostruszka --- drivers/net/qede/base/ecore_mcp.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/net/qede/base/ecore_mcp.c b/drivers/net/qede/base/ecore_mcp.c index 6c6560688..666c0fe12 100644 --- a/drivers/net/qede/base/ecore_mcp.c +++ b/drivers/net/qede/base/ecore_mcp.c @@ -2278,7 +2278,7 @@ enum _ecore_status_t ecore_mcp_trans_speed_mask(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt, u32 *p_speed_mask) { - u32 transceiver_type, transceiver_state; + u32 transceiver_type = ETH_TRANSCEIVER_TYPE_NONE, transceiver_state; ecore_mcp_get_transceiver_data(p_hwfn, p_ptt, &transceiver_state, &transceiver_type); @@ -3163,7 +3163,8 @@ enum _ecore_status_t ecore_mcp_nvm_put_file_begin(struct ecore_dev *p_dev, enum _ecore_status_t ecore_mcp_nvm_write(struct ecore_dev *p_dev, u32 cmd, u32 addr, u8 *p_buf, u32 len) { - u32 buf_idx, buf_size, nvm_cmd, nvm_offset, resp, param; + u32 buf_idx, buf_size, nvm_cmd, nvm_offset; + u32 resp = FW_MSG_CODE_ERROR, param; struct ecore_hwfn *p_hwfn = ECORE_LEADING_HWFN(p_dev); enum _ecore_status_t rc = ECORE_INVAL; struct ecore_ptt *p_ptt; @@ -3370,7 +3371,7 @@ enum _ecore_status_t ecore_mcp_gpio_read(struct ecore_hwfn *p_hwfn, u16 gpio, u32 *gpio_val) { enum _ecore_status_t rc = ECORE_SUCCESS; - u32 drv_mb_param = 0, rsp; + u32 drv_mb_param = 0, rsp = 0; drv_mb_param = (gpio << DRV_MB_PARAM_GPIO_NUMBER_OFFSET); @@ -3391,7 +3392,7 @@ enum _ecore_status_t ecore_mcp_gpio_write(struct ecore_hwfn *p_hwfn, u16 gpio, u16 gpio_val) { enum _ecore_status_t rc = ECORE_SUCCESS; - u32 drv_mb_param = 0, param, rsp; + u32 drv_mb_param = 0, param, rsp = 0; drv_mb_param = (gpio << DRV_MB_PARAM_GPIO_NUMBER_OFFSET) | (gpio_val << DRV_MB_PARAM_GPIO_VALUE_OFFSET); @@ -3481,7 +3482,7 @@ enum _ecore_status_t ecore_mcp_bist_clock_test(struct ecore_hwfn *p_hwfn, enum _ecore_status_t ecore_mcp_bist_nvm_test_get_num_images( struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt, u32 *num_images) { - u32 drv_mb_param = 0, rsp; + u32 drv_mb_param = 0, rsp = 0; enum _ecore_status_t rc = ECORE_SUCCESS; drv_mb_param = (DRV_MB_PARAM_BIST_NVM_TEST_NUM_IMAGES << @@ -3865,7 +3866,7 @@ enum _ecore_status_t __ecore_mcp_resc_lock(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt, struct ecore_resc_lock_params *p_params) { - u32 param = 0, mcp_resp, mcp_param; + u32 param = 0, mcp_resp = 0, mcp_param = 0; u8 opcode; enum _ecore_status_t rc;