From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH v1 5/5] ixgbe: Add LRO support Date: Wed, 04 Mar 2015 10:05:34 +0200 Message-ID: <54F6BCCE.80602@cloudius-systems.com> References: <1425412123-5227-1-git-send-email-vladz@cloudius-systems.com> <1425412123-5227-6-git-send-email-vladz@cloudius-systems.com> <20150303163359.2975c702@urahara> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: dev-VfR2kkLFssw@public.gmane.org To: Stephen Hemminger , Vlad Zolotarov Return-path: In-Reply-To: <20150303163359.2975c702@urahara> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" On 03/04/2015 02:33 AM, Stephen Hemminger wrote: > On Tue, 3 Mar 2015 21:48:43 +0200 > Vlad Zolotarov wrote: > >> + * TODO: >> + * - Get rid of "volatile" crap and let the compiler do its >> + * job. >> + * - Use the proper memory barrier (rte_rmb()) to ensure the >> + * memory ordering below. > This comment screams "this is broken". > Why not get proper architecture independent barriers in DPDK first. C11 has arch independent memory barriers, so this can be as simple as -std=gnu11 (default in gcc 5, anyway). Not only do we get the barriers for free, but they are also properly integrated with the compiler, so for example a release barrier won't stop the compiler from hoisting a later accesses to before the store, or cause spurious reloads, due to the memory clobber.