Re: [PATCH 2/3] x86_64: Define 128-bit memory-mapped I/O operations
From: Ben Hutchings <hidden>
Date: 2012-08-22 19:01:55
On Wed, 2012-08-22 at 11:28 -0700, Linus Torvalds wrote:
On Wed, Aug 22, 2012 at 11:11 AM, Ben Hutchings [off-list ref] wrote:quoted
Right, I think it's been made pretty clear that it's going to be dependent on more than just architecture.Well, it's entirely possible that the 128-bit case will work correctly on all x86-64 hardware out there on PCIe. I just can't guarantee it, because we certainly have had issues with hw doing odd things before. But maybe PCIe really is well-specified enough, and maybe nobody has done a odd PCIe bridges, and maybe every time some 128-bit access is split, the bus in question still always remembers the original 128-bit size in the transaction. It's not at all impossible. I just wouldn't *guarantee* it.
Even then, everything works out OK if the particular MMIO write I'm concerned about *is* split - just as long as the resulting operations are in ascending address order. This is not true on all systems if we enable write-combining (without a fence in the middle, which defeats the purpose), and I think hpa was saying that it may not be the case with SSE writes either.
And to some degree, for high-end server-only hardware in particular, it really *is* acceptable to say "If you have odd hardware, odd things will happen". So for this particular driver, maybe the right approach is simply to say "we require that your fabric works right". And see if anybody ever complains.
Maybe. At the moment reordering tends to cause the hardware to complain that we sent an invalid sequence of DMA descriptors, but that's only because we're not being as smart as we could about using TX push. I don't want to run the risk of sending out corrupted packets (with offloaded checksums, so they're not that obviously invalid) on the wire. Ben.
The 100ns may be worth those kinds of "you'd better not have old/crap hardware" decisions. It's not acceptable for some drivers (a driver for some consumer ATA chip might not want to make that kind of choice, and say "whatever, we'll be really conservative), but "Quod licet Jovi, non licet bovi". The fact that something might not be *guaranteed* to always work doesn't necessarily mean that it is always the wrong thing to do..
-- Ben Hutchings, Staff Engineer, Solarflare Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked.