From patchwork Thu Sep 5 09:32:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Ostruszka X-Patchwork-Id: 58626 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 DF0CD1EDD5; Thu, 5 Sep 2019 11:32:44 +0200 (CEST) Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) by dpdk.org (Postfix) with ESMTP id E25721ED83 for ; Thu, 5 Sep 2019 11:32:41 +0200 (CEST) Received: by mail-lf1-f50.google.com with SMTP id q27so1397469lfo.10 for ; Thu, 05 Sep 2019 02:32:41 -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=KulmLa3F+a4DpXJD5buRRIWy22ZnJT2reFnr1o2Owho=; b=k3RVkfSVPaOf2Q8BFEvzrEOxxHzh+tzBKF1hUzYoyYMG20BCivxF7HTwRc+7JUgATc Tsh3HNzs7wcAffTDPNwckVX6K3Vp+2+ZNRUZtcyaqaC4yCjADsI5mKzWqeYJSg5vtyng I3u6iOPCfbMYnOa/fC1+Sc2Wrrp7gKecCXSHrgwAFYl0A3mxfNMqZV7+uYhR3F/oTWd+ 8+/DyOzamGpnQM/AeEk2BQXrO+MfBHFLgWimq8urUX3zptoBhatmeYOSaYPmwOh0t3ag +SkPWRz1p6FhK5RE9EgFW5tV49j/Gp20N/Rh71CLW8dDIqFE8bVGovsssGJYZIZa8WaL Ojrg== 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=KulmLa3F+a4DpXJD5buRRIWy22ZnJT2reFnr1o2Owho=; b=eHAPkMNNACngRR3ovfbh11vr+S3HMk0S6LVsb4tWUSBU1AM+zFBaw4bM7edlb4DAF4 KuWRO33Kl9IcI5Y4mJpVEu6giBd42idofLFL+xaeAPGPgBkO7a9FtqSk8f8lmolDDAcm oyYpdKzi+uKMR6lH08eT+YQNyFDaRlJ3t4EZPMKmEb6AH5KYqSbCvAeBUTF1UC3S7H2t FHc4pabvLMzluFHgDrlWd9fArQhTvA6xHO1q3f1FcFgd9or/gmblmtMLLPxr9idA8Y1V txFk+CnjYZf0gfgdEfj1oxtkAUtGW95g/gNoWag0n4nL4p0kU9QFAlSG4IJZzFoqHA19 0/IA== X-Gm-Message-State: APjAAAVwp+X7jC+8hArU63XsW0kNr9fw2WlxKIYQuHoCIKqSqwRMmP8s 9bXEMctDgL+03LLIPPIIn+7gALG4HFCtAQ== X-Google-Smtp-Source: APXvYqwvgKs6g1tVyeK5nWSlRp6M4sR+nPedea7HespU5I3Y0VQzibNY1VdKJRijiXlfPZLOIiDeWQ== X-Received: by 2002:a19:ee02:: with SMTP id g2mr1655804lfb.113.1567675961254; Thu, 05 Sep 2019 02:32:41 -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 b25sm363060lfa.90.2019.09.05.02.32.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Sep 2019 02:32:40 -0700 (PDT) From: Andrzej Ostruszka To: dev@dpdk.org Cc: Andrzej Ostruszka Date: Thu, 5 Sep 2019 11:32:30 +0200 Message-Id: <20190905093239.27187-2-amo@semihalf.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190905093239.27187-1-amo@semihalf.com> References: <20190905093239.27187-1-amo@semihalf.com> Subject: [dpdk-dev] [PATCH 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 --- .travis.yml | 7 +++++ config/common_base | 5 +++ config/meson.build | 9 ++++++ doc/guides/prog_guide/lto.rst | 36 ++++++++++++++++++++++ doc/guides/rel_notes/release_19_11.rst | 8 +++++ meson_options.txt | 2 ++ 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 +++++ 11 files changed, 103 insertions(+) create mode 100644 doc/guides/prog_guide/lto.rst diff --git a/.travis.yml b/.travis.yml index 781f9f666..a9506b13a 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="static" OPTS="-Denable_lto=true" matrix: include: @@ -100,6 +101,12 @@ matrix: apt: packages: - *extra_packages + - env: DEF_LIB="static" OPTS="-Denable_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..b224d0cb8 100644 --- a/config/meson.build +++ b/config/meson.build @@ -196,3 +196,12 @@ add_project_arguments('-D_GNU_SOURCE', language: 'c') if is_freebsd add_project_arguments('-D__BSD_VISIBLE', language: 'c') endif + +if get_option('enable_lto') + if cc.has_argument('-flto -ffat-lto-objects') + add_project_arguments('-flto -ffat-lto-objects', language: 'c') + add_project_link_arguments('-flto', language: 'c') + else + message('compiler does not support LTO') + endif +endif diff --git a/doc/guides/prog_guide/lto.rst b/doc/guides/prog_guide/lto.rst new file mode 100644 index 000000000..effa0fcc3 --- /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, 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 -Denable_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 27cfbd9e3..639b7ed53 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/meson_options.txt b/meson_options.txt index 448f3e63d..a315e0f82 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -6,6 +6,8 @@ option('drivers_install_subdir', type: 'string', value: 'dpdk/pmds-', description: 'Subdirectory of libdir where to install PMDs. Defaults to using a versioned subdirectory.') option('enable_docs', type: 'boolean', value: false, description: 'build documentation') +option('enable_lto', type: 'boolean', value: false, + description: 'Enable link time optimization') option('enable_kmods', type: 'boolean', value: true, description: 'build kernel modules') option('examples', type: 'string', value: '', 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 Thu Sep 5 09:32:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Ostruszka X-Patchwork-Id: 58627 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 532101EE1A; Thu, 5 Sep 2019 11:32:47 +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 9D1891EDA9 for ; Thu, 5 Sep 2019 11:32:42 +0200 (CEST) Received: by mail-lf1-f67.google.com with SMTP id j4so1406167lfh.8 for ; Thu, 05 Sep 2019 02:32:42 -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=keqD3UUJ3TaOPTt26W1YdHED9zKHEa4w+XzsKZ1YjORbMq9SiR+e/LJo7qN/jxutwI 5hCfIilDLngtj92V7dR9N0HZ9Dd/FOYBPmFkEIgiNuXT97CXGj8alOxAVaZdZZ+GF9P2 6Al5L5IsnbRqTGptwyrNYdlRv26miKmtEZ9GA4xtmMqJSzLYPfW76GpoSRolIg7SXlv/ GMM7t1UxTKvm4V+6cIeMvwfdVpmDTxJ8sgiArLd22/kEHOyhjGA/PtZWLcaq4Bw8K6+b QxiMcN95h6nPrJBg/+J4iM2eU4sjkiT3f2pdRGMq2/I+iffjscW3PFrbSNWHvNMDg2Bb yxHQ== 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=SZhJ3b8VeGv7kipISq7R3A2pDHxjZZQiieuuMfaiIx5t2Whx+dOkLZzfni9vRiwvu5 R5VrxJ9k/2i1PMe4OOC5xwq7XgDNEwyUR6DVfoFLBz1mwJkx07U9Nhk1UAkPJFlONyml CkTnJbiiL7R0HAGej75WTJYFUly0ngegizSwXAbAsGzIQcWCtTemVB7Yl+qjY/PAPGxx bWJ/zimergc4FuaWDQ/yUMxa0Wwh4rtrkPnOKhhMon/+Ro29nxiS+sCQ0W2rXMEpmubF Ff6Cm+rgu2XupNfDNiepKXDonl3d5JYMqL9M+SsMUIayqO/FsI3N9jG0xpEFwLckF3by 7bxA== X-Gm-Message-State: APjAAAUzzJbKtQIdd8ufcEJ3k41yadTQv296zG4RtLDMwQ+clMGZlV0Z idzbe3Yg2HYFZ2Vp+CvrFkkl1wcTUYCk0A== X-Google-Smtp-Source: APXvYqyLSWt9VYxPqB+WPzE9CUXBMq91eDE2OEg/v/ZkuuKR+Ez9NCW6UgZ+QHv4koz6CUPay3Uejg== X-Received: by 2002:ac2:52b6:: with SMTP id r22mr1718085lfm.19.1567675962106; Thu, 05 Sep 2019 02:32:42 -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 b25sm363060lfa.90.2019.09.05.02.32.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Sep 2019 02:32:41 -0700 (PDT) From: Andrzej Ostruszka To: dev@dpdk.org Cc: Andrzej Ostruszka Date: Thu, 5 Sep 2019 11:32:31 +0200 Message-Id: <20190905093239.27187-3-amo@semihalf.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190905093239.27187-1-amo@semihalf.com> References: <20190905093239.27187-1-amo@semihalf.com> Subject: [dpdk-dev] [PATCH 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 --- 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 Thu Sep 5 09:32:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Ostruszka X-Patchwork-Id: 58628 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 E96731EE5B; Thu, 5 Sep 2019 11:32:51 +0200 (CEST) Received: from mail-lj1-f173.google.com (mail-lj1-f173.google.com [209.85.208.173]) by dpdk.org (Postfix) with ESMTP id 47BDA1EDA9 for ; Thu, 5 Sep 2019 11:32:43 +0200 (CEST) Received: by mail-lj1-f173.google.com with SMTP id d5so1684507lja.10 for ; Thu, 05 Sep 2019 02:32:43 -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=cZafQPBacW/9Brsq0NFycuNDaf9tnY01Jl2yRE/+pHVETvcje7SWfMDzzwyAFOVafL kowzg1vWoIb+i/u5X1fNSW3Lfk1wm466VXH15YgGpOJagbhKUreoH7wVvJ39I1SO9mWR 57+ZPbtDmZI6/t4mXjw7raxDMOATt9xkwO/ozYIhrXdJzr4EoVcBycMUh1wNJepxopC7 cllzstL5ld04chjs21rjPQ1gyp90Uo1JboB9aJNpmx5kDXoXa+jHFcqcD+zvYDqd1Gwg XIz28Q7+zVhFEvBSMp5tlWH4rXh2Y7zY+5swZ/7SsZ7MfU7eOhUd7K6wRdJbRr1IFYN+ J0+g== 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=GggMiGHJ6MgPpdr//3RMZcMLcUfXS2hol/Yz/+RkhRCcD24D9fkQ8Gj/ZFYJtVJdmZ kO1r3jg/0WvnmF9p16H+Tn5MZQr6FA1kEpdNG4F8okdai6KWCHkPeHD4uRaen03AKyC8 soxxZgH+s3a8DSvgj1gv6sPmuxYSm0tNl6pmbNB6jSjn2AC9qjb9nNsmfFMhFwFxiqTy XCjQFCPVhNjFuUJNO4pdOxqq5pEunNMsQ4EQqxAcPT5PHAx9B0wR12AfRBGH6/H1J84a dIM3k5IyVt3IuUXy/Qpgg0dpFH/Of0kuo8fTU/bt2b0tiFR+aVaOxwOkaNPlRQgsn/to ozvA== X-Gm-Message-State: APjAAAVePYoLBTbUSlbwj2NR0H5o89D5GO/7X6pi5vsT43/ocy9hEK12 h5eR1Q6+MCwqeiDH3nd1Ym6PAxl+g8oMvQ== X-Google-Smtp-Source: APXvYqzTfe9/nYYFmG3V24G4fryoHEzTouvrpUJBHjk8/o3GKouOqM6RpmttuunsP9bczLMoc8nfgQ== X-Received: by 2002:a2e:5418:: with SMTP id i24mr1401234ljb.126.1567675962839; Thu, 05 Sep 2019 02:32:42 -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 b25sm363060lfa.90.2019.09.05.02.32.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Sep 2019 02:32:42 -0700 (PDT) From: Andrzej Ostruszka To: dev@dpdk.org Cc: Andrzej Ostruszka Date: Thu, 5 Sep 2019 11:32:32 +0200 Message-Id: <20190905093239.27187-4-amo@semihalf.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190905093239.27187-1-amo@semihalf.com> References: <20190905093239.27187-1-amo@semihalf.com> Subject: [dpdk-dev] [PATCH 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 --- 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 Thu Sep 5 09:32:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Ostruszka X-Patchwork-Id: 58629 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 CC5351EF27; Thu, 5 Sep 2019 11:32:53 +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 148D11EDD0 for ; Thu, 5 Sep 2019 11:32:44 +0200 (CEST) Received: by mail-lf1-f65.google.com with SMTP id u29so1407090lfk.7 for ; Thu, 05 Sep 2019 02:32:44 -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=Zp41z/O8N93QsO2iipWG+FzVAejLIAS3evu0C6kGzhlb2Bp9Gr46j7e1zf36aCNmJL s2SYXVCSJZPYMifMZAazkM3qIJjwI8JcWL25EjcKBJV4uHDFvjL1buUdr7TGjl3h3xjK y0JdA0/az6G6MncFEv8xn0nM/vNfrHtvtcFr/Z4PkR22TXny5A6jIbb8wCjmkZpz8ybl Fc4dDftm+mjv1JSW1w9mVGv2xddY4uXqT2QtizHrYl45dKsCNRVxaYn303o1bM6nI88Q tXdnMt/KMUyqiQNpOuILtLEy1YrCgmB6wc6E4sC8iHL/RvC+m4sCWOML8l4oafhtcRpA DPpA== 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=i9EuF5DrKJWdRnhoa2/oQKGCTXt5voov18pZlo9nySjpQwhwUMcF3FU+NgGfFuGY8T 0pLd03h6uUjctjD2jenOOSDlYYeTzmY5wxjA4jly9ZSr8Xwbry7SJLrPF372aikvrB7p KL5cP4nGZiETXbZHz8KOKcji5qU/x9qGKP+iQGJU75sYK1tIOwjp+kGwC9syKqRod52i mn4EjQGqs4J9iIzEOMORUZIY7Q0nxXNtjHX8XRR+2fOJaa3lK9LlbvfWx9BU0dJCrWe2 z1m8YGR7uObayPP4FHwkIxGg+8es3wsvzDCMe10z9thQa7FokBvIQm+qVC6FGcL5nuGZ 1BnQ== X-Gm-Message-State: APjAAAVC6qIPOIF3udDnAjJvTolS686h9DI75tNZ0+9obzWUl4cnWdYi yVCH5YqEYXVCnIWdzDPbZvnU8LC74oZ9Nw== X-Google-Smtp-Source: APXvYqyjaTiCCT5BuHpiTo9EnnJwA2j3Rl3V3azCWaq/GY7k6WNOs9XthayJLKVUf2g/oOrmjCnrBg== X-Received: by 2002:a19:c002:: with SMTP id q2mr1740436lff.62.1567675963577; Thu, 05 Sep 2019 02:32:43 -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 b25sm363060lfa.90.2019.09.05.02.32.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Sep 2019 02:32:43 -0700 (PDT) From: Andrzej Ostruszka To: dev@dpdk.org Cc: Andrzej Ostruszka Date: Thu, 5 Sep 2019 11:32:33 +0200 Message-Id: <20190905093239.27187-5-amo@semihalf.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190905093239.27187-1-amo@semihalf.com> References: <20190905093239.27187-1-amo@semihalf.com> Subject: [dpdk-dev] [PATCH 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 Thu Sep 5 09:32:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Ostruszka X-Patchwork-Id: 58630 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 7A9F61EF32; Thu, 5 Sep 2019 11:32:55 +0200 (CEST) Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) by dpdk.org (Postfix) with ESMTP id A218C1EDA4 for ; Thu, 5 Sep 2019 11:32:44 +0200 (CEST) Received: by mail-lf1-f50.google.com with SMTP id q27so1397583lfo.10 for ; Thu, 05 Sep 2019 02:32:44 -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=Qp4s1wKZ6/zIzapPL6YFnlqGDfmTKGwX5YlcVUxgFHc=; b=km9+Co1aZLmMALZMs14vaoLIcwdYkNRT9whFwNzBjOSk3s2yNj96B092qu4HJvU/KH VBbMCkcDI0/h15fv1OF7g+xXQIGAdbg+eehl5YylO2m6zGtG3PRDuuUXxvQQoy0uJP1P yil1wvLpHZ5bwXk30RL0gVnJXRA3MRI+uRA/clu4ALESzWe+KcR1cMn7pM8ze+jGY2h/ 1IbqHjcrZJjoCgKLFhvKkpK3xCSzxP+9q3eZwvPhR4JQFy/VK9ujKQ3gACGT0B/bNa/i D5C1Axy7O8ZFR1X27ou4D9whn1pe4ZDTIiRsCjXWjhxPEANUOq2/anlH0dQ3kojxPZeK w8pg== 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=Qp4s1wKZ6/zIzapPL6YFnlqGDfmTKGwX5YlcVUxgFHc=; b=F4cM8Dsck1hn6/2k9971OGDTn2DXpNuOd77Kw8PA35J9LMpvcV8/EdQg4PyzS9uUk2 g8/4bsLGMbuo0NdFfKyOH6Z4qSBwslH3V1Bf6PNSE9lNB/n+dn023Ax7zVUkJuwKc3f9 /1Ud+4vwYmPWvAFi8SgKPQDoSbPuK5GYMvgUs+yi6JatFr+fxZClKffeKhBPZHgWqRij oPyzU3YpTQzkA5/ESXeAshaG9ryWoSOpjra9YrekWnTLFML5LhKnCEqOo7xgHqH87OUi CyIVBsJo+IA9ED1dM2+zKIbiM4ivORO/SPGfA2YFGJ9N3pQJ0JAcWIjYIfBBdV+zDdDO jVzg== X-Gm-Message-State: APjAAAXcTIZiC2uuHb/dFZHXhRFGH0InYBgUrZHu7lvdmQGSh5ktg54M lbRE06iUBLZ7fsaFhe5jvKM+WpA94Vg2yQ== X-Google-Smtp-Source: APXvYqxmTrse1JmBPbkHPTx2O9kWELyvbZYEHchNQeCDXBSpraeuIaBlp8S3pvWzw/WDMGCUs9gMzg== X-Received: by 2002:a19:7609:: with SMTP id c9mr1597649lff.91.1567675964250; Thu, 05 Sep 2019 02:32:44 -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 b25sm363060lfa.90.2019.09.05.02.32.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Sep 2019 02:32:43 -0700 (PDT) From: Andrzej Ostruszka To: dev@dpdk.org Cc: Andrzej Ostruszka Date: Thu, 5 Sep 2019 11:32:34 +0200 Message-Id: <20190905093239.27187-6-amo@semihalf.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190905093239.27187-1-amo@semihalf.com> References: <20190905093239.27187-1-amo@semihalf.com> Subject: [dpdk-dev] [PATCH 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 | 6 ++++-- app/test/test_memzone.c | 3 ++- 3 files changed, 7 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..8ca376dda 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,9 @@ 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) + 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 Thu Sep 5 09:32:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Ostruszka X-Patchwork-Id: 58631 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 14D591EF3E; Thu, 5 Sep 2019 11:32:57 +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 836111EDED for ; Thu, 5 Sep 2019 11:32:45 +0200 (CEST) Received: by mail-lj1-f195.google.com with SMTP id a4so1697032ljk.8 for ; Thu, 05 Sep 2019 02:32:45 -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=ARDOlnys48Lb+0hMvm7qqu8QlowKGjcOdiP3knBHbW+sn1mJOdVzRBYovpLXWOxZ+9 /wYBTlfkk+i1hXRmiSEENiU3Lgm3xmkbBhkJSGwuv4RdwQgmaGMHY+63ncBvmm0sazGk hh9fBMs4o1AO0/W6bF7swWww3RGTPtzdlvD1UnBg1KNI7qSBNcTVhwWapoayPOJTnuu+ 3rK/UIVJa/nNNbrlbfUUyf7ZcWXUSfGkOTSDg/VhBqJpRLuqZvFZkGx6scLXr1P30CJ6 khxwAa1oexXFs9R15sR2a7fn2WOa9AYkfJlUy/FUDha8WmCTDlRVGnwza1QJmKoCIT/J nDaw== 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=LSqlxFulL4AcAAVsKIEP3shR4OJbDpR4jMcagjb5AzqEm8qRh7bbkDczKHfbybCSRB dxK/FfzAnwsT5tVcN3hBoybLTGImN6KsA6IS6G6LaK8MilOjYTCtprXEVTF8Ojv/Q5Wj SUqGteX+lTvnu57LrsZ1iWdF7ZAEGZ9o4NuT1QmuQSlc1o+OPmhRQAQ+SyFm/9Ve2jLc fFicuOc5mevLXftOhnaUkQMIQuZWQqDCswH33Og+ay0kxZ1u4ooCkuSUi9zx0rypT8im xaGiHMIwn0jH6wnXvxzB4SQuefq9x3Ph5tZNj/SDKZsCp8k/vcyY5fNp0zotgFIUoXbM 6WZw== X-Gm-Message-State: APjAAAU15e7sAWBuPb92o75c43ZTgLqV4Wq21j1gAaWl/8+DOAKH83Xk E75LWOip/WaFxFJMYKKFxWJgkQwG+fgS0g== X-Google-Smtp-Source: APXvYqzPkdwFIYUNzdFG7/poSvhFzGegjOsQA9cPX6sIa2w+vHI+wQqJMd1sJWTsoOZYLYAGIQSqWw== X-Received: by 2002:a2e:7502:: with SMTP id q2mr1360853ljc.202.1567675965100; Thu, 05 Sep 2019 02:32:45 -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 b25sm363060lfa.90.2019.09.05.02.32.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Sep 2019 02:32:44 -0700 (PDT) From: Andrzej Ostruszka To: dev@dpdk.org Cc: Andrzej Ostruszka Date: Thu, 5 Sep 2019 11:32:35 +0200 Message-Id: <20190905093239.27187-7-amo@semihalf.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190905093239.27187-1-amo@semihalf.com> References: <20190905093239.27187-1-amo@semihalf.com> Subject: [dpdk-dev] [PATCH 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 Thu Sep 5 09:32:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Ostruszka X-Patchwork-Id: 58632 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 B1FBA1EF4A; Thu, 5 Sep 2019 11:32:58 +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 55AAC1EDF5 for ; Thu, 5 Sep 2019 11:32:46 +0200 (CEST) Received: by mail-lj1-f193.google.com with SMTP id x18so1737979ljh.1 for ; Thu, 05 Sep 2019 02:32:46 -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=D7BKoWpAic6RJgsFQGpGOWOCqjPAdily/LTxTaWJlsDeiMvDRPSCFABJs5WtYVxaHN o2wpCSzV0z4QkB7NDyohzJ6UQuOYLRwLbI0+GXeolRfdCRC6YjkJASZ+L8xha/PZ1Hk0 Kmyb89s5V5ql2XAnuQb8ZjjTdRbz2CpWzd88gW5elxq13Jtf8l970lL2MLzeHbfhI0vw 3pUZpKmujkG/Y0z+yUH6rv4xwsQTLAtgjPhuyAVO/J+2CrCNbfeWBljtwJPci9gWGhj+ +hpo9DvEdjOC8PpHsknYfT6pzvXBPPlnvZ3Hw2JvcPb/2akcsROWnIwXN6ZIMVxFvX/J XkeA== 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=Wlb04McpJJic/YtqnyciuwIcoMzxxuUbaswEhLScMKx1QIb8FIm/H65hoJlSdHnHZw TTBZuFrlJ+E5V/F3E7OtN+vJUI0lLc/UFWxllvH89uQvTl6RL70lMoQTluZlPBw5S8WF hE57Ylz9BtjR3MExzoXN0iNO58n6L6AS1WqKSrysvr8+Ko8U+g8jIDsFbLEmU9X/tWVP MLtJ8NSQ3mD0ENyHZufklVTlIt418gX+qmHb8+pHfRDvfmLdB4kQfn9WeasCqFoJxdU8 AbxgXfjHLEI3VE/y0LMnmY3pu7jHz+6TpH96Wow1Kw014YJk/rFCFXkDWrG7aeOYhhdQ c3XQ== X-Gm-Message-State: APjAAAU8xNgXcMEKNeh4amorwc3M4erLyhPpKbL01pogrVt/HHbTaUzf t/Ju0n9o9rNmKoixB8pYtRoqiknmEil18g== X-Google-Smtp-Source: APXvYqxYs0BlXij/S3GAlo7KqLzxxrIrJFjKYatmjvcopEN+MSkCud7GZ/FPbWyRzyOxyJY5D/aryA== X-Received: by 2002:a2e:b1c4:: with SMTP id e4mr1394610lja.101.1567675965833; Thu, 05 Sep 2019 02:32:45 -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 b25sm363060lfa.90.2019.09.05.02.32.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Sep 2019 02:32:45 -0700 (PDT) From: Andrzej Ostruszka To: dev@dpdk.org Cc: Andrzej Ostruszka Date: Thu, 5 Sep 2019 11:32:36 +0200 Message-Id: <20190905093239.27187-8-amo@semihalf.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190905093239.27187-1-amo@semihalf.com> References: <20190905093239.27187-1-amo@semihalf.com> Subject: [dpdk-dev] [PATCH 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 Thu Sep 5 09:32:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Ostruszka X-Patchwork-Id: 58633 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 621E51EF58; Thu, 5 Sep 2019 11:33:00 +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 DE64B1EDF5 for ; Thu, 5 Sep 2019 11:32:46 +0200 (CEST) Received: by mail-lj1-f193.google.com with SMTP id t14so1716080lji.4 for ; Thu, 05 Sep 2019 02:32:46 -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=MfRq8BQCu8SVMwKx9cadeWGgCRh4954AR7pTjuBgv5kuArccg7L9imfEaHH71hkGet IvJUb7tUq6UiRbttbHoMMLEj7awA54Msnb0jyHwM7unk8iMF+MBtiHN4gC7HWH9OKu4u VXq3mianu+RLjTDgP0gtCO7KaZUU5vyztldBQZUir1N+dc0eGIHBhabpKhazyJeUMOj+ HrHdvFRi5NDI2kFGN56O1W3tStG9y6ylOB9WwEEPyx+dHWokLJ2P+MWTRn4UUeGUi6ci 04DlDitt8r+wCONW1tXf+5H5vzWU6zZuvAoThf4WdQp6Ws2eetz2WcS1FP9ADtHdmHGR PHAQ== 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=WyCbG9tbFnI1VBPkfMwODjMH4jTQveWqB08T2P/NGGdY601txziwMaa7nygUCF8u/t 7xDHbO8+aoz7EEmaVHINdFyrk5RLKUrxc+bkf3G0sOJTrzxzO9Mz6+yFIDsA5HryEplg G4CrvMNVvfg/aCy4G/DU4VofrUdSzHgznAhhDO+3F/oyMzhS0joIPpyLKolIm8Ogm9+4 FpQz6Y0mIo92mTt2HwdMr8uA61vM32b9uNzIqD/1hFbLpvIL1iT0WVVOcon4kAKXMoNG d4JSwDisz/sdH1ra3yPHCyWQI1WR3kLf3Y0O54X2OZHLNuI973OzEb1FeOKWbM/NzITL G0JA== X-Gm-Message-State: APjAAAVOxVcJXcQSpXl9mJd7BPZ9ND+K/Mj1LNK6Z+Duibo2Bnzc0JtR sHG3KO3HcOrt+JN7KvMoxTOQEiyNIAtrog== X-Google-Smtp-Source: APXvYqySIaTwA/FoWfajAJBkWs1qZdtWYzBW9OUAgA0IYzK7jgityX9yet0SziCPTT0mt02lkylkcA== X-Received: by 2002:a2e:3c14:: with SMTP id j20mr1349610lja.84.1567675966482; Thu, 05 Sep 2019 02:32:46 -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 b25sm363060lfa.90.2019.09.05.02.32.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Sep 2019 02:32:46 -0700 (PDT) From: Andrzej Ostruszka To: dev@dpdk.org Cc: Andrzej Ostruszka Date: Thu, 5 Sep 2019 11:32:37 +0200 Message-Id: <20190905093239.27187-9-amo@semihalf.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190905093239.27187-1-amo@semihalf.com> References: <20190905093239.27187-1-amo@semihalf.com> Subject: [dpdk-dev] [PATCH 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 Thu Sep 5 09:32:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Ostruszka X-Patchwork-Id: 58634 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 97F851EF67; Thu, 5 Sep 2019 11:33:02 +0200 (CEST) Received: from mail-lj1-f194.google.com (mail-lj1-f194.google.com [209.85.208.194]) by dpdk.org (Postfix) with ESMTP id AD7D61EDD0 for ; Thu, 5 Sep 2019 11:32:47 +0200 (CEST) Received: by mail-lj1-f194.google.com with SMTP id y23so1380333ljn.5 for ; Thu, 05 Sep 2019 02:32:47 -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=PzAr039cIHSFlhc9jOF8KKqg0JcXpKR4+s+zaIBG4+bHrGUbyxgae2QdnSVLt+Wx0d ETVgCByBhgqsWQLVQpx6PLqq2KwBbydcKhSOe1C8oK15Yok9FYBX1sz5eufvy74GmezU 1yrJWD6qmiGCNlEmrMxNagXJZo29pug1utjFpdnAnU/xnTKkFHMjGFk4VdU7uFp4I9/A BBLiBFKyo/eJ5VEmBMF0gyvfnvnjpVQLBybxRAFFMzP1yCe52Ym8w2fXdw8cvpu5mM5Y ShrBlhi+ya4xEe6AvZvgm/EfGucCZRLaiHJCxKxuxX83j++9wwX75zPeuAlN1xtt4Hwg l7EA== 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=hQfv5Aj4/J4FaShlLvgcVfy+hzrCp/yeOzhgrOErah7o7kGUb8mG5Mrc27vhBI0s9D ggdjCgaP/KnkSrR2pfKvgyz7OlnoRpzU637eRa/JUi+mdpJMPPim2uz7weJYMsn8wWWn FdtS03LXQln4pv7+WO7d1kGZ21cok6brNUF9Dz7eE+VPj62pou8HO5wECv2VTt3mYWuV 6CDp8NOoo5Ex8A0PP5DpNwIDWOIO+7bhkz2fK6Eb1Iirse6u99UMsdxv1pEQ9ddc6Uqw DbtDFvDh0xOjtOOx5kWBPxSxJFZ8Lj/j5zNTZBXwCbk3ZdFTuE0n0uBkd4C9Fwx0Qc7r 1ERQ== X-Gm-Message-State: APjAAAWz9X60wTBOm9QRJ3Z1BskRhejB1yHp89x6s1mPVU0Pl5vUuJju c0QBQ8ctUMVAARubrxWvMVOVhBC8N31bKA== X-Google-Smtp-Source: APXvYqxxfR+TXjIP6M9+GxUQ2GhVuvbYAIKqFcQStBZ28pnHcNHucmzUnK9iVvySk2NEvxRMJ7dCfg== X-Received: by 2002:a05:651c:113c:: with SMTP id e28mr984671ljo.184.1567675967219; Thu, 05 Sep 2019 02:32:47 -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 b25sm363060lfa.90.2019.09.05.02.32.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Sep 2019 02:32:46 -0700 (PDT) From: Andrzej Ostruszka To: dev@dpdk.org Cc: Andrzej Ostruszka Date: Thu, 5 Sep 2019 11:32:38 +0200 Message-Id: <20190905093239.27187-10-amo@semihalf.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190905093239.27187-1-amo@semihalf.com> References: <20190905093239.27187-1-amo@semihalf.com> Subject: [dpdk-dev] [PATCH 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 Thu Sep 5 09:32:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Ostruszka X-Patchwork-Id: 58635 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 0DF1A1EF6D; Thu, 5 Sep 2019 11:33:04 +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 5AB851EDD0 for ; Thu, 5 Sep 2019 11:32:48 +0200 (CEST) Received: by mail-lj1-f196.google.com with SMTP id y23so1380375ljn.5 for ; Thu, 05 Sep 2019 02:32:48 -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=PrQPlE3YgWSRmXrbu6fxAsrbbNvkDu4MLk/daDDMJgfdff63a0q1gPYc8TgzFIfmmQ NTLaECFK6U84trGpc2qldc3BLz8q/SqqTSqUKiE+xD/kRRxwkFwn++JM0X+mRdqJzaXI OQM7qVWBEfJj4hPPMytdiqdYFeU6m+jwuEHKUt/xGtWRaU+hpkriLk051Wf4pzIxx6SV a9YoKT663xanY4QNhF8TMSN3rHYr4jsxn6Uw5ZzGjthPp6lwTkBw1+BWzuTJ6e6UufHP 72yuhCY25o4SvPG66J/DgzNssqPcyfjIrcLWqTETbMjZjWmu5oeceX6mrW+IzlcpU03g JpFg== 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=AA7FIvHNGJe+YLD8BQbGCkx7MQ5SaptO5CS3kKI+2tv6W1rHBLaBpkpQcK2Ej9SvRE /+gTEy9E25gfTlAmGKOqIJWIw15X7jzWYWzeG7G0Z9kjTgrolZY3YRAKKUGJZ4GqcN9M ieAvYxoM9uPfGXDVLY5pOFJXfqZA/aS1QVx1ObS4XUB6C/RdNM/x1LkWWwRz50oIIVhB lRIxDXYUELG+0xhPFrJdHMdtL+MgHDepemdrOdVzlMqGROV9X733D1Hip1htv1QB9TBC o1wjyjlVuIDIfLqwqHtIrYYMKhGnN/3cE/DaEzuSxJpmOX5aqeYuVWm8pujT43IEwbhc xKTA== X-Gm-Message-State: APjAAAUaupYWCOjV6Ux1kq24sAt2VoG2KmzKqKYnOkt//qnuNBuhiAQ+ sl/235txAqcElPhTvwcjLwYDrqcj9qvkSQ== X-Google-Smtp-Source: APXvYqyfz8JUoOEenl9rVVpI/Pgrh3HUj5RWaIScuKgTGJi61biiEJJHqLBEq5vRfXMwXJAxf4IaCg== X-Received: by 2002:a2e:984e:: with SMTP id e14mr1410538ljj.167.1567675967865; Thu, 05 Sep 2019 02:32:47 -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 b25sm363060lfa.90.2019.09.05.02.32.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Sep 2019 02:32:47 -0700 (PDT) From: Andrzej Ostruszka To: dev@dpdk.org Cc: Andrzej Ostruszka Date: Thu, 5 Sep 2019 11:32:39 +0200 Message-Id: <20190905093239.27187-11-amo@semihalf.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190905093239.27187-1-amo@semihalf.com> References: <20190905093239.27187-1-amo@semihalf.com> Subject: [dpdk-dev] [PATCH 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;