From owner-freebsd-arm@FreeBSD.ORG Sat Mar 21 12:05:28 2015 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B869CD8 for ; Sat, 21 Mar 2015 12:05:28 +0000 (UTC) Received: from mail-pd0-f182.google.com (mail-pd0-f182.google.com [209.85.192.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 82593E07 for ; Sat, 21 Mar 2015 12:05:28 +0000 (UTC) Received: by pdbcz9 with SMTP id cz9so134753539pdb.3 for ; Sat, 21 Mar 2015 05:05:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:mime-version:content-type:from :in-reply-to:date:cc:message-id:references:to; bh=n4ndCxMh7kyj7LIiTeHTvXlypZY/MHgvoYRfEgupwb0=; b=lNnqcHPEJ1bCfFY+NH5aXLXBcLInLrV9vcW5S3fQf1BYydPNWq2UZAbzezz1/D1Bxi RXNLVH3h549mqdqCZMkr5LsjF1g2Ri6ZRTTxnXnB2CTk2hX5lszcQ2MrwH7IZZMVZdVK gZ660d2JSNAzKypPU6KjXdD+hN7DB4DkjrUEgmHRA8gnjMFbWKj8kgMpZfP5H61ZG5Jc NG3yw7NbQbAwHz5UAR0QLpRbeZav2S1TqonETEDAkhUmnlnvZrKGHJ7Kqais1ceUhNJL cywsZxjAgpmaKXXyzvcgeGhaAgKPnFLduGJpJiLZH+CAqRh/HgZ/7xGPItwr7x9spvNQ HtIg== X-Gm-Message-State: ALoCoQmM3Nwdu5d5DRih3oSHqJeCn4d9r0QQW62raUkBL8y3D4oJ6/lSSL5AAdixYoFd9ykMhpWj X-Received: by 10.70.35.193 with SMTP id k1mr185484132pdj.46.1426939522674; Sat, 21 Mar 2015 05:05:22 -0700 (PDT) Received: from [10.64.25.47] ([69.53.236.236]) by mx.google.com with ESMTPSA id o4sm11485393pdh.6.2015.03.21.05.05.19 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 21 Mar 2015 05:05:21 -0700 (PDT) Sender: Warner Losh Subject: Re: current meaning of BUS_DMA_COHERENT Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Content-Type: multipart/signed; boundary="Apple-Mail=_79434E6E-CBA9-4947-89F0-FF2CD9E79371"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.5b6 From: Warner Losh In-Reply-To: <201503210131.t2L1VrAx012383@jwlab.FEITH.COM> Date: Sat, 21 Mar 2015 06:05:11 -0600 Message-Id: References: <201503210131.t2L1VrAx012383@jwlab.FEITH.COM> To: John Wehle X-Mailer: Apple Mail (2.2070.6) Cc: freebsd-arm@freebsd.org, ian@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 12:05:28 -0000 --Apple-Mail=_79434E6E-CBA9-4947-89F0-FF2CD9E79371 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Mar 20, 2015, at 7:31 PM, John Wehle wrote: >=20 > 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. >=20 > 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. >=20 > Doesn't being able to sync individual descriptors also require padding = the > descriptor size so it's a multiple of the cache line size? Only if you access them as coherent, cached memory. If you access them as uncached memory, you don=E2=80=99t need to worry. Warner --Apple-Mail=_79434E6E-CBA9-4947-89F0-FF2CD9E79371 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJVDV53AAoJEGwc0Sh9sBEACbAP/0Xsnz3IRcrMG4I/0BCzITZ2 irvrtMIdvJVmEsr0IEAdlrFVXtqkwBc1dYrJYhxtSt5E/2W0A/dzkYu9Unf340Ey GTyI/H4ne24h6rwW9daf5wtcbT4uKhdYchSsqp8eVo506m1dxETiN0Ti/e/UVbMl OY3taVjHhlrbIyN4Jq6iq8P8iOLqJhZD+54r3FS7aqV6Ox0fO29jVzf3NJr9hFYo 3zgfTW6VO69lcNFIkX3EOvAxp4TLlu6MrMn909vHcWEloMuNuZ2A+hhpATX5KpFy Tn2r2bn07gOXLrJPGLZuWJFZD9WSxDuhUwOghs3rCeekzdeIraz37LMzm7lZLyKa 8NDsXnaZL/fhwrH9C4yTdckaOE0hEaLLpZG3Z1QtE3eWSSnCxo9GEU3sx6aHj6u1 uvAa9pKQK2Z9hp3uYOuOt54JXrEi/fZI+BZTtDiRPO3Owx/4WSjd6vCQPYaV054F YP6rpkdxJXNn8l1bzMeiaeIIVQgG13LcAbSBD9TR7DarSs9GlvVewGXmHdXhd/Du MqBRWyzo5ciIASAu+uavJe0ZMw725tkdyqBBZEo/c4s3snj2hr1vZ7X8wTJdLjoZ 6kPQBDxWwN4mBuiyB5nNmoTIYx5oi94tFJyrByPs5zesFbJVfpt4w73NrI/6/7Z/ frnxQfnxmpTo5X/hByY8 =jJBT -----END PGP SIGNATURE----- --Apple-Mail=_79434E6E-CBA9-4947-89F0-FF2CD9E79371--