From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wg0-f50.google.com (mail-wg0-f50.google.com [74.125.82.50]) by dpdk.org (Postfix) with ESMTP id E9A86803A for ; Thu, 4 Dec 2014 16:15:32 +0100 (CET) Received: by mail-wg0-f50.google.com with SMTP id k14so22864554wgh.37 for ; Thu, 04 Dec 2014 07:15:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=te3hsT6Fkw73Ie1pNMT1KxM0/vjcAAYy5qjXTADIiIg=; b=j2QIED5ECgZKkk1ysMM8bHc3ZLxsoDX1BMXGqZA9GNQA7lyqHHX3bClfxZaGxRXrrF aUC8sgyic3lVVa/7Kz7PPD0q90ZJ9HHumyMJ8M6+tp+fluLdwt7w0BT97xKRdSixZbSu w1Coqcoa6qQINOe0q9TLbNKN6RkartT5xOFGj1UkKNIxCdd5SBCEMTsi34F3R9U/MPzc QLNM3zwOsgETnYovOkGNfZ6Eeuy0q7098ZwtHRi1AjP4KvX4u9KbcBeb3Tv2Do19xkq/ WsZJa4khadk9u/HOukLr/c3vVL4doGomd0F4QegoDp6oBHQQbtwCuRFNOstmlyP6kqbV YBTA== X-Gm-Message-State: ALoCoQkhkZiFuwVjDtJn/5y1FFLbKtlkSJcUe7vnKCj7fLSSA5HisRt40/c7JDZebhRqOViHUUN3 X-Received: by 10.194.121.129 with SMTP id lk1mr15959391wjb.99.1417706132765; Thu, 04 Dec 2014 07:15:32 -0800 (PST) Received: from [192.168.0.8] (crb44-1-82-67-127-5.fbx.proxad.net. [82.67.127.5]) by mx.google.com with ESMTPSA id l10sm55340791wif.20.2014.12.04.07.15.32 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 04 Dec 2014 07:15:32 -0800 (PST) Message-ID: <54807A91.7050805@6wind.com> Date: Thu, 04 Dec 2014 16:15:29 +0100 From: Jean-Mickael Guerin User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: "Ananyev, Konstantin" , "Richardson, Bruce" References: <1417703181-23093-1-git-send-email-jean-mickael.guerin@6wind.com> <1417703181-23093-2-git-send-email-jean-mickael.guerin@6wind.com> <20141204143930.GA9300@bricha3-MOBL3> <2601191342CEEE43887BDE71AB977258213BCA09@IRSMSX105.ger.corp.intel.com> In-Reply-To: <2601191342CEEE43887BDE71AB977258213BCA09@IRSMSX105.ger.corp.intel.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH 1/2] ixgbe: fix setup of mbuf initializer template 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: Thu, 04 Dec 2014 15:15:33 -0000 On 04/12/2014 15:42, Ananyev, Konstantin wrote: > > >> -----Original Message----- >> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bruce Richardson >> Sent: Thursday, December 04, 2014 2:40 PM >> To: Jean-Mickael Guerin >> Cc: dev@dpdk.org >> Subject: Re: [dpdk-dev] [PATCH 1/2] ixgbe: fix setup of mbuf initializer template >> >> On Thu, Dec 04, 2014 at 03:26:20PM +0100, Jean-Mickael Guerin wrote: >>> Add a compiler barrier to make sure all fields covered by >>> the marker rearm_data are assigned before the read. >>> >>> Signed-off-by: Jean-Mickael Guerin >>> Acked-by: David Marchand >>> Fixes: 0ff3324da2 ("ixgbe: rework vector pmd following mbuf changes") >> >> Acked-by: Bruce Richardson >> >>> --- >>> lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c | 3 +++ >>> 1 file changed, 3 insertions(+) >>> >>> diff --git a/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c b/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c >>> index 579bc46..c1b5a78 100644 >>> --- a/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c >>> +++ b/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c >>> @@ -739,6 +739,9 @@ ixgbe_rxq_vec_setup(struct igb_rx_queue *rxq) >>> mb_def.buf_len = rxq->mb_pool->elt_size - sizeof(struct rte_mbuf); >>> mb_def.port = rxq->port_id; >>> rte_mbuf_refcnt_set(&mb_def, 1); >>> + >>> + /* prevent compiler reordering: rearm_data covers previous fields */ >>> + rte_compiler_barrier(); >>> rxq->mbuf_initializer = *((uint64_t *)&mb_def.rearm_data); >>> return 0; >>> } >>> -- > > Hmm, can someone explain to me why do we need a compiler barrier here? > Konstantin rearm_data is a separate field and as well an array of length zero, overlapping on purpose the fields data_off buf_len, port, refcnt. It might depend on compiler, but I could see a wrong value of 0UL for mbuf_initializer without the barrier (gcc 4.4.6). > >>> 2.1.3 >>>