From patchwork Tue Sep 17 07:57:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Ostruszka X-Patchwork-Id: 59307 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 60D7A1BFB1; Tue, 17 Sep 2019 09:58:01 +0200 (CEST) Received: from mail-lj1-f181.google.com (mail-lj1-f181.google.com [209.85.208.181]) by dpdk.org (Postfix) with ESMTP id 361771BEF6 for ; Tue, 17 Sep 2019 09:57:58 +0200 (CEST) Received: by mail-lj1-f181.google.com with SMTP id v24so2478314ljj.3 for ; Tue, 17 Sep 2019 00:57:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ykPAefym3BtFAAk1jbBEoBlK8v18NTsHvYb9y8MhNcQ=; b=oLvG/QK2y6Wkg2Zv35L0WFt0hUBj9bszqEu2HwBRG7M4wVxCZL+F8y+UZsDnJhx2dt le9u8pdbKQykVBxaJpFIuCXSjm0DbrOdqwhOiqAtxEcK7uzotXrvunphmpONNySk635q mabGb2qhHehI6219l+gBMUZcxP4BEWA4rTPyRROE/8khQ7cPQQxqstGSzekGHSDRuvml ogIXNc6aJj89+afgBTHzkMGI/xogWwYcvP3OGvnHXVciQCmfaAyT7OC46AYzcTFo33Ia hMDlN84n96hr2+7PddfYuWKNwUJ/LqgL7o/XH3amhEr8UCH2zpzt9qBtQ7Y9dfDNfhIJ lm4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ykPAefym3BtFAAk1jbBEoBlK8v18NTsHvYb9y8MhNcQ=; b=Zp7UywJO43yaUTNWql7MKCIX8cmj0oW6i9+Kk78TJWa30r/CqCa5MAZrvVZvQC+8J9 Fg3ByMlm1J0sh4R7zY+vFt737QnMQo1ZQFXYMXc0kq9WYOrsB+lhnD4/W3O2pF4g7GcM kBjZ8l9MZ7K2KrYU6M8+Q849+mrB+QKltw3GHK3YhiFqORhQqTl8XiIQYvOrrcftoCMl bmY50+g+c6hzT4iUPYnI2oS0nmPlFAQqodWevQlemxvserR1GkyjqyqObo3PHgfq3/pi 87J46UCO3lg4ytBPXdh6X1QHzt8rLDcmODyexpAmrhWa+vNM+cTCras/5QtRnotJv7/u lOuQ== X-Gm-Message-State: APjAAAVqKO4Io3RvLhFsZm67bZD8TtxbfjYIO1uHeFNTj/feLChOjFTH GnXWR5ERsqzuLkEsIVGnNh5etYOQCKyKYA== X-Google-Smtp-Source: APXvYqyIdMI4/PNeMkrPxTA22b/+fefFFHzTqewzUqckLIgDO2Y0qtI0ZGzSLKhTQhIKLQz8NPYDvA== X-Received: by 2002:a2e:9f03:: with SMTP id u3mr1102694ljk.140.1568707077168; Tue, 17 Sep 2019 00:57:57 -0700 (PDT) Received: from localhost.localdomain (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.googlemail.com with ESMTPSA id g1sm270659ljl.31.2019.09.17.00.57.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Sep 2019 00:57:56 -0700 (PDT) From: Andrzej Ostruszka To: dev@dpdk.org, Aaron Conole , Michael Santana , Thomas Monjalon , John McNamara , Marko Kovacevic , David Hunt , Bruce Richardson , Vladimir Medvedkin , Robert Sanford , Erik Gabriel Carrillo Cc: mattias.ronnblom@ericsson.com, stephen@networkplumber.org, Andrzej Ostruszka Date: Tue, 17 Sep 2019 09:57:45 +0200 Message-Id: <20190917075754.8310-2-amo@semihalf.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190917075754.8310-1-amo@semihalf.com> References: <20190917075754.8310-1-amo@semihalf.com> Subject: [dpdk-dev] [PATCH v2 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 and clang does not produce ELF at all (only LLVM IR bitcode). Signed-off-by: Andrzej Ostruszka Acked-by: Bruce Richardson --- .travis.yml | 7 ++++ config/common_base | 5 +++ config/meson.build | 15 ++++++++ doc/guides/prog_guide/lto.rst | 37 ++++++++++++++++++++ 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/clang/rte.toolchain-compat.mk | 4 +++ mk/toolchain/clang/rte.vars.mk | 8 +++++ mk/toolchain/gcc/rte.toolchain-compat.mk | 4 +++ mk/toolchain/gcc/rte.vars.mk | 12 +++++++ mk/toolchain/icc/rte.vars.mk | 8 +++++ 15 files changed, 158 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..97bbc323b 100644 --- a/config/meson.build +++ b/config/meson.build @@ -196,3 +196,18 @@ 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 + if cc.get_id() == 'gcc' + # workaround for bug 81440 + if 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 +endif diff --git a/doc/guides/prog_guide/lto.rst b/doc/guides/prog_guide/lto.rst new file mode 100644 index 000000000..b2b36e51c --- /dev/null +++ b/doc/guides/prog_guide/lto.rst @@ -0,0 +1,37 @@ +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, clang 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 -Ddefault_library=shared + ninja -C build + +for the case of meson based build (only shared libraries are supported +when building with meson and LTO enabled). + +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/clang/rte.toolchain-compat.mk b/mk/toolchain/clang/rte.toolchain-compat.mk index e6189b498..78f96c648 100644 --- a/mk/toolchain/clang/rte.toolchain-compat.mk +++ b/mk/toolchain/clang/rte.toolchain-compat.mk @@ -20,3 +20,7 @@ CLANG_MINOR_VERSION := $(shell echo $(CLANG_VERSION) | cut -f2 -d.) ifeq ($(shell test $(CLANG_MAJOR_VERSION)$(CLANG_MINOR_VERSION) -lt 35 && echo 1), 1) CC_SUPPORTS_Z := false endif + +ifeq ($(shell test $(CLANG_MAJOR_VERSION)$(CLANG_MINOR_VERSION) -lt 60 && echo 1), 1) + CONFIG_RTE_ENABLE_LTO=n +endif diff --git a/mk/toolchain/clang/rte.vars.mk b/mk/toolchain/clang/rte.vars.mk index 3c49dc568..3b1fa05f9 100644 --- a/mk/toolchain/clang/rte.vars.mk +++ b/mk/toolchain/clang/rte.vars.mk @@ -48,6 +48,14 @@ 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 + # workaround clang bug with warning "missing field initializer" for "= {0}" WERROR_FLAGS += -Wno-missing-field-initializers 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 Sep 17 07:57:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Ostruszka X-Patchwork-Id: 59308 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 AD8581BFBB; Tue, 17 Sep 2019 09:58:04 +0200 (CEST) Received: from mail-lf1-f67.google.com (mail-lf1-f67.google.com [209.85.167.67]) by dpdk.org (Postfix) with ESMTP id CC0101BFAA for ; Tue, 17 Sep 2019 09:57:58 +0200 (CEST) Received: by mail-lf1-f67.google.com with SMTP id x80so2096413lff.3 for ; Tue, 17 Sep 2019 00:57:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=NmBqw+BMLzZ/8Flgo8FLKyEvK1Io2QD3hAZums/97J4=; b=KAp/xaiXcxeQ4EAJV8qJJOPt9R9dZiuKLTGoAqcgoBP+IElfdnhbLSDITAzk2Yec+B WN8lov6qY83LHA91LH2oBxgnJStfqUr98SLlB3GB4MC+c/t8YFJPa9Wn4ji2FemFd+WL FJyLzGFO7bEFm4HRk8CLjTf5+7wc8v7Ns+EJ7y4NK0dHI6dIHCslpOEzoDBGL0MPTdRQ O8YqXdXV8TKm7+dK9L3Mj1qG6GZzliNdpJSY8hFFM5POrpempBYI2fLKelp6E66VDI3J 7v6wDMGUJCD/3amhxvM+fR5drs07WTPhIMMxiXsncgTFUgzEimIo6kvrHbfLKt7ZCngs 51mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=NmBqw+BMLzZ/8Flgo8FLKyEvK1Io2QD3hAZums/97J4=; b=ps3fs9gCpPyLay5kB2nDUlZj++tPF1paWW5ttBY30yk6gkLxCkeMsREwwUCybaQ9CL 5McOXd+6bkWjTgLVWDi2+dTFZVZM/GYhrVKUxpYfyROrt5OzausWV61KzEDf5k65CsA6 n9YeET5zmzRtZFsDUcQAzMaikmYzCWhtxzG0z48qzStwyHsu4VCJca9Dkd5f2EtS92IY 3T3SyLt7jumCMFXsdfGxCcuTRAeqX+xY9FmOUPHO5U+U4GPoA4UmTPrO9MghGz+ty+xD rPYSymjA2isHqSffNElHCxa6gTTMwBTO7CAYzZBXNBkDz3WadrJoJ23AVSuR2L+Iqq32 h4NA== X-Gm-Message-State: APjAAAUiVqtU8pfyuP7/k8qJ+qyYxJOEt8MlG8h/Pan4gyqGYBMegk4W t5GQmco8KAvjCJblX0+yeF9H0infqII= X-Google-Smtp-Source: APXvYqzhy8MpENhfpmvK1w41MKCALyuYq44VyrHicVDbxs4bvecXJ6Efg3q5CyKTlweJ5YM46iAlvg== X-Received: by 2002:ac2:5101:: with SMTP id q1mr1300926lfb.13.1568707078067; Tue, 17 Sep 2019 00:57:58 -0700 (PDT) Received: from localhost.localdomain (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.googlemail.com with ESMTPSA id g1sm270659ljl.31.2019.09.17.00.57.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Sep 2019 00:57:57 -0700 (PDT) From: Andrzej Ostruszka To: dev@dpdk.org, Erik Gabriel Carrillo , Jerin Jacob Cc: mattias.ronnblom@ericsson.com, stephen@networkplumber.org, Andrzej Ostruszka Date: Tue, 17 Sep 2019 09:57:46 +0200 Message-Id: <20190917075754.8310-3-amo@semihalf.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190917075754.8310-1-amo@semihalf.com> References: <20190917075754.8310-1-amo@semihalf.com> Subject: [dpdk-dev] [PATCH v2 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. Signed-off-by: Andrzej Ostruszka Reviewed-by: Jerin Jacob --- 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 Sep 17 07:57:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Ostruszka X-Patchwork-Id: 59309 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 A96561BFC0; Tue, 17 Sep 2019 09:58:07 +0200 (CEST) Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com [209.85.167.54]) by dpdk.org (Postfix) with ESMTP id 7E5921BFAA for ; Tue, 17 Sep 2019 09:57:59 +0200 (CEST) Received: by mail-lf1-f54.google.com with SMTP id w6so2103058lfl.2 for ; Tue, 17 Sep 2019 00:57:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Z5DzTIxEt5+ANVdQni1kRcJ+xYX6pxDF0HUGiUlFpcM=; b=oIihGSzSSFDQg8+OfmlXe7S11oBeKrUettRreWfXf5VsoroKW5ddi2xC+h8dASTluw z1IG6+Pf5V5APmjVzZVw7UG+YWpFtoaAurwI/3OqGvXVJLzZGvgzZDws5Qs6D5OKYZbG ZK0/+YmMs0K5JR6yTSiq188OJ+zmeCFke4ubDY4yunWw5dZ0vXEyv7ina6PdfAZ4roLI 38dbavirfeqfpTwuauQoa0CewHTDir5u6ZJKdarYG0DQ+BGFwil9sRKgtpOe475wXol7 6BxztrY1LZIEdaXFrqc9tYxwrgnEfjjyGj6lZ4uiZvphkQv8R8OJs1IKDoHAuPPaICVe MaCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Z5DzTIxEt5+ANVdQni1kRcJ+xYX6pxDF0HUGiUlFpcM=; b=cIqmBeQpFQiiKOGWfoU3H/v1E3X+g0pYfXc4TD5G3/B+jadeM05yRR4yHYRcfZSpye OxdEQtMZxxHOFpgjqDVPUV7TquSZk6KQ0po/IsZ/YO6lKGZ4DpcUXIgG5EEPUq6Rl4gz 13Fl1yN6IIgtDCj45JRx/U8t4nlNwD+JAizjWKKwla1oEmTuRjLUb/Fvi9GE8kIC55mW AwlLwERYWs0sqvkE/MS4ZAa/l/Fu40i+EnTAal5md1OHDNuqHhoUuvetfB4sCsaCH4Ic rZMki9FJWka1ZzHN8r6iDonS1is3zGoC8E+dJyQZ8Xe8uL8WxgKiOd8ni0A7PPBeXEF1 h0+A== X-Gm-Message-State: APjAAAUryeAp/uDmnnvJqNV0UpqVVmlMiEro+ZJWx3LMkeAWKEarjYlt cZZaRvKIxtZFQBCZEfwTEaoVY9a/RyI= X-Google-Smtp-Source: APXvYqx0rgl6jIpHdJQuawvUvVs2uB1PfICW0x3R6BLOC0oGQOVvfNtZdzlprh0scM9waUyP5kN7Jw== X-Received: by 2002:a19:cc15:: with SMTP id c21mr1348298lfg.64.1568707079053; Tue, 17 Sep 2019 00:57:59 -0700 (PDT) Received: from localhost.localdomain (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.googlemail.com with ESMTPSA id g1sm270659ljl.31.2019.09.17.00.57.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Sep 2019 00:57:58 -0700 (PDT) From: Andrzej Ostruszka To: dev@dpdk.org, Jerin Jacob Cc: mattias.ronnblom@ericsson.com, stephen@networkplumber.org, Andrzej Ostruszka Date: Tue, 17 Sep 2019 09:57:47 +0200 Message-Id: <20190917075754.8310-4-amo@semihalf.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190917075754.8310-1-amo@semihalf.com> References: <20190917075754.8310-1-amo@semihalf.com> Subject: [dpdk-dev] [PATCH v2 03/10] app/eventdev: fix maybe-uninitialized warnings for 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" During LTO build compiler reports some 'false positive' warnings about variables being possibly used uninitialized. This patch silences these warnings. Signed-off-by: Andrzej Ostruszka Reviewed-by: Jerin Jacob --- 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 Sep 17 07:57:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Ostruszka X-Patchwork-Id: 59310 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 96A611BFC6; Tue, 17 Sep 2019 09:58:09 +0200 (CEST) Received: from mail-lf1-f66.google.com (mail-lf1-f66.google.com [209.85.167.66]) by dpdk.org (Postfix) with ESMTP id 630D21BFAB for ; Tue, 17 Sep 2019 09:58:00 +0200 (CEST) Received: by mail-lf1-f66.google.com with SMTP id c195so2067542lfg.9 for ; Tue, 17 Sep 2019 00:58:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=suYL+g61S91+ez+WRDK5RAJrUEu0wqZlASipBrdcn/o=; b=hkLjb1dJdWd89+i5Us7jhbmz808HaUMSTPRpMeXqcSdhy2Eg97VHhzQRYHFaAs5mdl LTqdl6KdaywPcTQ/CpQFPM6XxM1D3rzYA+gCbVyZYojipZvvfPQF9n1Aknr46Hdk4QVd pKfDsPEbT7NtDo3+LcU7DDlqTfCB+cPj9WjVLjn93uHHRa1YfOUoULQEp7OmzNcC8pdX JbGQKsn8OW7i7L7HGEgyeFf5nWsJEJ8Pe0EKZEuapvEMcQyN75hLW3MCpegLfAefCxn1 LOx536lpEt3TEuIq+PXJ21EU9IJsjQYgJ81/TVZgd+ohF9+1SMBBwUYFgmvnFe17BBkF Z1oA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=suYL+g61S91+ez+WRDK5RAJrUEu0wqZlASipBrdcn/o=; b=Evwub7qDoXdBowrSiz4zLa22wb6MrWOzsfEIML5+Fwi+3oBG4GHEdCN8VSHAt6XdjR XDWANsAXiRuH3ygkEzRS/CJ5aBDYUPSwMiRRLY345dsmm78hfb/x6EE9D9tEsjoxD2yx zlycx/uZaTcApd02cGHe80mw66Od3zcmKvNPpmaabiANiZ6vmboKgkBI8rHb+ZCrIS9I rlOaLOxQVPCDDvognPNngpCJt3kjTCYdvU0ecN9UN4OvpzgUggGzpfGIBey994JU5dQi c8o/6QiasKizcm4ZGBYEABrCIRG+4qqpTQwjgIrcD40fLmfYv1gT7ab9VEFntgA+U8kN Ucwg== X-Gm-Message-State: APjAAAWKv87RxB7j2bAzf8lDrKVc63/zbkgkN+0hqitP/wSc0l9C25n9 jc1EHKRL+BKrGVyPCyUZG/16YzNkzsM= X-Google-Smtp-Source: APXvYqxvaccnoadBgD1Qe5JJr7ruG0eQI0AQlEEquMh2F7l58a7yyMvMK16e+tOfDEXXvf1v8HCPwQ== X-Received: by 2002:a19:c695:: with SMTP id w143mr1262192lff.162.1568707079934; Tue, 17 Sep 2019 00:57:59 -0700 (PDT) Received: from localhost.localdomain (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.googlemail.com with ESMTPSA id g1sm270659ljl.31.2019.09.17.00.57.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Sep 2019 00:57:59 -0700 (PDT) From: Andrzej Ostruszka To: dev@dpdk.org, Pavan Nikhilesh , Jerin Jacob Cc: mattias.ronnblom@ericsson.com, stephen@networkplumber.org, Andrzej Ostruszka Date: Tue, 17 Sep 2019 09:57:48 +0200 Message-Id: <20190917075754.8310-5-amo@semihalf.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190917075754.8310-1-amo@semihalf.com> References: <20190917075754.8310-1-amo@semihalf.com> Subject: [dpdk-dev] [PATCH v2 04/10] event/octeontx2: fix maybe-uninitialized warnings for 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" During LTO build compiler reports some 'false positive' warnings about variables being possibly used uninitialized. This patch silences these warnings. 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 Sep 17 07:57:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Ostruszka X-Patchwork-Id: 59311 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 A9A801BFE0; Tue, 17 Sep 2019 09:58:12 +0200 (CEST) Received: from mail-lj1-f172.google.com (mail-lj1-f172.google.com [209.85.208.172]) by dpdk.org (Postfix) with ESMTP id 6F7371BFB2 for ; Tue, 17 Sep 2019 09:58:01 +0200 (CEST) Received: by mail-lj1-f172.google.com with SMTP id e17so2403408ljf.13 for ; Tue, 17 Sep 2019 00:58:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=kQk2dVSxgEy44X1W2wjApuAHZ8jkkzFi1X1SEO9TUGA=; b=fvtrBJtPDcuDwx08iwbItv6+pJAR1qWrGYwmItYNWt6JDFhKMCCf/H0R7IQoehx0FB 5kwJZuY7obx4TZhI5fGcwBqwJCJwnl0P/3qaUfH8gwzhaCLX2u1VvZDyQnukdCteczMc fHbu8pQjLpahtepEfzVqrmv7kR9FGBunskuG6y1SOuognsrm4g2O0YqkqlNIXDMcwOAn IZP9ibIQUXr2R66ILDFqvHB+qg8Vu9e7C13xQUNeqGjGTtEL6DHgStTZqP8FTOrL2xPX B9CQbh591ZiecR55KJu/XCcWEnJRpyAjtRmhmvD3KK1UnzskLh5F1mZzSOYNehjlVNJL EQiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=kQk2dVSxgEy44X1W2wjApuAHZ8jkkzFi1X1SEO9TUGA=; b=rTRqSiUkHDtDZogiOIVWISFyJhnE+YODQDzZQ8BdTjbBdWXQR99yJ01w2NA1mGVdMw qCAZOUnTvLRXUuUkVBvSNLDPAN3j7COhzF6juWsjgF8nWTjHICKC8Oje1SK0jSoxFd8d Mcy5WTMGre7DKRYFGjeNvpvub3WhJNjOuSIDFIid3cacAlji3kIpnliKLXq52liqUFA0 bwCizPc0P2FULVGviZAYTl/KmolprKZYncYTWljixlEKAEKYZf9XOsCIY9XS4Ya6wni0 1B7e/NCgpthFMI0oUMbuEaWB9iDr8yScnA7oT7VnbmLx8ftfnOPX6oolDuE8h4X8x7wL VekQ== X-Gm-Message-State: APjAAAUazHWikWgTmhoVmzo1ckk3AO5ObsNXj6dg7rmz5QjUnBun53X8 pogg8/bBqjG+KOhPa4H+oJCGhsWjxBUUHw== X-Google-Smtp-Source: APXvYqzPq2KF30J6gaWjK8HVZ+vqA9T3ac341e7ejJFmlqeXy6lPAPZjP3FMF1a5Iq9wTGqynO1C3A== X-Received: by 2002:a2e:88d4:: with SMTP id a20mr1048810ljk.201.1568707080915; Tue, 17 Sep 2019 00:58:00 -0700 (PDT) Received: from localhost.localdomain (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.googlemail.com with ESMTPSA id g1sm270659ljl.31.2019.09.17.00.58.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Sep 2019 00:58:00 -0700 (PDT) From: Andrzej Ostruszka To: dev@dpdk.org, Yipeng Wang , Sameh Gobriel , Bruce Richardson , Pablo de Lara , Chas Williams , Anatoly Burakov Cc: mattias.ronnblom@ericsson.com, stephen@networkplumber.org, Andrzej Ostruszka Date: Tue, 17 Sep 2019 09:57:49 +0200 Message-Id: <20190917075754.8310-6-amo@semihalf.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190917075754.8310-1-amo@semihalf.com> References: <20190917075754.8310-1-amo@semihalf.com> Subject: [dpdk-dev] [PATCH v2 05/10] app/test: fix maybe-uninitialized warnings for 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" During LTO build compiler reports some 'false positive' warnings about variables being possibly used uninitialized. This patch silences these warnings. 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 Sep 17 07:57:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Ostruszka X-Patchwork-Id: 59312 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 1765B1BFF4; Tue, 17 Sep 2019 09:58:15 +0200 (CEST) Received: from mail-lf1-f65.google.com (mail-lf1-f65.google.com [209.85.167.65]) by dpdk.org (Postfix) with ESMTP id A391B1BFB2 for ; Tue, 17 Sep 2019 09:58:02 +0200 (CEST) Received: by mail-lf1-f65.google.com with SMTP id u28so2083068lfc.5 for ; Tue, 17 Sep 2019 00:58:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=bK9nl/qV04wjIKeztaLOLubH2UF/0ajtfJqFha0o/9s=; b=QavRhPGWaxURYAkkGptuOInGnGMyZ4WCp2IcjcQe40T61JdNLw3CpMkv8IAqvL0CI8 RyP0JLH0AkYlxiyJbZzSv5IKPP137DGDkK/s6K2kxlgEYTWQ5GjULHvhqn6Y8ltsCJwo od+LAXSxjJo8Mso0ncUBpRz6Ot+0Z+EjdkMaj4lCLrXrHx26sh0XR9ix2rb1WO7EqlH3 M4IYGpKhS7MlvJG1tFOWmHj7i5B78FM4X4xxymLVrhjecy2DKcOnm3USJ8CRLYnSOrbj sexc+/QQJejChD1eGN2WM1sPt8CsfWXRNXNCr08MCpOVz2IryXjDCVXsnHtcO/PJP+AR a5Lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=bK9nl/qV04wjIKeztaLOLubH2UF/0ajtfJqFha0o/9s=; b=bOs49lUnINOuCTWLLJv9TDaUz/cclp1YsADWNIxwFg0JAu8y7yer1x243ecTthZIfR CjYaJ/1OWX7771yl07tPklGlS1qhgr8+VgwYxmAjOnY6NFi7NxJqpIx5mhgrKHucZRbs sZdAXqOaz5QZMV3pWybX7DsKm6CgDOk0vLqsfgdeg1ReRyZTMoyW31ov7sp8UOulmN83 EjHSq9wKh6D2aXieuLVZFoqqGO/sgUYps+kC/YztAWUU1Z6Kdbcp6XUTK+XfmUSzV01i h6q6ZDhmWKy5HFCBTfxezLiUXgTOPXhAb0VM69tFhZQRJBhwcpTSTpFg9XmV6bJUzoWL mZwQ== X-Gm-Message-State: APjAAAU8nN5iZh6v5v1hwPS3H+8Dv1n0mbNoIEe5XtyHjTSU38B9M2Xr GH8OuhS8Bzpw9jUKVFXrumnQchjQI3dgcQ== X-Google-Smtp-Source: APXvYqy4jBnt4xDFdapKfYlblJWAm59J2P4sMLlZfzlttu/6i6waL/K6z4x1jtzEKJxEAY4t79nYJA== X-Received: by 2002:ac2:562c:: with SMTP id b12mr1363538lff.156.1568707081885; Tue, 17 Sep 2019 00:58:01 -0700 (PDT) Received: from localhost.localdomain (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.googlemail.com with ESMTPSA id g1sm270659ljl.31.2019.09.17.00.58.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Sep 2019 00:58:01 -0700 (PDT) From: Andrzej Ostruszka To: dev@dpdk.org, Hemant Agrawal , Sachin Saxena Cc: mattias.ronnblom@ericsson.com, stephen@networkplumber.org, Andrzej Ostruszka Date: Tue, 17 Sep 2019 09:57:50 +0200 Message-Id: <20190917075754.8310-7-amo@semihalf.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190917075754.8310-1-amo@semihalf.com> References: <20190917075754.8310-1-amo@semihalf.com> Subject: [dpdk-dev] [PATCH v2 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. 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 Sep 17 07:57:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Ostruszka X-Patchwork-Id: 59313 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 D90F21BFF8; Tue, 17 Sep 2019 09:58:16 +0200 (CEST) Received: from mail-lf1-f67.google.com (mail-lf1-f67.google.com [209.85.167.67]) by dpdk.org (Postfix) with ESMTP id 51A8D1BFB2 for ; Tue, 17 Sep 2019 09:58:03 +0200 (CEST) Received: by mail-lf1-f67.google.com with SMTP id d17so2080028lfa.7 for ; Tue, 17 Sep 2019 00:58:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=7jCDBD5xtBN9LxzL+nGbDtGF7tYbSN/1tYB0BWCOYvg=; b=ETEGBuHwxsK9fD+ByAfR9sK6jRF8MEZzqOUT+OpPG/TpIwiRma149rL5pTsnzR31u+ nfie+SDDfjO911lwTC972qIEpNgqio1KSTzp/a84o5kE+LjlvxnMSRVxHSSBz8nwjkgQ J+PhCF2/TQfp3VpgTrgRVMKi400eGnqNtCCZG3TO79xvvSVZFXCSSc+q/Z7p6eYh1VMl AZ526x7+aPTyE2ZVfAcGmHILYzjfs2nI4zMREp0WqcLIW6CEbzRgwTb+gfvBiOun3I15 62u9PQxEO7F9gURMKf3c9dSQI3Z8CrsUudRAQ0yOIXq+vb/6jCtC91XeRSxkqUcv+UtZ FzeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=7jCDBD5xtBN9LxzL+nGbDtGF7tYbSN/1tYB0BWCOYvg=; b=NRNcssBRuBtL+Fj6OK4riq9wxvfYJ7q1OAu7ZWhH9IHaL9teZ4M0wNiI3e1jiDVvc1 kUMpfWMEHQHtrDpZxMrQ1KnwQVEKu+4ZpXON2PFb9GOoNL5Pke5hTzTVLQULux5jJTYD HzHvl7P0EBqHU+nxzQXmbXD7kXkh9P2GUfQ3S6YHC8RU6mypeR6VuDbcvVXJYTx6Ot+g Ty5Rzba3ofzF70IJB3qQHCV5MZIlzrg3s1NBdr8oQ1OVc+zNfk0IWKAIUn2xHab279v3 t4Jr4dWgIgS8GsRU9YVx+yc4qkYWriIDIuk5l4mxVm3fg/7rB0M0+L+C/mQpV5X2khyY FLjQ== X-Gm-Message-State: APjAAAWqRLaI6foIRmMsMAST5d9zmvkQ2eIIxO/XlJ6GFXIfQOKPC/hy fjNAUg8io99PsnHD+XIlKehUMRIDBwhviA== X-Google-Smtp-Source: APXvYqzYXmoYppRDH8divyVlXJC8aQJGWhd/CG8iq7wXXWbLYnmXEAc9/qV6Wi8kDjIcxyPs2ZXr5w== X-Received: by 2002:a19:f707:: with SMTP id z7mr1410546lfe.142.1568707082730; Tue, 17 Sep 2019 00:58:02 -0700 (PDT) Received: from localhost.localdomain (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.googlemail.com with ESMTPSA id g1sm270659ljl.31.2019.09.17.00.58.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Sep 2019 00:58:02 -0700 (PDT) From: Andrzej Ostruszka To: dev@dpdk.org, Wenzhuo Lu Cc: mattias.ronnblom@ericsson.com, stephen@networkplumber.org, Andrzej Ostruszka Date: Tue, 17 Sep 2019 09:57:51 +0200 Message-Id: <20190917075754.8310-8-amo@semihalf.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190917075754.8310-1-amo@semihalf.com> References: <20190917075754.8310-1-amo@semihalf.com> Subject: [dpdk-dev] [PATCH v2 07/10] net/e1000: fix maybe-uninitialized warnings for 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" During LTO build compiler reports some 'false positive' warnings about variables being possibly used uninitialized. This patch silences these warnings. 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 Sep 17 07:57:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Ostruszka X-Patchwork-Id: 59314 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 B45011BFFD; Tue, 17 Sep 2019 09:58:18 +0200 (CEST) Received: from mail-lj1-f195.google.com (mail-lj1-f195.google.com [209.85.208.195]) by dpdk.org (Postfix) with ESMTP id 3E2A01BFB2 for ; Tue, 17 Sep 2019 09:58:04 +0200 (CEST) Received: by mail-lj1-f195.google.com with SMTP id s19so2446711lji.6 for ; Tue, 17 Sep 2019 00:58:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=TTf3IQTmhcDaYHwMvlCvDyMVaPKkLxWN7c19i9tNUqw=; b=sbMuI8DQC5JAwDLQMrY4TDVmNO04u0kbIkhX8KU5KwAIcYQhLYj5bCXI2/1N2mPmOg QbUiF5rGB2Jx6qFghwkmjQ4x0x3trROnd8Tl2OmC1u8ZbW4Y+K1na/LEVC4EY8t/7zgm WjYFPbZxu+R3dEFhtFhbbIAMFUI5chqU9F6rDyIARUvDwyqV8jf+RU6hTsdQHGCjONnT AFF/1gTGYXa8gUMN7fWds7WqGGSOQaEH2tTx97eUQFgZgOpFHM/PYdwjxiXuYRF1PRFs T5sPzoApCV3dLfqerHGHtW/0mpekDGY785nLU0MEyZLe4jxq0Jp2vQVCiO2OE06Vshwc IWhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=TTf3IQTmhcDaYHwMvlCvDyMVaPKkLxWN7c19i9tNUqw=; b=FZF6gcMJQ1RkWaq9ERVt9xJF/Uuu8ttd1ZGuH+gVBomg5cbyfNbvfOCTmiT1xlZ3CZ YOH6nIg0i0R6hxKEmjvAhSvnqCugLjrKcZ57UsJZSVvYGGFh/9E8HbcbJH2QoM08cm6h 0de3G+k2pcw6810iVCVnr+2gq4PssQwsmuyMGJEE4v/j3e16fi2f8e9rLNPIirbSSs45 yl1WwSuxBhOLX2T6v+j2vgTSOqB3Jp/9a/7QWPiMfAO1vDvq7N19+u7BNf7+z24BnnC+ ABTz0QFJZuuU6eJI56XPA+oOyXaYh0Rz8erWjKJG0hr5cTCl5WzQ4YpgQknNVk/e+LK0 aRMw== X-Gm-Message-State: APjAAAV7FA9v9MvJDx6XQGlxHmZKpjrMAe75UpfsNHwYy6/Hnihh3zFC szDhoASeTzcJyTKg57PBpEfvKerIdHUGQw== X-Google-Smtp-Source: APXvYqzFrW4sSRRN2jQSJMc8l5jF8gX5Di4exazezg/W3afSF4lvQyLAEqCR1FDIsFcOwEJLmqE8Zw== X-Received: by 2002:a2e:878b:: with SMTP id n11mr1085682lji.13.1568707083785; Tue, 17 Sep 2019 00:58:03 -0700 (PDT) Received: from localhost.localdomain (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.googlemail.com with ESMTPSA id g1sm270659ljl.31.2019.09.17.00.58.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Sep 2019 00:58:03 -0700 (PDT) From: Andrzej Ostruszka To: dev@dpdk.org, Beilei Xing , Qi Zhang Cc: mattias.ronnblom@ericsson.com, stephen@networkplumber.org, Andrzej Ostruszka Date: Tue, 17 Sep 2019 09:57:52 +0200 Message-Id: <20190917075754.8310-9-amo@semihalf.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190917075754.8310-1-amo@semihalf.com> References: <20190917075754.8310-1-amo@semihalf.com> Subject: [dpdk-dev] [PATCH v2 08/10] net/i40e: fix maybe-uninitialized warnings for 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" During LTO build compiler reports some 'false positive' warnings about variables being possibly used uninitialized. This patch silences these warnings. 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 Sep 17 07:57:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Ostruszka X-Patchwork-Id: 59315 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 5E5111C00F; Tue, 17 Sep 2019 09:58:20 +0200 (CEST) Received: from mail-lj1-f193.google.com (mail-lj1-f193.google.com [209.85.208.193]) by dpdk.org (Postfix) with ESMTP id 2A9981BFBD for ; Tue, 17 Sep 2019 09:58:05 +0200 (CEST) Received: by mail-lj1-f193.google.com with SMTP id v24so2478713ljj.3 for ; Tue, 17 Sep 2019 00:58:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=gApXwU5Mr7lCBBA/zqVS/LfZzY7YW0HpPJUVU04+J/I=; b=Q4eOW8nqokLhafqZCkBBqRmEj0U8PhP1WqxfX9EUR0vx/RalWlfMHB+C2puMZG8Y9z sc4mBSAV49LLPyeGd8eyd+fCB2TvC3Vsxl1rXW9gRUnSKarG/WxoA2kcIam1151PWjBi /guFwXSZ1XD+Gntt03XTiAlcI26jqRBIiPuDToOQXZLiVjDV3x/A5Y/FwGJR8tq983vH BOCmerNZi8MJKPBE3sCr6UCkYXwWdymQKQC7AQUUVX1eV11UyTv4/ef2yWcwdDdeonx4 qtIXv9hc3fWjuBJBCENB6wfNXJH6ICyXpjJcH7A7nKu5HH0nkmc1IBolY3ZNIc/moaeo ZQSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=gApXwU5Mr7lCBBA/zqVS/LfZzY7YW0HpPJUVU04+J/I=; b=UG4AIZBn7g7G6BVcQGV6osvm9ePaEJwt6WKere7D4z56LtUkMB3zHd3lpRky/UBDst oAkkcSLP5MY4ul0c/YP4tihQncbAliI/0dTiujN6ewf1ibRVUqQIRsTY8WE22k/ewNrp cj0UqVoO/rLJ4GAUjGgoMh9BUoD38BwzOcqTACK0lSGVNpkNBuhP+VcALGcYeheIksmI Jm+gkAVk0YchxcVcFlo+gPzxoZ/Qfw4tVYt+0YYnE8zN7zOwOFz5HzXkKeuWEVRNOEh8 XARSXqIyloceeV1kNQbusDG9F5FnaZFDtYb/E5P/u7LETSxR7YtDIFkLm6vUIuCnHmpU xzpw== X-Gm-Message-State: APjAAAVpz8cGfIaEUYZt3eZCFZwLa/qVv0ocks6jLApAzugKuCMiEapd Mz/1eYPbvfykHuCpxCwEymZm3xeGJzM12A== X-Google-Smtp-Source: APXvYqzggMRrVMEmmOtPuGFrwNMCdJbhnbUeTOsTAhj2UzoSQMpHgPm1wtAP2NScKyLZKUTk984cEg== X-Received: by 2002:a2e:6e18:: with SMTP id j24mr1082822ljc.158.1568707084650; Tue, 17 Sep 2019 00:58:04 -0700 (PDT) Received: from localhost.localdomain (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.googlemail.com with ESMTPSA id g1sm270659ljl.31.2019.09.17.00.58.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Sep 2019 00:58:04 -0700 (PDT) From: Andrzej Ostruszka To: dev@dpdk.org, Xiao Wang Cc: mattias.ronnblom@ericsson.com, stephen@networkplumber.org, Andrzej Ostruszka Date: Tue, 17 Sep 2019 09:57:53 +0200 Message-Id: <20190917075754.8310-10-amo@semihalf.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190917075754.8310-1-amo@semihalf.com> References: <20190917075754.8310-1-amo@semihalf.com> Subject: [dpdk-dev] [PATCH v2 09/10] net/ifc: fix maybe-uninitialized warnings for 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" During LTO build compiler reports some 'false positive' warnings about variables being possibly used uninitialized. This patch silences these warnings. 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 Sep 17 07:57:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Ostruszka X-Patchwork-Id: 59316 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 230E31C014; Tue, 17 Sep 2019 09:58:22 +0200 (CEST) Received: from mail-lj1-f196.google.com (mail-lj1-f196.google.com [209.85.208.196]) by dpdk.org (Postfix) with ESMTP id 516E81BFBD for ; Tue, 17 Sep 2019 09:58:06 +0200 (CEST) Received: by mail-lj1-f196.google.com with SMTP id f5so2442223ljg.8 for ; Tue, 17 Sep 2019 00:58:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=OOTwzgVVZbZgLcv17CgsjgDYfH2VrYmyoKk+LqKCjhc=; b=wgIpVU246yOn3bjEcfEl80uY4vLMPTJtTJ1rTxoSLAnDJwt9vI7AT/eypUPQd+Rbae +yzKmXKihTMQG7dzKV7mStgUihYcm2ECIHtgKFCmTSQ9IM/CA0UGnMLIPU5CJZTqUomM BcFLK9N3sj9meum/gi0EZotdkXk72soUeA2c9HtscXXGuD/5/cxjldr85PWla4/9XgEu aHpo++RO3qAAc3FADwHfPIm6LRqa/MRTyBJqrVPZcHEtW5Narz7XeDhakMqpUpEjmTB1 MmFwTqLfIqAKMXEwQQ/70dwIxsVxxveiawIgZhMKh4lwHK/3gdrsGdE1ofe/Vxua/sj1 QgSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=OOTwzgVVZbZgLcv17CgsjgDYfH2VrYmyoKk+LqKCjhc=; b=LYwZZ6LpQE+AXHvlsMXedITEC2aieYgC8tgZI1jJV310yt7trYZ9mxzeoMU2SJZJAl UJ3aT8GhNqiVCoTL3K0Dq4CYQaeSPdsKZFNfyCXx3Hbprd60m2nx3Y2geCOlPLjTtuBr B1VbQpSaIzP2zB3PNK4K2C3coVAyrti+7kDO18CJdCqyuuDKH3ml/RVtjAB0b9/oCC1Z w9WhVFRtAyXyqrt8koE1LonBOI44TVPBRrTpmXLspieGiK3iA2nrHRLqDkCinM5D/9R5 5CJSkGrK8IJvC6SNShkhwDjOhhCFzT7/FjY+E1SnMToFsX9ZTYDXSQs4RSTRek++WSeQ oQrg== X-Gm-Message-State: APjAAAVWO7naq5cO7RgVma3xxvxae1ZdC+yeoz30DjFfrC4Lk3Xfhb7o 40mptphhIiTgsR+tvZ9HKnKNRCeaL0nktg== X-Google-Smtp-Source: APXvYqxidENImDx0J60Yp9OwLhfrXAxV8P4KLyGgMxf6oP/L/pEsEiVe/KMjfWF4yCW3VAiHX7L5Sw== X-Received: by 2002:a2e:4243:: with SMTP id p64mr1117884lja.213.1568707085547; Tue, 17 Sep 2019 00:58:05 -0700 (PDT) Received: from localhost.localdomain (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.googlemail.com with ESMTPSA id g1sm270659ljl.31.2019.09.17.00.58.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Sep 2019 00:58:05 -0700 (PDT) From: Andrzej Ostruszka To: dev@dpdk.org, Rasesh Mody , Shahed Shaikh Cc: mattias.ronnblom@ericsson.com, stephen@networkplumber.org, Andrzej Ostruszka Date: Tue, 17 Sep 2019 09:57:54 +0200 Message-Id: <20190917075754.8310-11-amo@semihalf.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190917075754.8310-1-amo@semihalf.com> References: <20190917075754.8310-1-amo@semihalf.com> Subject: [dpdk-dev] [PATCH v2 10/10] net/qede: fix maybe-uninitialized warnings for 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" During LTO build compiler reports some 'false positive' warnings about variables being possibly used uninitialized. This patch silences these warnings. 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;