| e2b71e14 | 29-Nov-2023 |
Warner Losh <[email protected]> |
mpi3mr: Minor tweak to task queue pausing
Use a while loop with cancel / drain to make sure that all tasks have completed before proceeding to reset.
Suggested by: jhb Sponsored by: Netflix
(che
mpi3mr: Minor tweak to task queue pausing
Use a while loop with cancel / drain to make sure that all tasks have completed before proceeding to reset.
Suggested by: jhb Sponsored by: Netflix
(cherry picked from commit 272a406042608da9bc3e67e41c6b7fc31d4166b8)
show more ...
|
| 344cdef0 | 29-Nov-2023 |
Warner Losh <[email protected]> |
mpi3mr: Assume dma_hiaddr is BUS_SPACE_MAXADDR
No sense having a variable for this. So use BUS_SPACE_MAXADDR and remove dma_hiaddr from softc.
Suggested by: jhb Sponsored by: Netflix Differential
mpi3mr: Assume dma_hiaddr is BUS_SPACE_MAXADDR
No sense having a variable for this. So use BUS_SPACE_MAXADDR and remove dma_hiaddr from softc.
Suggested by: jhb Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D42808
(cherry picked from commit 1ec7c672bc2854a1efb1d50f189d4881163c16c6)
show more ...
|
| ac7d9eaf | 29-Nov-2023 |
Warner Losh <[email protected]> |
mpi3mr: Replace can't happen DataLength == 0 with an assert
Replace the test for DataLength == 0 with an assert. It can't happen, but an assert doesn't hurt. Emacs removed some trailing white space
mpi3mr: Replace can't happen DataLength == 0 with an assert
Replace the test for DataLength == 0 with an assert. It can't happen, but an assert doesn't hurt. Emacs removed some trailing white space too.
Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D42807
(cherry picked from commit 2361a0056fc16b5e11df2aa948aaa633ac01d685)
show more ...
|
| 23a5782d | 29-Nov-2023 |
Alexander Motin <[email protected]> |
mpi3mr: Use template for main busdma tag.
Use the simpler template code for the parent busdma tag for all I/O to this card.
Reviewed by: mav, jhb, imp Differential Revision: https://reviews.freebs
mpi3mr: Use template for main busdma tag.
Use the simpler template code for the parent busdma tag for all I/O to this card.
Reviewed by: mav, jhb, imp Differential Revision: https://reviews.freebsd.org/D42607
(cherry picked from commit 489eee0d41dce317678adb0dae8d509a5f1d6d93)
show more ...
|
| 2d84c6e8 | 29-Nov-2023 |
Alexander Motin <[email protected]> |
mpi3mr: Make these bus_dmamap_load calls synchronous
These calls "should" all be synchrounous. There's no bouncing that's needed for them (at least in the typical case that we have a sane card that
mpi3mr: Make these bus_dmamap_load calls synchronous
These calls "should" all be synchrounous. There's no bouncing that's needed for them (at least in the typical case that we have a sane card that has more bits of dma addresses decoded than we have memory), so there's no errors possible. Ensure these calls are really synchronous with BUS_DMA_NOWAIT flags (which should never fail now that the bus_dmamem_alloc() has succeeded).
Reviewed by: mav, jhb, imp Differential Revision: https://reviews.freebsd.org/D42606
(cherry picked from commit 39a3e6a812ad9c089bd2c4935193f1b3c4c5c35a)
show more ...
|
| c8afd30b | 29-Nov-2023 |
Alexander Motin <[email protected]> |
mpi3mr: Fix MAXPHYS usage
This usage is obsolete. Replace with maximum bus space size. maxphys will sort itself out at higher levels.
Reviewed by: mav, jhb, imp Differential Revision: https://revi
mpi3mr: Fix MAXPHYS usage
This usage is obsolete. Replace with maximum bus space size. maxphys will sort itself out at higher levels.
Reviewed by: mav, jhb, imp Differential Revision: https://reviews.freebsd.org/D42605
(cherry picked from commit 4e6d128bd823e5b5d0b058f918c7036978a0e8bf)
show more ...
|
| 835db418 | 29-Nov-2023 |
Warner Losh <[email protected]> |
mpi3mr: Add firmware version
Publish the firmware version on the card like we do for mps/mpr.
Sponsored by: Netflix Reviewed by: mav Differential Revision: https://reviews.freebsd.org/D42588
(ch
mpi3mr: Add firmware version
Publish the firmware version on the card like we do for mps/mpr.
Sponsored by: Netflix Reviewed by: mav Differential Revision: https://reviews.freebsd.org/D42588
(cherry picked from commit 28a274342ea0b0666b56704477d2d1c17564942e)
show more ...
|
| c3b67dea | 29-Nov-2023 |
Warner Losh <[email protected]> |
mpi3mr: Honor the dma mask from IOCFacts
The number of signficant bits that are decoded are returned in the flags field of the IOCFacts structure from the device. Rather than assume the worst with
mpi3mr: Honor the dma mask from IOCFacts
The number of signficant bits that are decoded are returned in the flags field of the IOCFacts structure from the device. Rather than assume the worst with a pessimal 32-bit maximum, look at this value and pass it along to all the dma map creation requests.
A lof of those creations are repetitive and could just inherit from the base tag if we moved to the templated interface. This is called out as desireable future work not done at this time.
In addition, due to a chicken and an egg problem, we have to allocate some of the maps with a 32-bit loaddr. These are the ones we need to read iocfacts. And they are fine to be so restricted: they are little used after startup, and when they are used, bouncing is fine.
Sponsored by: Netflix Reviewed by: mav Differential Revision: https://reviews.freebsd.org/D42559
(cherry picked from commit 91d961356d03465635c4784fab48acdd1304e1e0)
show more ...
|
| fda7cc79 | 29-Nov-2023 |
Warner Losh <[email protected]> |
mpi3mr: Fix EINPROGRESS errors hanging the card
Move enqueueing of commands to bus_dmamap_load_ccb callback
Fix fundamental difference between FreeBSD and Linux. On Linux, your dma load callback al
mpi3mr: Fix EINPROGRESS errors hanging the card
Move enqueueing of commands to bus_dmamap_load_ccb callback
Fix fundamental difference between FreeBSD and Linux. On Linux, your dma load callback always happends before it returns, so drivers are written to load the map, then submit to hardware. On FreeBSD, the callback may be deferred and return EINPROGRESS. This means the callback is responsible for queueing the request to the hardware is done after the SGL list is created. Make a number of interrelated cahnages:
At the end of mpi3mr_prepare_sgls, add a call to mpi3mr_enqueue_request.
Split the hardware submission out from the end of mpi3mr_action_scsiio and move it into a new routine mpi3mr_enqueue_request.
Move all error completion from the end of mpi3mr_action_scsiio to where the error is detected. We cannot pass errors back from the mpi3mr_enqueue_request to do this on a 'failed' mpi3mr in a centralized place (since it has to be fire and forget).
Add comments about zero length SGLs never making it into mpi3mr_prepare_sgls. Keep the code there for the moment, but we only set cm->data to non-NULL when scsiio_req->DataLength is not zero. So the datalength can't be zero and we can't send the zero SGLs.
Add commentts about other "impossible" tests in mpi3mr_prepare_sgls that really should be simple asserts of some flavor.
Eliminate cm->error_code, since we can't pass data back from the mpi3mr_prepare_sgl callback anymore.
In mpi3mr_map_request, call mpi3mr_enqueue_request for the no data case. This seems to work even though we've not done the special zero length handling that was in mpi3mr_prepare_sgls, giving further evidence to it not actually being needed. This is needed for SCSI CDBs that have no data to pass to the drive like TEST UNIT READY.
With this change, and the prior ones, we're now able to run with mpi3mr on 128GB systems and very heavy disk load (so many buffers land > 4GB: the driver instructs busdma to never use memory abouve 4GB, which may be too conservative, but an issue for another time).
Sponsored by: Netflix Reviewed by: sumit.saxena_broadcom.com, mav, jhb Differential Revision: https://reviews.freebsd.org/D42543
(cherry picked from commit 3208a189c1e2c4ef35daa432fe45629a043d7047)
show more ...
|
| ac4f33d2 | 29-Nov-2023 |
Warner Losh <[email protected]> |
mpi3mr: Cleaup setting of status in processing scsiio requests
More uniformly use mpi3mr_set_ccbstatus in mpi3mr_action_scsiio. The routine mostly used it, but also has setting of status by hand. I
mpi3mr: Cleaup setting of status in processing scsiio requests
More uniformly use mpi3mr_set_ccbstatus in mpi3mr_action_scsiio. The routine mostly used it, but also has setting of status by hand. In those cases where we want to error out the request, use this routine.
As part of this, move setting CAM_SIM_QUEUED later in the function to when we're sure it's been queued. Remove the places we clear it before this.
Sponsored by: Netflix Reviewed by: mav, jhb Differential Revision: https://reviews.freebsd.org/D42542
(cherry picked from commit cf8c23230aabd30aa9251975dbe705da559a2d02)
show more ...
|
| c351a6ec | 29-Nov-2023 |
Warner Losh <[email protected]> |
mpi3mr: Only set callout_owned when we create a timeout
Since we assume there's a timeout to cancel when this is true, only set it true when we set the timeout. Otherwise we may try to cancel a time
mpi3mr: Only set callout_owned when we create a timeout
Since we assume there's a timeout to cancel when this is true, only set it true when we set the timeout. Otherwise we may try to cancel a timeout when there's been an error in submission.
Sponsored by: Netflix Reviewed by: mav Differential Revision: https://reviews.freebsd.org/D42541
(cherry picked from commit 1cfd01111eb6a28ca5043e928aa8e9099064177a)
show more ...
|
| 3c12997a | 29-Nov-2023 |
Warner Losh <[email protected]> |
mpi3mr: Minor style fix
Fold two lines to make this more readable.
Sponsored by: Netflix Reviewed by: mav, jhb Differential Revision: https://reviews.freebsd.org/D42540
(cherry picked from commi
mpi3mr: Minor style fix
Fold two lines to make this more readable.
Sponsored by: Netflix Reviewed by: mav, jhb Differential Revision: https://reviews.freebsd.org/D42540
(cherry picked from commit e2b27df9eb324fa6e72e29d3185dcd6b390efa9d)
show more ...
|
| 54fa0d10 | 29-Nov-2023 |
Warner Losh <[email protected]> |
mpi3mr: Reduce the scope of the reset_mutext
Reduce the scope of reset_mutext to protect the msleep in the watch dog thread as well as the MPI3MR_FLAGS_SHUTDOWN bit. Use it to protect the wakeup in
mpi3mr: Reduce the scope of the reset_mutext
Reduce the scope of reset_mutext to protect the msleep in the watch dog thread as well as the MPI3MR_FLAGS_SHUTDOWN bit. Use it to protect the wakeup in mpi3mr_detach so this thread can exit sooner when we're trying to do an orderly shutdown. Optimize the flow to check the sleep and other conditions before going to sleep.
It's an open question if this should protect sc->unrecoverable, and if we should wakeup the watchdog thread when we set it. We might also want to move too booleans for the three flags that we have now in mpi3mr_flags. There are a number of U8s that should really be bools and we might want to also group them together to pack softc better.
Sponsored by: Netflix Reviewed by: mav Differential Revision: https://reviews.freebsd.org/D42539
(cherry picked from commit 7c4913093a759adf2e4c7d65535aee04aadee4df)
show more ...
|
| e82c6e94 | 29-Nov-2023 |
Warner Losh <[email protected]> |
mpi3mr: Remove unused fields in struct mpi3mr_cmd
All of these fields are either unused, or just initialized. Remove them. This saves about 1MB of memory for the cards that I have which can do 8k tr
mpi3mr: Remove unused fields in struct mpi3mr_cmd
All of these fields are either unused, or just initialized. Remove them. This saves about 1MB of memory for the cards that I have which can do 8k transactions at once.
Sponsored by: Netflix Reviewed by: mav, jhb Differential Revision: https://reviews.freebsd.org/D42538
(cherry picked from commit a2b046620c54db977196128b3c53da2704b9fd20)
show more ...
|