Message ID | 20191029141212.4907-11-aostruszka@marvell.com (mailing list archive) |
---|---|
State | Superseded, archived |
Delegated to: | Thomas Monjalon |
Headers |
Return-Path: <dev-bounces@dpdk.org> 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 71FE7A00BE; Tue, 29 Oct 2019 15:13:54 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 464271BF70; Tue, 29 Oct 2019 15:12:46 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 5BB641BF50 for <dev@dpdk.org>; Tue, 29 Oct 2019 15:12:39 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x9TE0SFi020533; Tue, 29 Oct 2019 07:12:38 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=pfpt0818; bh=D81CQAI19s7DZkJJhi+P3sRqOsN3QBMZIMIHbidIu8I=; b=DivzmNpx+jaakoa7BHymjyzxiKTvTpBnf9YsnxNkc69l8cPlEYoPMJfPozOzyhu+r8k1 6o4wF3oCuwQvB3qu+19AFDuBcx20wOTSt2wsT3nb5IbjhvtiFjzHMR+8w+6z/H9UKdjz XGbfjhYHzEqESGuhV2i3BmEmE1yijtJSEQBiCmH/E/K+34h+HACfwIMcG7/FPF7DDMAF eievJgTV0KIGky4K6I21I7ooRp99AgJeRvz6X44oe1u/0El5IN1GNJDvE6MgwaISrIPn KKu/700ovVwpWjqSvgYULYCTw1Rw7a1ej5yUTueHzIc4b7oP4qSB6eVdBWhF2jDFiHvs 7w== Received: from sc-exch01.marvell.com ([199.233.58.181]) by mx0b-0016f401.pphosted.com with ESMTP id 2vvnnp1p42-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 29 Oct 2019 07:12:38 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 29 Oct 2019 07:12:36 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Tue, 29 Oct 2019 07:12:36 -0700 Received: from amok.marvell.com (unknown [10.95.130.126]) by maili.marvell.com (Postfix) with ESMTP id 40A983F703F; Tue, 29 Oct 2019 07:12:35 -0700 (PDT) From: Andrzej Ostruszka <aostruszka@marvell.com> To: <dev@dpdk.org>, Beilei Xing <beilei.xing@intel.com>, Qi Zhang <qi.z.zhang@intel.com> CC: <mattias.ronnblom@ericsson.com>, <stephen@networkplumber.org> Date: Tue, 29 Oct 2019 15:12:10 +0100 Message-ID: <20191029141212.4907-11-aostruszka@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191029141212.4907-1-aostruszka@marvell.com> References: <20191028142145.3758-1-aostruszka@marvell.com> <20191029141212.4907-1-aostruszka@marvell.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,1.0.8 definitions=2019-10-29_04:2019-10-28,2019-10-29 signatures=0 Subject: [dpdk-dev] [PATCH v6 10/12] net/i40e: clean LTO build warnings (maybe-uninitialized) X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions <dev.dpdk.org> List-Unsubscribe: <https://mails.dpdk.org/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://mails.dpdk.org/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <https://mails.dpdk.org/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Series |
Add an option to use LTO for DPDK build
|
|
Checks
Context | Check | Description |
---|---|---|
ci/Intel-compilation | fail | Compilation issues |
ci/checkpatch | success | coding style OK |
Commit Message
Andrzej Ostruszka [C]
Oct. 29, 2019, 2:12 p.m. UTC
During LTO build compiler reports some 'false positive' warnings about
variables being possibly used uninitialized. This patch silences these
warnings.
Exemplary compiler warning to suppress (with LTO enabled):
error: ‘filter_idx’ may be used uninitialized in this function
[-Werror=maybe-uninitialized]
PMD_DRV_LOG(INFO, "Added port %d with AQ command with index %d",
Signed-off-by: Andrzej Ostruszka <aostruszka@marvell.com>
---
drivers/net/i40e/i40e_ethdev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
> -----Original Message----- > From: Andrzej Ostruszka [mailto:aostruszka@marvell.com] > Sent: Tuesday, October 29, 2019 10:12 PM > To: dev@dpdk.org; Xing, Beilei <beilei.xing@intel.com>; Zhang, Qi Z > <qi.z.zhang@intel.com> > Cc: mattias.ronnblom@ericsson.com; stephen@networkplumber.org > Subject: [PATCH v6 10/12] net/i40e: clean LTO build warnings (maybe- > uninitialized) > > During LTO build compiler reports some 'false positive' warnings about > variables being possibly used uninitialized. This patch silences these warnings. > > Exemplary compiler warning to suppress (with LTO enabled): > error: ‘filter_idx’ may be used uninitialized in this function [-Werror=maybe- > uninitialized] > PMD_DRV_LOG(INFO, "Added port %d with AQ command with index %d", Hi, Thanks for the patch. Please also add fix line here and Cc stable. > > Signed-off-by: Andrzej Ostruszka <aostruszka@marvell.com> > --- > 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 77a46832c..91d529b2f 100644 > --- a/drivers/net/i40e/i40e_ethdev.c > +++ b/drivers/net/i40e/i40e_ethdev.c > @@ -8480,7 +8480,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); > -- > 2.17.1
Beilei Thank you for the comment, please see below. On 11/1/19 3:05 AM, Xing, Beilei wrote: >> -----Original Message----- >> From: Andrzej Ostruszka [mailto:aostruszka@marvell.com] [...] >> Subject: [PATCH v6 10/12] net/i40e: clean LTO build warnings (maybe- >> uninitialized) >> >> During LTO build compiler reports some 'false positive' warnings about >> variables being possibly used uninitialized. This patch silences these warnings. >> >> Exemplary compiler warning to suppress (with LTO enabled): >> error: ‘filter_idx’ may be used uninitialized in this function [-Werror=maybe- >> uninitialized] >> PMD_DRV_LOG(INFO, "Added port %d with AQ command with index %d", > > Hi, > > Thanks for the patch. Please also add fix line here and Cc stable. Are you saying that there is actually a problem in the code? IMHO the code is fine and this patch just prevents gcc from issuing a false warning. What I think is going on is that gcc looks into i40e_aq_add_udp_tunnel() and sees that filter_idx is updated under condition "if (!status ..." and figures out that if status is positive then filter_idx could be used uninitialized because in the calling function we test "if (ret < 0)". However it fails to take into account the actual enum definition (only non-positive values) and the implementation of i40e_asq_send_command(). So, if this is only work-around for the gcc deficiency, then I would prefer to not add any fixline and to not pull that patch into stable. Please let me know what you think. Regards Andrzej
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 77a46832c..91d529b2f 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -8480,7 +8480,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);