From patchwork Wed Mar 11 11:32:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kevin Traynor X-Patchwork-Id: 66540 X-Patchwork-Delegate: david.marchand@redhat.com 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 B0ABFA056A; Wed, 11 Mar 2020 12:33:34 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6A62A1BFFF; Wed, 11 Mar 2020 12:33:34 +0100 (CET) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by dpdk.org (Postfix) with ESMTP id 3092E1BF7F for ; Wed, 11 Mar 2020 12:33:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583926412; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Qk5assWfbKkki1Tg5CStepOFLd3arkdOKV6/fZDON48=; b=CgGtdy5Dz3ySXCyhl7OnJBLjwJCVLmBa5Tnp7epsFblugJkUfbGKlOfqEmikwFyWOPGHbC BiKd92tzGVkd8oS28zvPAZtkJrcOdbfWGdRRuJNklraW2zWzKXJC5oJtQ8Swqr1V3MozRv 8J83WcbW3jSM56Zk3h1YTAVDEtGLXlk= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-60-HQsKhyjxPcmeJkVxqE7zfw-1; Wed, 11 Mar 2020 07:33:25 -0400 X-MC-Unique: HQsKhyjxPcmeJkVxqE7zfw-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0A356184C81D; Wed, 11 Mar 2020 11:33:24 +0000 (UTC) Received: from rh.redhat.com (unknown [10.33.36.148]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9439C60C88; Wed, 11 Mar 2020 11:33:17 +0000 (UTC) From: Kevin Traynor To: dev@dpdk.org Cc: Kevin Traynor , stable@dpdk.org, allain.legacy@windriver.com, Steven Webster , Matt Peters Date: Wed, 11 Mar 2020 11:32:59 +0000 Message-Id: <20200311113300.32487-1-ktraynor@redhat.com> In-Reply-To: <20200220093744.13925-1-ktraynor@redhat.com> References: <20200220093744.13925-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [dpdk-dev] [PATCH v2 1/2] net/avp: fix gcc 10 maybe-uninitialized warning 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" gcc 10.0.1 reports: ../drivers/net/avp/avp_ethdev.c: In function ‘avp_xmit_scattered_pkts’: ../drivers/net/avp/avp_ethdev.c:1791:24: warning: ‘avp_bufs[count]’ may be used uninitialized in this function [-Wmaybe-uninitialized] 1791 | tx_bufs[i] = avp_bufs[count]; | ~~~~~~~~^~~~~~~ ../drivers/net/avp/avp_ethdev.c:1791:24: warning: ‘avp_bufs[count]’ may be used uninitialized in this function [-Wmaybe-uninitialized] Fix by intializing the array. Fixes: 295abce2d25b ("net/avp: add packet transmit functions") Cc: stable@dpdk.org Signed-off-by: Kevin Traynor Acked-by: Steven Webster --- v2: no change note, commit log violates line length but I didn't want to split warning msg. Cc: allain.legacy@windriver.com Cc: Steven Webster Cc: Matt Peters --- drivers/net/avp/avp_ethdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/avp/avp_ethdev.c b/drivers/net/avp/avp_ethdev.c index cd747b6be..1abe96ce5 100644 --- a/drivers/net/avp/avp_ethdev.c +++ b/drivers/net/avp/avp_ethdev.c @@ -1695,5 +1695,5 @@ avp_xmit_scattered_pkts(void *tx_queue, { struct rte_avp_desc *avp_bufs[(AVP_MAX_TX_BURST * - RTE_AVP_MAX_MBUF_SEGMENTS)]; + RTE_AVP_MAX_MBUF_SEGMENTS)] = {}; struct avp_queue *txq = (struct avp_queue *)tx_queue; struct rte_avp_desc *tx_bufs[AVP_MAX_TX_BURST]; From patchwork Wed Mar 11 11:33:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kevin Traynor X-Patchwork-Id: 66541 X-Patchwork-Delegate: david.marchand@redhat.com 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 E9B9DA056A; Wed, 11 Mar 2020 12:33:42 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 24A591C012; Wed, 11 Mar 2020 12:33:37 +0100 (CET) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by dpdk.org (Postfix) with ESMTP id 33C2D1C00E for ; Wed, 11 Mar 2020 12:33:35 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583926414; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=h9S7Wc0/Cv5kWclwzkqdXFMI7SKEfSAISpVGboMLZCc=; b=Sy5jb9hNLnyTnIyVXAz165uRt2nUY2R5nhV3mLqnHzptd5nn2SGVAEHNJRs+0jzmvBWLjv lDkfLp22JMt6MGsSQlu0TtTNQIZTfH7zR+EenWChfS6CtnSVlYhp9fynA2uEUtveCJ3+NN TlVAzd7IeZ9Q7UXLzgSVp0PlFj3/8QQ= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-221-El2dPh4tPqK5Ypn0C8HUYA-1; Wed, 11 Mar 2020 07:33:33 -0400 X-MC-Unique: El2dPh4tPqK5Ypn0C8HUYA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CFCF6802683; Wed, 11 Mar 2020 11:33:31 +0000 (UTC) Received: from rh.redhat.com (unknown [10.33.36.148]) by smtp.corp.redhat.com (Postfix) with ESMTP id 028EF60BF4; Wed, 11 Mar 2020 11:33:26 +0000 (UTC) From: Kevin Traynor To: dev@dpdk.org Cc: Kevin Traynor , stable@dpdk.org, Konstantin Ananyev , Radu Nicolau , Akhil Goyal Date: Wed, 11 Mar 2020 11:33:00 +0000 Message-Id: <20200311113300.32487-2-ktraynor@redhat.com> In-Reply-To: <20200311113300.32487-1-ktraynor@redhat.com> References: <20200220093744.13925-1-ktraynor@redhat.com> <20200311113300.32487-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [dpdk-dev] [PATCH v2 2/2] examples/ipsec-gw: fix gcc 10 maybe-uninitialized warning 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" gcc 10.0.1 reports: ../examples/ipsec-secgw/ipsec_process.c: In function ‘ipsec_process’: ../examples/ipsec-secgw/ipsec_process.c:132:34: error: ‘grp.m’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 132 | grp[n].cnt = pkts + i - grp[n].m; | ~~~~~~^~ This is a correct warning for the initial execution of the statement. However, it is the design of the loop that grp[0].cnt will later be written with the correct value using an initialized grp[0].m before it is used. In order to remove the warning, initialize grp[0].m for the initial and unused calculation of grp[0].cnt. Fixes: 3e5f4625dc17 ("examples/ipsec-secgw: make data-path to use IPsec library") Cc: stable@dpdk.org Suggested-by: Konstantin Ananyev Signed-off-by: Kevin Traynor Acked-by: Konstantin Ananyev --- v2: just initialize grp[0].m instead of the full array. note, commit log violates line length but I didn't want to split warning msg. Cc: konstantin.ananyev@intel.com Cc: Radu Nicolau Cc: Akhil Goyal --- examples/ipsec-secgw/ipsec_process.c | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/ipsec-secgw/ipsec_process.c b/examples/ipsec-secgw/ipsec_process.c index bb2f2b82d..6d3a3c9a1 100644 --- a/examples/ipsec-secgw/ipsec_process.c +++ b/examples/ipsec-secgw/ipsec_process.c @@ -127,4 +127,5 @@ sa_group(void *sa_ptr[], struct rte_mbuf *pkts[], sa = nosa; + grp[0].m = pkts; for (i = 0, n = 0; i != num; i++) {