nda: Assume all cases in ndaasync can sleep
The error recovery is nicer if we can wait for the tiny memory we need
to send the messages when the physpath changes. Since we've moved the
async handler into a sleepable context, we can wait for the allocation
to complete since async events are rare enough and it's not an
indefinite wait.
Also add a comment about the scope of AC_ADVINFO_CHANGED for nvme
drives. We could use it for broadcasting INDENTIFY changes in nvme
drives. However, the underlying mechanisms in NVMe don't really allow
for that (they are more fine-grained). So for namespace changes, for
example, we'll send AC_GETDEV_CHANGED instead of a AC_ADVINFO_CHANGED.
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D55523
nvme_sim: Fix a cut and paste error
Fix the error message in nvme_sim_ns_removed that was cut and pasted
from nvme_sim_ns_changed to reflect its new home. No functional change.
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D55522
nda: AC_GETDEV_CHANGED calls media chanaged for sectorsize change
When the sector size changes, we assume it's new media. When the
mediasize changes, we'll just resize the disk (we get called for both
events). When neither have changed, don't call either.
Some NVMe drives (but not all) post a async event on page 4 with the
sector size changes via a FORMAT command. We'll notice the new media
right away, rather than the next device open. As a practical effect,
this just means that certain geom operations will see it sooner. Since
most drive interaction goes through open, that will catch those drives
that do not post this event well enough.
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D55521
nda: Rescan the drive on open
SCSI and ATA drives rescan the drive on opens to catch changes to the
disk. We do it here to so we catch if a drive has been FORMATed or
SANITIZEd with different parameters. We don't use xpt_rescan() since we
don't want to interfere with boot or keep all busses locked (this rescan
won't change the bus, so we don't need the CAM topo lock).
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D55520
nda: Move ndasetgeom
Move ndasetgeom up in the file. We'll need it here for future
commits. Also, preserve the UNMAPPED_BIO flag since we can't observe
enough data from this routine to set it directly.
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D55519
nvme xpt: convert restart to a bool.
restart is a boolean. While I'm here, convert to a bool.
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D55518
virtio: Use bus_dma for ring and indirect buffer allocations
While the majority of virtio platforms will be fully coherent, some may
require cache maintenance or other specific device memory handling (eg for
secure partitioning). Using bus_dma allows for these usecases.
The virtio buffers are marked as coherent; this should ensure that sync
calls are no-ops in the common cases.
Reviewed by: andrew
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D54959
virtio_blk: Use bus_dma for command/ack buffer allocations
While the majority of virtio platforms will be fully coherent, some may
require cache maintenance or other specific device memory handling (eg for
secure partitioning). Using bus_dma allows for these usecases.
The virtio buffers are marked as coherent; this should ensure that sync
calls are no-ops in the common cases.
Reviewed by: andrew, br
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D54960