From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f47.google.com (mail-pa0-f47.google.com [209.85.220.47]) by dpdk.org (Postfix) with ESMTP id B479C2935 for ; Wed, 23 Mar 2016 20:35:10 +0100 (CET) Received: by mail-pa0-f47.google.com with SMTP id fe3so2894420pab.1 for ; Wed, 23 Mar 2016 12:35:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2pPNZb/pIEC+q/cvngLr+eUGRY81qFkhIYkeTiESv6E=; b=p26k0ziGzSKb6wHuPeFSBg7VNZxJrOk0fufbbcC8g8COJz00mWuxBzLAVarI14n8ga 9qyCj9i98QsfrJoyoEHba4h5/BJhr45BfOOa57OVPu2276nywZi83BTMWgio89FjxxxH bBy5Mzm4Nqh1Tfiy3f4WIZApc3v/kNRoZGHt94HG8AaPVLHB1UcqF6G2gwoMLgZLcwWy CaMl/C+heeSEsWcNvdqYVO0vn0SWmSI8sxG+Su0731OYq/sM2NmrKo1uquQ1aQAq7SA3 9YTVdErTb9LmX98iOQLKwOuLQL+SckHHq8mffWe3gckKDnYeOU9t1imJlReKNgw1OOig D9RA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2pPNZb/pIEC+q/cvngLr+eUGRY81qFkhIYkeTiESv6E=; b=CgujNecrK09HEUZMT+4UiglaD/4E7XPl0GW9m9tyaUVMyLbmwOLjWIL3n7+jcOfey/ Xe80I44YM5RwHeAjsWzHtzqjZMw59K8waYurkcDay2IHUib4LzDIVuTGc815xP5ENFaC QwUexWGj2zCp+nyuslYDwdzeBmw1Iep7zVdMkKXQtQt+ybiv6moyRFjZee49cJxsYKhy h7b3rQCoPoTnx3VzHvwV3jIqwYp76B/k8lSgZZVk2nYHDiq/ArmPZbjqrgeRx52RdUis V8s7qnlIf4kuOKbQW05K1vdoJqrn30rcXBtsHfft2HlsDk2ga+0yQ1rOp2VCa/GghY7c mWsQ== X-Gm-Message-State: AD7BkJJjVu2uBoc8/WAj6taynQcTj3GhWd9IuQSyb0JLaisL5hQb35j88sXZDq4HpglsXw== X-Received: by 10.66.190.168 with SMTP id gr8mr6698783pac.23.1458761710120; Wed, 23 Mar 2016 12:35:10 -0700 (PDT) Received: from xeon-e3 (static-50-53-65-230.bvtn.or.frontiernet.net. [50.53.65.230]) by smtp.gmail.com with ESMTPSA id s64sm5957421pfi.77.2016.03.23.12.35.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Mar 2016 12:35:09 -0700 (PDT) Date: Wed, 23 Mar 2016 12:35:25 -0700 From: Stephen Hemminger To: Ferruh Yigit Cc: dev@dpdk.org Message-ID: <20160323123525.09de2b2f@xeon-e3> In-Reply-To: <1458755158-16145-1-git-send-email-ferruh.yigit@intel.com> References: <1458755158-16145-1-git-send-email-ferruh.yigit@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII 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 19:35:11 -0000 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).