Message ID | 1458755158-16145-1-git-send-email-ferruh.yigit@intel.com (mailing list archive) |
---|---|
State | Rejected, archived |
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 AF746475D; Wed, 23 Mar 2016 18:46:03 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 7520039EA for <dev@dpdk.org>; Wed, 23 Mar 2016 18:46:02 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 23 Mar 2016 10:46:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,383,1455004800"; d="scan'208";a="930341129" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga001.fm.intel.com with ESMTP; 23 Mar 2016 10:46:00 -0700 Received: from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com [10.237.217.46]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id u2NHk0Vi019914; Wed, 23 Mar 2016 17:46:00 GMT Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1]) by sivswdev02.ir.intel.com with ESMTP id u2NHjxGg016180; Wed, 23 Mar 2016 17:45:59 GMT Received: (from fyigit@localhost) by sivswdev02.ir.intel.com with id u2NHjx0D016176; Wed, 23 Mar 2016 17:45:59 GMT From: Ferruh Yigit <ferruh.yigit@intel.com> To: dev@dpdk.org Cc: Ferruh Yigit <ferruh.yigit@intel.com> Date: Wed, 23 Mar 2016 17:45:58 +0000 Message-Id: <1458755158-16145-1-git-send-email-ferruh.yigit@intel.com> X-Mailer: git-send-email 1.7.4.1 Subject: [dpdk-dev] [PATCH] ixgbe: fix icc compile error 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
Ferruh Yigit
March 23, 2016, 5:45 p.m. UTC
Fixes: 06554d381d97 ("ixgbe: speed up non-vector Tx")
icc (icc (ICC) 16.0.1 20151021) is generating following compile error:
"
CC ixgbe_rxtx.o
.../drivers/net/ixgbe/ixgbe_rxtx.c(153): error #3656: variable
"free" may be used before its value is set
(nb_free > 0 && m->pool != free[0]->pool)) {
^
"
Indeed this is a false positive and code is correct.
"nb_free" check prevents the free[] access before its value set.
But the patch is just for compiler to remove compiler error.
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
drivers/net/ixgbe/ixgbe_rxtx.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Comments
On Wed, 23 Mar 2016 17:45:58 +0000 Ferruh Yigit <ferruh.yigit@intel.com> wrote: > Fixes: 06554d381d97 ("ixgbe: speed up non-vector Tx") > > icc (icc (ICC) 16.0.1 20151021) is generating following compile error: > " > CC ixgbe_rxtx.o > .../drivers/net/ixgbe/ixgbe_rxtx.c(153): error #3656: variable > "free" may be used before its value is set > (nb_free > 0 && m->pool != free[0]->pool)) { > ^ > " > > Indeed this is a false positive and code is correct. > "nb_free" check prevents the free[] access before its value set. > > But the patch is just for compiler to remove compiler error. > > Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com> > --- > drivers/net/ixgbe/ixgbe_rxtx.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c > index ff6ddb8..ef1a26f 100644 > --- a/drivers/net/ixgbe/ixgbe_rxtx.c > +++ b/drivers/net/ixgbe/ixgbe_rxtx.c > @@ -128,7 +128,8 @@ ixgbe_tx_free_bufs(struct ixgbe_tx_queue *txq) > struct ixgbe_tx_entry *txep; > uint32_t status; > int i, nb_free = 0; > - struct rte_mbuf *m, *free[RTE_IXGBE_TX_MAX_FREE_BUF_SZ]; > + struct rte_mbuf *m; > + struct rte_mbuf *free[RTE_IXGBE_TX_MAX_FREE_BUF_SZ] = {0}; > > /* check DD bit on threshold descriptor */ > status = txq->tx_ring[txq->tx_next_dd].wb.status; Although this fixes a compiler bug, it also introduces a performance hit. The initialization will generate a string instruct (rep; stosz) and this stalls the multi-execution unit on many Intel CPU's. Better to add a override to the Makefile (for icc only and with big comment).
On 3/23/2016 7:35 PM, Stephen Hemminger wrote: > On Wed, 23 Mar 2016 17:45:58 +0000 > Ferruh Yigit <ferruh.yigit@intel.com> wrote: > >> Fixes: 06554d381d97 ("ixgbe: speed up non-vector Tx") >> >> icc (icc (ICC) 16.0.1 20151021) is generating following compile error: >> " >> CC ixgbe_rxtx.o >> .../drivers/net/ixgbe/ixgbe_rxtx.c(153): error #3656: variable >> "free" may be used before its value is set >> (nb_free > 0 && m->pool != free[0]->pool)) { >> ^ >> " >> >> Indeed this is a false positive and code is correct. >> "nb_free" check prevents the free[] access before its value set. >> >> But the patch is just for compiler to remove compiler error. >> >> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com> >> --- >> drivers/net/ixgbe/ixgbe_rxtx.c | 3 ++- >> 1 file changed, 2 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c >> index ff6ddb8..ef1a26f 100644 >> --- a/drivers/net/ixgbe/ixgbe_rxtx.c >> +++ b/drivers/net/ixgbe/ixgbe_rxtx.c >> @@ -128,7 +128,8 @@ ixgbe_tx_free_bufs(struct ixgbe_tx_queue *txq) >> struct ixgbe_tx_entry *txep; >> uint32_t status; >> int i, nb_free = 0; >> - struct rte_mbuf *m, *free[RTE_IXGBE_TX_MAX_FREE_BUF_SZ]; >> + struct rte_mbuf *m; >> + struct rte_mbuf *free[RTE_IXGBE_TX_MAX_FREE_BUF_SZ] = {0}; >> >> /* check DD bit on threshold descriptor */ >> status = txq->tx_ring[txq->tx_next_dd].wb.status; > > Although this fixes a compiler bug, it also introduces a performance hit. > The initialization will generate a string instruct (rep; stosz) and this > stalls the multi-execution unit on many Intel CPU's. > > Better to add a override to the Makefile (for icc only and with big comment). > Thank you for the comment. Konstantin also expressed similar performance concern related this patch. Nack for the patch, we will look for different solution. Regards, ferruh
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c index ff6ddb8..ef1a26f 100644 --- a/drivers/net/ixgbe/ixgbe_rxtx.c +++ b/drivers/net/ixgbe/ixgbe_rxtx.c @@ -128,7 +128,8 @@ ixgbe_tx_free_bufs(struct ixgbe_tx_queue *txq) struct ixgbe_tx_entry *txep; uint32_t status; int i, nb_free = 0; - struct rte_mbuf *m, *free[RTE_IXGBE_TX_MAX_FREE_BUF_SZ]; + struct rte_mbuf *m; + struct rte_mbuf *free[RTE_IXGBE_TX_MAX_FREE_BUF_SZ] = {0}; /* check DD bit on threshold descriptor */ status = txq->tx_ring[txq->tx_next_dd].wb.status;