Page MenuHomeFreeBSD

nvme: Use a memdesc for the request buffer instead of a bespoke union.
ClosedPublic

Authored by jhb on Jul 20 2023, 6:24 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sep 21 2024, 4:52 AM
Unknown Object (File)
Sep 5 2024, 3:57 AM
Unknown Object (File)
Sep 3 2024, 11:59 AM
Unknown Object (File)
Aug 10 2024, 9:34 AM
Unknown Object (File)
Aug 7 2024, 6:52 PM
Unknown Object (File)
Aug 6 2024, 5:33 PM
Unknown Object (File)
Aug 2 2024, 12:28 AM
Unknown Object (File)
Jun 28 2024, 7:31 PM
Subscribers

Details

Summary

This avoids encoding CAM-specific knowledge in nvme_qpair.c.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jhb requested review of this revision.Jul 20 2023, 6:24 PM

This is only compile tested, but this is what I was trying to describe in my last comment in D41058.

First pass: I love it. I had it on my list to try, but I'm glad I just have to review it.

Would you be able to test it easily? :)

In D41119#936246, @jhb wrote:

Would you be able to test it easily? :)

I can test it later this evening.

This revision is now accepted and ready to land.Jul 21 2023, 2:18 PM

Tested with smart(8) and all looks good:

# ./smart -d nda0
Critical Warning        0       0
Composite Temperature   1       316
Available Spare 3       100
Available Spare Threshold       4       5
Percentage Used 5       0
Data Units Read 32      1524527
Data Units Written      48      2582739
Host Read Commands      64      22258691
Host Write Commands     80      26153957
Controller Busy Time    96      36
Power Cycles    112     483
Power On Hours  128     2564
Unsafe Shutdowns        144     242
Media and Data Integrity Errors 160     0
Number of Error Information Log Entries 176     373
#

Looks good, works for me. Do we want retire the ccb busdma method? Or is it still useful even though there's no current in tree consumers?

In D41119#937122, @imp wrote:

Looks good, works for me. Do we want retire the ccb busdma method? Or is it still useful even though there's no current in tree consumers?

Humm, that's a good question. I would not be opposed to retiring it outright, but I'm surprised other HBA drivers don't use it?

Ah, it is indeed used in other places:

sys/dev/ahci/ahci.c:            bus_dmamap_load_ccb(ch->dma.data_tag, slot->dma.data_map, ccb,
sys/dev/aic7xxx/aic79xx_osm.c:  error = bus_dmamap_load_ccb(ahd->buffer_dmat,
sys/dev/aic7xxx/aic7xxx_osm.c:  error = bus_dmamap_load_ccb(ahc->buffer_dmat,
sys/dev/arcmsr/arcmsr.c:                        error = bus_dmamap_load_ccb(acb->dm_segs_dmat
sys/dev/ata/ata-dma.c:        error = bus_dmamap_load_ccb(request->dma->data_tag,
sys/dev/ciss/ciss.c:            error = bus_dmamap_load_ccb(sc->ciss_buffer_dmat,
sys/dev/firewire/sbp.c:                 error = bus_dmamap_load_ccb(/*dma tag*/sbp->dmat,
sys/dev/hpt27xx/hpt27xx_osm_bsd.c:              error = bus_dmamap_load_ccb(vbus_ext->io_dmat,
sys/dev/hptiop/hptiop.c:                error = bus_dmamap_load_ccb(hba->io_dmat,
sys/dev/hptmv/entry.c:                  error = bus_dmamap_load_ccb(pAdapter->io_dma_parent, 
sys/dev/hptnr/hptnr_osm_bsd.c:          error = bus_dmamap_load_ccb(vbus_ext->io_dmat, 
sys/dev/hptnr/hptnr_osm_bsd.c:          error = bus_dmamap_load_ccb(vbus_ext->io_dmat, 
sys/dev/hptrr/hptrr_osm_bsd.c:          error = bus_dmamap_load_ccb(vbus_ext->io_dmat, 
....