From patchwork Fri May 8 16:45:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ferruh Yigit X-Patchwork-Id: 70007 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id E879BA0350; Fri, 8 May 2020 18:45:54 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 875011D993; Fri, 8 May 2020 18:45:54 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 6E47E1BEE0 for ; Fri, 8 May 2020 18:45:53 +0200 (CEST) IronPort-SDR: JniQHwUfemnvyD1mfcNM6sRFTjqBzkMp6ma4OraEJ/FBe3pNdd8RM4aP3KwBJYyPStBqShYMWl rFQqBg7Jdrgw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 May 2020 09:45:52 -0700 IronPort-SDR: 9ots+samcBcYjWZroTDV1JsBNZwtxTcevr4WmjYDsSDQL4/oZdmObH8T/FPC1YNUfyJ9vwwuKQ 0KDeoS4QDWPw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,368,1583222400"; d="scan'208";a="462637718" Received: from silpixa00399752.ir.intel.com (HELO silpixa00399752.ger.corp.intel.com) ([10.237.222.180]) by fmsmga006.fm.intel.com with ESMTP; 08 May 2020 09:45:51 -0700 From: Ferruh Yigit To: Honnappa Nagarahalli , Konstantin Ananyev Cc: dev@dpdk.org, Ferruh Yigit , Thomas Monjalon , David Marchand Date: Fri, 8 May 2020 17:45:43 +0100 Message-Id: <20200508164546.2489396-1-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20200507120259.2197813-1-ferruh.yigit@intel.com> References: <20200507120259.2197813-1-ferruh.yigit@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v2 1/4] ring: fix build for gcc O1 optimization 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" Can be reproduced with "make EXTRA_CFLAGS='-O1'" command using gcc (GCC) 9.3.1 20200408 (Red Hat 9.3.1-2) Two build errors: 1) In file included from .../build/include/rte_ring_elem.h:1093, from .../lib/librte_rcu/rte_rcu_qsbr.c:21: ../lib/librte_rcu/rte_rcu_qsbr.c: In function ‘rte_rcu_qsbr_dq_reclaim’: .../build/include/rte_ring_peek.h:282:22: error: ‘avail’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 282 | *available = avail - n; | ~~~~~~^~~ ./build/include/rte_ring_peek.h:259:11: note: ‘avail’ was declared here 259 | uint32_t avail, head, next; | ^~~~~ 2) In file included from .../build/include/rte_ring_elem.h:1093, from .../build/include/rte_ring.h:405, from .../app/test/test_ring_stress.h:13, from .../app/test/test_ring_stress_impl.h:5, from .../app/test/test_ring_peek_stress.c:5: .../app/test/test_ring_peek_stress.c: In function ‘_st_ring_enqueue_bulk’: .../build/include/rte_ring_peek.h:80:22: error: ‘free’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 80 | *free_space = free - n; | ~~~~~^~~ .../build/include/rte_ring_peek.h:60:11: note: ‘free’ was declared here 60 | uint32_t free, head, next; | ^~~~ The cases shouldn't be hit, and it looks like there is already logic error if it has been hit, but assigning 'avail' & 'free' to '0' to fix the build error. Signed-off-by: Ferruh Yigit Acked-by: Konstantin Ananyev --- lib/librte_ring/rte_ring_peek.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/librte_ring/rte_ring_peek.h b/lib/librte_ring/rte_ring_peek.h index d5e6ea1cf3..45f707dc7e 100644 --- a/lib/librte_ring/rte_ring_peek.h +++ b/lib/librte_ring/rte_ring_peek.h @@ -74,6 +74,7 @@ __rte_ring_do_enqueue_start(struct rte_ring *r, uint32_t n, /* unsupported mode, shouldn't be here */ RTE_ASSERT(0); n = 0; + free = 0; } if (free_space != NULL) @@ -273,6 +274,7 @@ __rte_ring_do_dequeue_start(struct rte_ring *r, void *obj_table, /* unsupported mode, shouldn't be here */ RTE_ASSERT(0); n = 0; + avail = 0; } if (n != 0) From patchwork Fri May 8 16:45:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ferruh Yigit X-Patchwork-Id: 70008 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3663FA0350; Fri, 8 May 2020 18:46:03 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E3E101DA8B; Fri, 8 May 2020 18:45:56 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 526471DA7B for ; Fri, 8 May 2020 18:45:55 +0200 (CEST) IronPort-SDR: 7uqUK1cRa9a321V8iTY9NBlVI2OJML/GTcW4V3WAgBb/36qCMQkImlhYyotJyX57asKkY4sPmT aCA2ETQ1ckjw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 May 2020 09:45:54 -0700 IronPort-SDR: T5qut8+27WmfIFETE8sapqN/LFv0DJLSO3YYAgM4NCAGsoTcS1oYa5N20Uj9jBKCR8sRT20Z5m stn6HQGA8AsQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,368,1583222400"; d="scan'208";a="462637744" Received: from silpixa00399752.ir.intel.com (HELO silpixa00399752.ger.corp.intel.com) ([10.237.222.180]) by fmsmga006.fm.intel.com with ESMTP; 08 May 2020 09:45:53 -0700 From: Ferruh Yigit To: Jerin Jacob , Nithin Dabilpuram Cc: dev@dpdk.org, Ferruh Yigit , Thomas Monjalon , David Marchand Date: Fri, 8 May 2020 17:45:44 +0100 Message-Id: <20200508164546.2489396-2-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20200508164546.2489396-1-ferruh.yigit@intel.com> References: <20200507120259.2197813-1-ferruh.yigit@intel.com> <20200508164546.2489396-1-ferruh.yigit@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v2 2/4] mempool/octeontx2: fix build for gcc O1 optimization 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" Can be reproduced with "make EXTRA_CFLAGS='-O1'" command using gcc (GCC) 9.3.1 20200408 (Red Hat 9.3.1-2) Build error: In file included from .../drivers/mempool/octeontx2/otx2_mempool.h:13, from .../drivers/mempool/octeontx2/otx2_mempool_ops.c:8: .../drivers/mempool/octeontx2/otx2_mempool_ops.c: In function ‘otx2_npa_alloc’: .../drivers/common/octeontx2/otx2_common.h:94:2: error: ‘aura_handle’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 94 | rte_log(RTE_LOG_DEBUG, otx2_logtype_ ## subsystem, \ | ^~~~~~~ .../drivers/mempool/octeontx2/otx2_mempool_ops.c:643:11: note: ‘aura_handle’ was declared here 643 | uint64_t aura_handle; | ^~~~~~~~~~~ This looks like false positive, assigning an initial value to 'aura_handle' to fix the build error. Signed-off-by: Ferruh Yigit Acked-by: Jerin Jacob --- This is assuming assigning initial value won't have a performance affect if it does, we need to find another fix. And overall not sure why this false positive warning is generated. --- drivers/mempool/octeontx2/otx2_mempool_ops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mempool/octeontx2/otx2_mempool_ops.c b/drivers/mempool/octeontx2/otx2_mempool_ops.c index 162b7f01da..078ffac3e2 100644 --- a/drivers/mempool/octeontx2/otx2_mempool_ops.c +++ b/drivers/mempool/octeontx2/otx2_mempool_ops.c @@ -640,7 +640,7 @@ otx2_npa_alloc(struct rte_mempool *mp) struct otx2_npa_lf *lf; struct npa_aura_s aura; struct npa_pool_s pool; - uint64_t aura_handle; + uint64_t aura_handle = 0; size_t padding; int rc; From patchwork Fri May 8 16:45:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ferruh Yigit X-Patchwork-Id: 70009 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5F06FA0350; Fri, 8 May 2020 18:46:17 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8FA421DAAB; Fri, 8 May 2020 18:45:59 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id CA9341DAAB for ; Fri, 8 May 2020 18:45:58 +0200 (CEST) IronPort-SDR: s2//2sTtxQMiei2G9tOlcrVe/CSflPjWSBS7o4G4WwnRgUR3qhJi1iGme1n9ciPmvBvTJPHiOd dHP1oX3Kgjfg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 May 2020 09:45:58 -0700 IronPort-SDR: XvS+V/NigL/Pakj5Fb/EniGmO+zZYPFcS6TZC4sp6muu9SP9OtPtI/21sn5M4jbFoYuId/ENbE WUC/mO5jaEYA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,368,1583222400"; d="scan'208";a="462637758" Received: from silpixa00399752.ir.intel.com (HELO silpixa00399752.ger.corp.intel.com) ([10.237.222.180]) by fmsmga006.fm.intel.com with ESMTP; 08 May 2020 09:45:56 -0700 From: Ferruh Yigit To: Marcin Wojtas , Michal Krawczyk , Guy Tzalik , Evgeny Schemeilin , Igor Chauskin Cc: dev@dpdk.org, Ferruh Yigit , Thomas Monjalon , David Marchand Date: Fri, 8 May 2020 17:45:45 +0100 Message-Id: <20200508164546.2489396-3-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20200508164546.2489396-1-ferruh.yigit@intel.com> References: <20200507120259.2197813-1-ferruh.yigit@intel.com> <20200508164546.2489396-1-ferruh.yigit@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v2 3/4] net/ena: fix build for O1 optimization 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" Can be reproduced with "make EXTRA_CFLAGS='-O1'" command using gcc (GCC) 9.3.1 20200408 (Red Hat 9.3.1-2) Build error: .../drivers/net/ena/ena_ethdev.c: In function ‘eth_ena_dev_init’: .../drivers/net/ena/ena_ethdev.c:1815:20: error: ‘wd_state’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 1815 | adapter->wd_state = wd_state; | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~ This looks like false positive, fixing by assigning initial value to 'wd_state' variable. Signed-off-by: Ferruh Yigit Acked-by: Michal Krawczyk --- drivers/net/ena/ena_ethdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c index c3fd3a4ac0..fbddc79f79 100644 --- a/drivers/net/ena/ena_ethdev.c +++ b/drivers/net/ena/ena_ethdev.c @@ -1756,7 +1756,7 @@ static int eth_ena_dev_init(struct rte_eth_dev *eth_dev) int rc; static int adapters_found; bool disable_meta_caching; - bool wd_state; + bool wd_state = false; eth_dev->dev_ops = &ena_dev_ops; eth_dev->rx_pkt_burst = ð_ena_recv_pkts; From patchwork Fri May 8 16:45:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ferruh Yigit X-Patchwork-Id: 70010 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5F0C5A0350; Fri, 8 May 2020 18:46:29 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D30C31DAB3; Fri, 8 May 2020 18:46:02 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 4C16B1DAB2 for ; Fri, 8 May 2020 18:46:01 +0200 (CEST) IronPort-SDR: vPPvmA6b9TNWP5Jki+SSbYHLdbUf+B+yLMz0wuAmJM6m+H6o8V1p6Mm3MCJbEwfZy1Oou5e5P4 FzFYim23q0gQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 May 2020 09:46:00 -0700 IronPort-SDR: 8r3rA3NG89Dj9J4gKRLR1gosHYXjZHZEHjeaYrKZFyjQINU+/seAY5bZSMU4IR79OZcI6qJ/SG QTQoQvkEJlfg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,368,1583222400"; d="scan'208";a="462637775" Received: from silpixa00399752.ir.intel.com (HELO silpixa00399752.ger.corp.intel.com) ([10.237.222.180]) by fmsmga006.fm.intel.com with ESMTP; 08 May 2020 09:45:59 -0700 From: Ferruh Yigit To: Pavan Nikhilesh , Jerin Jacob Cc: dev@dpdk.org, Ferruh Yigit , Thomas Monjalon , David Marchand , Konstantin Ananyev Date: Fri, 8 May 2020 17:45:46 +0100 Message-Id: <20200508164546.2489396-4-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20200508164546.2489396-1-ferruh.yigit@intel.com> References: <20200507120259.2197813-1-ferruh.yigit@intel.com> <20200508164546.2489396-1-ferruh.yigit@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v2 4/4] event/octeontx2: fix build for O1 optimization 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" Can be reproduced with "make EXTRA_CFLAGS='-O1'" command using gcc 7.3.0 Build error In file included from .../drivers/event/octeontx2/ot x2_evdev.c:15:0: .../drivers/event/octeontx2/otx2_evdev_stats.h: In function ‘otx2_sso_xstats_get’: .../drivers/event/octeontx2/otx2_evdev_stats.h:124:9: error: ‘xstats’ may be used uninitialized in this function [-Werror=maybe-uninitialized] xstat = &xstats[ids[i] - start_offset]; ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This is false positive, 'xstats_mode_count' should be preventing taking the loop and accessing 'xstats'. Returning in that case to silence the compiler warning. Reported-by: Konstantin Ananyev Signed-off-by: Ferruh Yigit Tested-by: Konstantin Ananyev Acked-by: Konstantin Ananyev Acked-by: Jerin Jacob --- drivers/event/octeontx2/otx2_evdev_stats.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/event/octeontx2/otx2_evdev_stats.h b/drivers/event/octeontx2/otx2_evdev_stats.h index 9d7c694ee6..74fcec8a07 100644 --- a/drivers/event/octeontx2/otx2_evdev_stats.h +++ b/drivers/event/octeontx2/otx2_evdev_stats.h @@ -67,7 +67,7 @@ otx2_sso_xstats_get(const struct rte_eventdev *event_dev, switch (mode) { case RTE_EVENT_DEV_XSTATS_DEVICE: - break; + return 0; case RTE_EVENT_DEV_XSTATS_PORT: if (queue_port_id >= (signed int)dev->nb_event_ports) goto invalid_value;