Date: Sat, 25 Apr 2015 13:47:07 -0500 From: Jason Harmening <jason.harmening@gmail.com> To: Konstantin Belousov <kostikbel@gmail.com> Cc: Svatopluk Kraus <onwahe@gmail.com>, FreeBSD Arch <freebsd-arch@freebsd.org> Subject: Re: bus_dmamap_sync() for bounced client buffers from user address space Message-ID: <553BE12B.4000105@gmail.com> In-Reply-To: <20150425181846.GN2390@kib.kiev.ua> References: <CAFHCsPXMjge84AR2cR8KXMXWP4kH2YvuV_uqtPKUvn5C3ygknw@mail.gmail.com> <CAM=8qan-4SbKJaddrfkv=HG3n%2BHaOPDL5MEPS9DoaTvnhrJPZQ@mail.gmail.com> <20150425094152.GE2390@kib.kiev.ua> <553B9E64.8030907@gmail.com> <20150425163444.GL2390@kib.kiev.ua> <553BC9D1.1070502@gmail.com> <20150425172833.GM2390@kib.kiev.ua> <553BD501.4010109@gmail.com> <20150425181846.GN2390@kib.kiev.ua>
next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --nL5iEtE9e7JmsrptGRdbAV4CnLqkeTER2 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 04/25/15 13:18, Konstantin Belousov wrote: > On Sat, Apr 25, 2015 at 12:55:13PM -0500, Jason Harmening wrote: >> Ah, that looks much better. A few things though: >> 1) _bus_dmamap_load_ma (note the underscore) is still part of the MI/M= D >> interface, which we tell drivers not to use. It looks like it's >> implemented for every arch though. Should there be a public and >> documented bus_dmamap_load_ma ? > Might be yes. But at least one consumer of the KPI must appear before > the facility is introduced. Could some of the GART/GTT code consume that? >> 2) There is a bus_dmamap_load_ma_triv that's part of the MI interface,= >> but it's not documented, and it seems like it would be suboptimal in >> certain cases, such as when dmar is enabled. > When DMAR is enabled, bus_dmamap_load_triv() should not be used. > It should not be used directly even when not. Drivers should use > bus_dmamap_load_ma(), and implementation redirects to _triv() if > needed. > > The _triv() is the helper to allow bus_dmamap_load_ma() to exists > on architectures which cannot implement, on not yet implemented, > proper page array load op. Yes, I noticed the same thing. I'm not sure why _triv() is treated as part of the public API and not prefixed with an underscore and a comment not to use it in drivers. >> 3) Using bus_dmamap_load_ma would mean always using physcopy for bounc= e >> buffers...seems like the sfbufs would slow things down ? > For amd64, sfbufs are nop, due to the direct map. But, I doubt that > we can combine bounce buffers and performance in the single sentence. In fact the amd64 implementation of uiomove_fromphys doesn't use sfbufs at all thanks to the direct map. sparc64 seems to avoid sfbufs as much as possible too. I don't know what arm64/aarch64 will be able to use.=20 Those seem like the platforms where bounce buffering would be the most likely, along with i386 + PAE. They might still be used on 32-bit platforms for alignment or devices with < 32-bit address width, but then those are likely to be old and slow anyway. I'm still a bit worried about the slowness of waiting for an sfbuf if one is needed, but in practice that might not be a big issue. --nL5iEtE9e7JmsrptGRdbAV4CnLqkeTER2 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQF8BAEBCgBmBQJVO+ErXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAw MDAwMDAwMDAwMDAwMDAwAAoJELufi/mShB0b4MQIALHE02H9F1KBw7E6d75Q03Nk H7XaCvETTyNOQfxPLQ4Zs3FjRD3QbjsXavyqQA9XsAO8a9vMeDkUbKFaqIKWen4T zPAvEZ5RhWRnxRs0NNo/uvPCob7Or1GeE/kq9j0sxcVcvVVGa+xa4gCf6R+3aQ4Y rpEt72V4YyaPmr7e0nV6TTAjbJtbY4RxwbeSGuIlKcH+hHkfooRDWusEn8urOCVa bLzlrOZniwig6qG5s3fZ1oIRgWA9ngYy8jmh9RkEI/uhQeibJr1zJMCCu1Fg5ZQt V9STVSF2kyFlFqZVz+ENPGDEasjqAmgOwjHI4PF8WvujCLbO0h4OJZBkCMWLLD8= =aJCh -----END PGP SIGNATURE----- --nL5iEtE9e7JmsrptGRdbAV4CnLqkeTER2--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?553BE12B.4000105>