From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 353AC2BA8 for ; Wed, 23 Mar 2016 22:26:42 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP; 23 Mar 2016 14:26:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,383,1455004800"; d="scan'208";a="917477536" Received: from slecler1-mobl1.ger.corp.intel.com (HELO [10.252.26.15]) ([10.252.26.15]) by orsmga001.jf.intel.com with ESMTP; 23 Mar 2016 14:26:39 -0700 To: Stephen Hemminger References: <1458755158-16145-1-git-send-email-ferruh.yigit@intel.com> <20160323123525.09de2b2f@xeon-e3> Cc: dev@dpdk.org From: Ferruh Yigit Message-ID: <56F30A0C.5010207@intel.com> Date: Wed, 23 Mar 2016 21:26:36 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <20160323123525.09de2b2f@xeon-e3> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 21:26:42 -0000 On 3/23/2016 7:35 PM, Stephen Hemminger wrote: > On Wed, 23 Mar 2016 17:45:58 +0000 > Ferruh Yigit 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 >> --- >> 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