Message ID | 1466774284-20932-23-git-send-email-nelio.laranjeiro@6wind.com (mailing list archive) |
---|---|
State | Accepted, archived |
Delegated to: | Bruce Richardson |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 48CA3C758; Fri, 24 Jun 2016 15:19:53 +0200 (CEST) Received: from mail-wm0-f46.google.com (mail-wm0-f46.google.com [74.125.82.46]) by dpdk.org (Postfix) with ESMTP id 0DEC2C75C for <dev@dpdk.org>; Fri, 24 Jun 2016 15:19:23 +0200 (CEST) Received: by mail-wm0-f46.google.com with SMTP id a66so25276586wme.0 for <dev@dpdk.org>; Fri, 24 Jun 2016 06:19:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ADsvkSchWD9K7hVhrNLAS62RLEF11RWRDrGcaCuqGCc=; b=pW2CNGYzcVqQey9GJzEzcJFc6ZGrBTIFd3hjWGSPmWUp230mrsGPdmb9zkIF2A282o GA1BDDF7E9z3NnjeLdrgl+GI3jDWYLo82Jk5DOtfDZ3Y6Njc5Q+bZEQ75nBUkyguKnmo +cdD3E+DTAfsoCW8uVMbp7EdbP9FsWpUbGUABYHODY5EW5LUBfLomjEJjnC2cQ7/QADP eIJZW44XVoRy7mcBgXT6NOwth3nOulByReG6VkUvm1+TqlATAe+pWEy7EQ5Y1nOZ222r buTP0CJuJ9qLTccvyz+YobRoD9r9TiXxHGV7GRvkFCvTV+FYE/aYRG/vzlbCYTtZ0OFF S6rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ADsvkSchWD9K7hVhrNLAS62RLEF11RWRDrGcaCuqGCc=; b=CJ44z31rRxyDrhagRrF9tcJG4Rivm/f2SiSL7optN1Jz+wslqlcXtLjU70SmYF5a/w HYicvvoptTC2R28+bqKPp7SiiX05KSiVEHX6KckTcaV4KTUPO+Ls7om9oQRMJgHbTYt6 ByDzz9F85Yw6NMuhR7WsVRiULMUNUsGJjbghqVg4R4EvA37ZWPd4/GYHo+ibUcxLczey z7xxasXD7PlGO29sBysQl+Va9Qaj95j94vg/z/a2HvdSfOcC7IvkP/sgc8PzHNQJmFHo BWO1qJMXvHTvqQgStbgVmedi8TFxizuGEi6J+7+J/FuhFanN19sFU/i+mWyd18z7vQFd HP8w== X-Gm-Message-State: ALyK8tLew14GNs5TfmdjSHTUUwqes+PB0MkAIvaJRXYxHiJ29N5QwrfyCOiUDp8a+mdzJpto X-Received: by 10.194.101.41 with SMTP id fd9mr3793009wjb.27.1466774362825; Fri, 24 Jun 2016 06:19:22 -0700 (PDT) Received: from ping.vm.6wind.com (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by smtp.gmail.com with ESMTPSA id m125sm1279533wmm.8.2016.06.24.06.19.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 24 Jun 2016 06:19:22 -0700 (PDT) From: Nelio Laranjeiro <nelio.laranjeiro@6wind.com> To: dev@dpdk.org Cc: Bruce Richardson <bruce.richardson@intel.com>, Ferruh Yigit <ferruh.yigit@intel.com>, Adrien Mazarguil <adrien.mazarguil@6wind.com> Date: Fri, 24 Jun 2016 15:18:01 +0200 Message-Id: <1466774284-20932-23-git-send-email-nelio.laranjeiro@6wind.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1466774284-20932-1-git-send-email-nelio.laranjeiro@6wind.com> References: <1466758261-25986-1-git-send-email-nelio.laranjeiro@6wind.com> <1466774284-20932-1-git-send-email-nelio.laranjeiro@6wind.com> Subject: [dpdk-dev] [PATCH v7 22/25] mlx5: work around spurious compilation errors X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK <dev.dpdk.org> List-Unsubscribe: <http://dpdk.org/ml/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://dpdk.org/ml/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <http://dpdk.org/ml/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Commit Message
NĂ©lio Laranjeiro
June 24, 2016, 1:18 p.m. UTC
From: Adrien Mazarguil <adrien.mazarguil@6wind.com> Since commit "mlx5: resurrect Tx gather support", older GCC versions (such as 4.8.5) may complain about the following: mlx5_rxtx.c: In function `mlx5_tx_burst': mlx5_rxtx.c:705:25: error: `wqe' may be used uninitialized in this function [-Werror=maybe-uninitialized] mlx5_rxtx.c: In function `mlx5_tx_burst_inline': mlx5_rxtx.c:864:25: error: `wqe' may be used uninitialized in this function [-Werror=maybe-uninitialized] In both cases, this code cannot be reached when wqe is not initialized. Considering older GCC versions are still widely used, work around this issue by initializing wqe preemptively, even if it should not be necessary. Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com> --- drivers/net/mlx5/mlx5_rxtx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Comments
On Fri, Jun 24, 2016 at 03:18:01PM +0200, Nelio Laranjeiro wrote: > From: Adrien Mazarguil <adrien.mazarguil@6wind.com> > > Since commit "mlx5: resurrect Tx gather support", older GCC versions (such > as 4.8.5) may complain about the following: > > mlx5_rxtx.c: In function `mlx5_tx_burst': > mlx5_rxtx.c:705:25: error: `wqe' may be used uninitialized in this > function [-Werror=maybe-uninitialized] > > mlx5_rxtx.c: In function `mlx5_tx_burst_inline': > mlx5_rxtx.c:864:25: error: `wqe' may be used uninitialized in this > function [-Werror=maybe-uninitialized] > > In both cases, this code cannot be reached when wqe is not initialized. > > Considering older GCC versions are still widely used, work around this > issue by initializing wqe preemptively, even if it should not be necessary. > > Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com> Since the previous patch is known to break the build on older compilers, I think it would be better to merge this patch into the previous to prevent the break from occurring in the first place. That will help with any future git-bisects that people run. If there is no objection, and no other issues appear requiring a new rev of this patchset, I'll merge patches 21 and 22 on apply. Regards, /Bruce
On Mon, Jun 27, 2016 at 01:12:15PM +0100, Bruce Richardson wrote: > On Fri, Jun 24, 2016 at 03:18:01PM +0200, Nelio Laranjeiro wrote: > > From: Adrien Mazarguil <adrien.mazarguil@6wind.com> > > > > Since commit "mlx5: resurrect Tx gather support", older GCC versions (such > > as 4.8.5) may complain about the following: > > > > mlx5_rxtx.c: In function `mlx5_tx_burst': > > mlx5_rxtx.c:705:25: error: `wqe' may be used uninitialized in this > > function [-Werror=maybe-uninitialized] > > > > mlx5_rxtx.c: In function `mlx5_tx_burst_inline': > > mlx5_rxtx.c:864:25: error: `wqe' may be used uninitialized in this > > function [-Werror=maybe-uninitialized] > > > > In both cases, this code cannot be reached when wqe is not initialized. > > > > Considering older GCC versions are still widely used, work around this > > issue by initializing wqe preemptively, even if it should not be necessary. > > > > Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com> > > Since the previous patch is known to break the build on older compilers, I think > it would be better to merge this patch into the previous to prevent the break > from occurring in the first place. That will help with any future git-bisects > that people run. Makes sense, in fact I only kept it separate to decribe why setting these variables was necessary, in case someone wondered. > If there is no objection, and no other issues appear requiring a new rev of > this patchset, I'll merge patches 21 and 22 on apply. That's fine by me.
diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c index c72e7ce..8b67949 100644 --- a/drivers/net/mlx5/mlx5_rxtx.c +++ b/drivers/net/mlx5/mlx5_rxtx.c @@ -593,7 +593,7 @@ mlx5_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n) unsigned int j = 0; unsigned int max; unsigned int comp; - volatile union mlx5_wqe *wqe; + volatile union mlx5_wqe *wqe = NULL; if (unlikely(!pkts_n)) return 0; @@ -741,7 +741,7 @@ mlx5_tx_burst_inline(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n) unsigned int j = 0; unsigned int max; unsigned int comp; - volatile union mlx5_wqe *wqe; + volatile union mlx5_wqe *wqe = NULL; unsigned int max_inline = txq->max_inline; if (unlikely(!pkts_n))