Date: Sat, 21 Mar 2015 06:05:11 -0600 From: Warner Losh <imp@bsdimp.com> To: John Wehle <john@feith.com> Cc: freebsd-arm@freebsd.org, ian@freebsd.org Subject: Re: current meaning of BUS_DMA_COHERENT Message-ID: <B91C6F30-A0C8-4FB7-AD63-653ED34DBFB4@bsdimp.com> In-Reply-To: <201503210131.t2L1VrAx012383@jwlab.FEITH.COM> References: <201503210131.t2L1VrAx012383@jwlab.FEITH.COM>
next in thread | previous in thread | raw e-mail | index | archive | help
--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 <john@feith.com> wrote: >=20 > On Mar 20, 2015, at 8:27 AM, Ian Lepore <ian@freebsd.org> 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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?B91C6F30-A0C8-4FB7-AD63-653ED34DBFB4>