#
9cbf3d61 |
| 20-Jul-2024 |
Warner Losh <imp@FreeBSD.org> |
cam/iosched: Make each periph driver provide schedule fnp
When we init the iosched instance, require clients to provide a schedule function. We have almost, but not quite everything to know when it
cam/iosched: Make each periph driver provide schedule fnp
When we init the iosched instance, require clients to provide a schedule function. We have almost, but not quite everything to know when it is safe to schedule new I/O. The periph drivers, however, have all the information, so make them do it when the I/O Scheduler needs to maybe schedule I/O for rate limiting, etc. and use it to do that.
Sponsored by: Netflix Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D46038
show more ...
|
#
6f1dd607 |
| 20-Jul-2024 |
Warner Losh <imp@FreeBSD.org> |
cam/iosched: Pass in the disk when initializing
The disk is nice to have at times, especially when you need the sector size. At present, the only plans for this are related to logging.
Sponsored by
cam/iosched: Pass in the disk when initializing
The disk is nice to have at times, especially when you need the sector size. At present, the only plans for this are related to logging.
Sponsored by: Netflix Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D46035
show more ...
|
Revision tags: release/14.1.0 |
|
#
99c14fb9 |
| 24-May-2024 |
Warner Losh <imp@FreeBSD.org> |
cam: Drop periph lock when completing I/O with ENOMEM status
When biofinish calls g_io_deliver with an error of ENOMEM, that kicks off the slowdown protocol, forcing I/O to go through g_down rather
cam: Drop periph lock when completing I/O with ENOMEM status
When biofinish calls g_io_deliver with an error of ENOMEM, that kicks off the slowdown protocol, forcing I/O to go through g_down rather than be directly dispatch. One of the side effects is that the I/O is resubmitted, so the start routines get called recursively, leading to a recursive lock panic. Rather than make the periph lock recursive, drop and reacquire the lock around such calls to biofinish.
For nda, this happens only when we can't allocate space to construct a TRIM. For ada and da, this is only for certain ZONE operations.
Sponsored by: Netflix Reviewed by: gallatin Differential Revision: https://reviews.freebsd.org/D45310
show more ...
|
Revision tags: release/13.3.0 |
|
#
2cb78e71 |
| 29-Jan-2024 |
John Baldwin <jhb@FreeBSD.org> |
nda: Use the NVMEV macro instead of expanded versions
Reviewed by: chuck Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D43596
|
#
d068ea16 |
| 28-Dec-2023 |
Mark Johnston <markj@FreeBSD.org> |
cam: Let cam_periph_unmapmem() return an error
As of commit b059686a71c8, cam_periph_unmapmem() can legitimately fail if the copyout() operation fails. However, this failure was never signaled to u
cam: Let cam_periph_unmapmem() return an error
As of commit b059686a71c8, cam_periph_unmapmem() can legitimately fail if the copyout() operation fails. However, this failure was never signaled to upper layers. In practice it is unlikely to occur since cap_periph_mapmem() would most likely fail in such circumstances anyway, but an error is nonetheless possible.
However, some code reading revealed a few paths where the return value of cam_periph_mapmem() is not checked, and this is definitely a bug. Add error checking there and let cam_periph_unmapmem() return errors from copyout().
Reviewed by: dab, mav MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D43201
show more ...
|
#
519b24f0 |
| 23-Nov-2023 |
Alexander Motin <mav@FreeBSD.org> |
CAM: Replace random sbuf_printf() with cheaper cat/putc.
|
Revision tags: release/14.0.0 |
|
#
2ffd30f7 |
| 06-Nov-2023 |
Warner Losh <imp@FreeBSD.org> |
cam: Remove left-over sys/cdefs.h in sys/cam
These weren't removed when $FreeBSD$ was removed. They aren't needed and now are a style(9) nonconformity.
Sponsored by: Netflix
|
#
685dc743 |
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
sys: Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
|
#
7f85b11c |
| 25-Jul-2023 |
Warner Losh <imp@FreeBSD.org> |
cam/nvme: Migrate to modern uintXX_t from u_intXX_t
As per https://lists.freebsd.org/archives/freebsd-scsi/2023-July/000257.html move to the modern uintXX_t.
MFC After: 3 days Sponsored by: Netflix
|
#
774ab87c |
| 21-Jul-2023 |
Warner Losh <imp@FreeBSD.org> |
cam: Add CAM_NVME_STATUS_ERROR error code
Add CAM_NVME_STATUS_ERROR error code. Flag all NVME commands that completed with an error status as CAM_NVME_STATUS_ERROR (a new value) instaead of CAM_REQ_
cam: Add CAM_NVME_STATUS_ERROR error code
Add CAM_NVME_STATUS_ERROR error code. Flag all NVME commands that completed with an error status as CAM_NVME_STATUS_ERROR (a new value) instaead of CAM_REQ_CMP_ERR. This indicates to the upper layers of CAM that the 'cpl' field for nvmeio CCBs is valid and can be examined for error recovery, if desired.
No functional change. nda will still see these as errors, call ndaerror() to get the error recovery action, etc. cam_periph_error will select the same case as before (even w/o the change, though the change makes it explicit).
Sponsored by: Netflix Reviewed by: chuck, mav, jhb Differential Revision: https://reviews.freebsd.org/D41085
show more ...
|
#
0732617e |
| 21-Jul-2023 |
Warner Losh <imp@FreeBSD.org> |
cam/nda: Remove impossible CAM codes
The NVME SIM does not generate these status values, so remove them.
Sponsored by: Netflix Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/
cam/nda: Remove impossible CAM codes
The NVME SIM does not generate these status values, so remove them.
Sponsored by: Netflix Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D41084
show more ...
|
#
fd02926a |
| 14-Apr-2023 |
Warner Losh <imp@FreeBSD.org> |
cam: Properly mask out the status bits to get completion code
ccb_h.status has two parts: the actual status and some addition bits to indicate additional information. It must be masked before compar
cam: Properly mask out the status bits to get completion code
ccb_h.status has two parts: the actual status and some addition bits to indicate additional information. It must be masked before comparing against completion codes. Add new inline function cam_ccb_success to simplify this to test whether or not the request succeeded. Most of the code already does this, but a few places don't (the rest likely should be converted to use cam_ccb_status and/or cam_ccb_success, but that's for another day). This caused at least one bug in recognizing devices behind a SATA port multiplexer, though some of these checks were fine with the special knowledge of the code paths involved.
PR: 270459 Sponsored by: Netflix MFC After: 1 week (and maybe a EN requst) Reviewed by: ken, mav Differential Revision: https://reviews.freebsd.org/D39572
show more ...
|
Revision tags: release/13.2.0 |
|
#
6aa5b10d |
| 27-Mar-2023 |
Yuri Pankov <yuripv@FreeBSD.org> |
nvme: fix resv commands with nda device
- passing I/O commands through nda requires nsid field to be set (it was unused when going through nvme_ns_ioctl()) - ccb's status can be OR'ed with the fla
nvme: fix resv commands with nda device
- passing I/O commands through nda requires nsid field to be set (it was unused when going through nvme_ns_ioctl()) - ccb's status can be OR'ed with the flags, use CAM_STATUS_MASK
Reviewed by: imp (cam) Differential Revision: https://reviews.freebsd.org/D37696
show more ...
|
Revision tags: release/12.4.0 |
|
#
891c6986 |
| 08-Oct-2022 |
Warner Losh <imp@FreeBSD.org> |
cam: Use FreeBSD standard copyright
For CAM, move to the FreeBSD standard copyright rather than the 'put it at the front' variation. This variaiton has been flagged as potentially problematic in oth
cam: Use FreeBSD standard copyright
For CAM, move to the FreeBSD standard copyright rather than the 'put it at the front' variation. This variaiton has been flagged as potentially problematic in other contexts. Since this variation wasn't a conscious decision on our part, use the standard license from src/COPYRIGHT. Also, remove the -FreeBSD suffix in SPDX-License-Identifier. It's obsolete at SPDX and even the original text didn't match it.
MFC After: 3 days Sponsored by: Netflix
show more ...
|
#
90bcc81b |
| 14-Jul-2022 |
Alexander Motin <mav@FreeBSD.org> |
Delay GEOM disk_create() until CAM periph probe completes.
Before this patch CAM periph drivers called both disk_alloc() and disk_create() same time on periph creation. But then prevented disks fro
Delay GEOM disk_create() until CAM periph probe completes.
Before this patch CAM periph drivers called both disk_alloc() and disk_create() same time on periph creation. But then prevented disks from opening until the periph probe completion with cam_periph_hold(). As result, especially if disk misbehaves during the probe, GEOM event thread, triggered to taste the disk, got blocked on open attempt, potentially for a long time, unable to process other events.
This patch moves disk_create() call from periph creation to the end of the probe. To allow disk_create() calls from non-sleepable CAM contexts some of its duties requiring memory allocations are moved either back to disk_alloc() or forward to g_disk_create(), so now disk_alloc() and disk_add_alias() are the only disk methods that require sleeping. If disk fails during the probe disk_create() may just be skipped, going directly to disk_destroy(). Other method calls during that time are just ignored. Since GEOM may now see the disks after CAM bus scan is already completed, introduce per-periph boot hold functions. Enclosure driver already had such mechanism, so just generalize it.
Reviewed by: imp MFC after: 1 month Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D35784
show more ...
|
#
489ba222 |
| 13-May-2022 |
Mitchell Horne <mhorne@FreeBSD.org> |
kerneldump: remove physical argument from d_dumper
The physical address argument is essentially ignored by every dumper method. In addition, the dump routines don't actually pass a real address; eve
kerneldump: remove physical argument from d_dumper
The physical address argument is essentially ignored by every dumper method. In addition, the dump routines don't actually pass a real address; every call to dump_append() passes a value of zero for physical.
Reviewed by: markj MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D35173
show more ...
|
Revision tags: release/13.1.0 |
|
#
e4b1ae21 |
| 26-Apr-2022 |
Warner Losh <imp@FreeBSD.org> |
ndaasync: sync to SCSI's daasyncs cam_periph_async() calls
Sponsored by: Netflix Reviewed by: mav Differential Revision: https://reviews.freebsd.org/D35059
|
#
48ae3f4f |
| 24-Apr-2022 |
Warner Losh <imp@FreeBSD.org> |
ata/nvme: Add comment
Steal the comment from daonninvalidate about the call to disk_gone().
Sponsored by: Netflix
|
#
c08ceddb |
| 24-Apr-2022 |
Warner Losh <imp@FreeBSD.org> |
nda: Fix comment
Fix a comment that was left over from the orignial implementation. Explain how pending transactions in hardware are completed/aborted in the SIM prior to ndacleanup being called.
S
nda: Fix comment
Fix a comment that was left over from the orignial implementation. Explain how pending transactions in hardware are completed/aborted in the SIM prior to ndacleanup being called.
Sponsored by: Netflix
show more ...
|
#
38f8adda |
| 24-Apr-2022 |
Alexander Motin <mav@FreeBSD.org> |
CAM: Replicate e0ceec676dc8 from da to ada and nda.
MFC after: 1 week
|
#
49dace1d |
| 02-Apr-2022 |
Gordon Bergling <gbe@FreeBSD.org> |
cam: Fix typos in source code comments
- s/paniced/panicked/
MFC after: 3 days
|
#
3090d504 |
| 24-Jan-2022 |
Kenneth D. Merry <ken@FreeBSD.org> |
Fix non-printable characters in NVMe model and serial numbers.
The NVMe 1.4 spec simply says that Model and Serial numbers are ASCII strings. Unlike SCSI, it doesn't prohibit non-printable characte
Fix non-printable characters in NVMe model and serial numbers.
The NVMe 1.4 spec simply says that Model and Serial numbers are ASCII strings. Unlike SCSI, it doesn't prohibit non-printable characters or say that the strings should be padded with spaces.
Since 2014, we have had cam_strvis_sbuf(), which gives additional options for handling non-ASCII characters. That behavior hasn't been available for non-sbuf consumers, so users of cam_strvis() were left with having octal ASCII codes inserted.
So, to avoid having garbage or octal chracters in the strings, use cam_strvis_sbuf() to create a new function, cam_strvis_flag(), and re-implement cam_strvis() using cam_strvis_flag().
Now, for the NVMe drives, we can use cam_strvis_flag with the CAM_STRVIS_FLAG_NONASCII_SPC flag. This transforms non-printable characters into spaces.
sys/cam/cam.c: Add a new function, cam_strvis_flag(), that creates an sbuf on the stack with the user's destination buffer, and calls cam_strvis_sbuf() with the given flag argument.
Re-implement cam_strvis() to call cam_strvis_flag with the CAM_STRVIS_FLAG_NONASCII_ESC argument. This should be the equivalent of the old cam_strvis() function, except for the overhead of creating the sbuf and calling sbuf_putc/printf.
sys/cam/cam.h: Declaration for cam_strvis_flag.
sys/cam/nvme/nvme_all.c: In nvme_print_ident, use the NONASCII_SPC flag with cam_strvis_flag().
sys/cam/nvme/nvme_da.c: In ndaregister(), use cam_strvis_flag() with the NONASCII_SPC flag for the disk description and serial number we report to GEOM.
sys/cam/nvme/nvme_xpt.c: In nvme_probe_done(), use cam_strvis_flag with the NONASCII_SPC flag when storing the drive serial number in the CAM EDT.
MFC after: 1 week Sponsored by: Spectra Logic Differential Revision: https://reviews.freebsd.org/D33973
show more ...
|
Revision tags: release/12.3.0 |
|
#
1bc9ca3b |
| 24-Nov-2021 |
Warner Losh <imp@FreeBSD.org> |
cam: Unbreak CAM_IO_STATS build
Fixes: 6637b7460066 Sponsored by: Netflix
|
#
6637b746 |
| 24-Nov-2021 |
Warner Losh <imp@FreeBSD.org> |
cam: Remove all the write-only variables
Delete all the write only variables in CAM. At worst, the only behavior change would be to prevent core dumps from chasing NULL pointers (though I think in a
cam: Remove all the write-only variables
Delete all the write only variables in CAM. At worst, the only behavior change would be to prevent core dumps from chasing NULL pointers (though I think in all these cases the pointers can't be NULL).
Sponsored by: Netflix
show more ...
|
Revision tags: release/13.0.0 |
|
#
e07ac3f2 |
| 11-Feb-2021 |
John Baldwin <jhb@FreeBSD.org> |
cam: Don't permit crashdumps on non-pollable devices.
If a disk's SIM doesn't support polling, then it can't be used to store crashdumps. Leave d_dump NULL in that case so that dumpon(8) fails grac
cam: Don't permit crashdumps on non-pollable devices.
If a disk's SIM doesn't support polling, then it can't be used to store crashdumps. Leave d_dump NULL in that case so that dumpon(8) fails gracefully rather than having dumps fail at crash time.
Reviewed by: scottl, mav, imp MFC after: 2 weeks Sponsored by: Chelsio Differential Revision: https://reviews.freebsd.org/D28454
show more ...
|