From owner-freebsd-arm@FreeBSD.ORG Sat Mar 21 14:16:24 2015 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8D6A273F for ; Sat, 21 Mar 2015 14:16:24 +0000 (UTC) Received: from relay.mailchannels.net (si-002-i157.relay.mailchannels.net [108.178.49.169]) by mx1.freebsd.org (Postfix) with ESMTP id ABF2EBC9 for ; Sat, 21 Mar 2015 14:16:23 +0000 (UTC) X-Sender-Id: duocircle|x-authuser|hippie Received: from smtp5.ore.mailhop.org (ip-10-33-12-218.us-west-2.compute.internal [10.33.12.218]) by relay.mailchannels.net (Postfix) with ESMTPA id F0D89A05D6; Sat, 21 Mar 2015 13:58:48 +0000 (UTC) X-Sender-Id: duocircle|x-authuser|hippie Received: from smtp5.ore.mailhop.org (smtp5.ore.mailhop.org [10.45.8.167]) (using TLSv1 with cipher DHE-RSA-AES256-SHA) by 0.0.0.0:2500 (trex/5.4.8); Sat, 21 Mar 2015 13:58:49 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: duocircle|x-authuser|hippie X-MailChannels-Auth-Id: duocircle X-MC-Loop-Signature: 1426946329058:796935100 X-MC-Ingress-Time: 1426946329057 Received: from c-73-34-117-227.hsd1.co.comcast.net ([73.34.117.227] helo=ilsoft.org) by smtp5.ore.mailhop.org with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.82) (envelope-from ) id 1YZJvK-0005FB-Ob; Sat, 21 Mar 2015 13:58:46 +0000 Received: from revolution.hippie.lan (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id t2LDwh3s034937; Sat, 21 Mar 2015 07:58:43 -0600 (MDT) (envelope-from ian@freebsd.org) X-Mail-Handler: DuoCircle Outbound SMTP X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@duocircle.com (see https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information for abuse reporting information) X-MHO-User: U2FsdGVkX1+FkWYyFRGagXl4aXkkRCfU Message-ID: <1426946323.20654.12.camel@freebsd.org> Subject: Re: current meaning of BUS_DMA_COHERENT From: Ian Lepore To: John Wehle Date: Sat, 21 Mar 2015 07:58:43 -0600 In-Reply-To: <201503210131.t2L1VrAx012383@jwlab.FEITH.COM> References: <201503210131.t2L1VrAx012383@jwlab.FEITH.COM> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.12.10 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-AuthUser: hippie Cc: freebsd-arm@freebsd.org X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Mar 2015 14:16:24 -0000 On Fri, 2015-03-20 at 21:31 -0400, John Wehle wrote: > On Mar 20, 2015, at 8:27 AM, Ian Lepore wrote: > > The main problem is shared concurrent-access memory, such as buffer > > descriptor rings which are accessed simultaneously by the cpu and > > network hardware. (The same thing happens with other hardware, but NICs > > are the prime example of it.) > > ... > > What we really need is a new type of busdma memory (BUS_DMA_DESCRIPTOR) > > and a special sync call to use in conjunction with it that takes an > > offset and length, and the sync is a single operation, no pre/post > > stuff. > > If you have descriptor A being modified by the device at the same time > descriptor B is modified by the CPU and they are in the same cache line > you'll still have problems even with a sync call which takes an offset > and length. > Not if the memory is uncached, which shared-descriptor memory must necessarily be on the arm systems we currently support. Just because it's uncached doesn't mean you need no sync ops, though. In particular, you likely still need some sort of drain-write-buffer action and/or memory barrier operations. > Doesn't being able to sync individual descriptors also require padding the > descriptor size so it's a multiple of the cache line size? Typically the descriptor size and packing into an array or ring structure is dictated by the hardware and you're not free to change it. -- Ian