History log of /freebsd/sys/cam/cam_xpt.c (Results 1 – 25 of 881)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# f5cebe73 04-Feb-2025 Warner Losh <imp@FreeBSD.org>

cam/xpt: Put all messages on one line

Make all error messages from *xpt.c be greppable by putting them on one
line, "outdenting" where necessary to keep things under about 90
columns. More of cam co

cam/xpt: Put all messages on one line

Make all error messages from *xpt.c be greppable by putting them on one
line, "outdenting" where necessary to keep things under about 90
columns. More of cam could use this treatment, but not finding a message
in xpt is what prompted this round.

Sponsored by: Netflix

show more ...


Revision tags: release/14.1.0-p7, release/14.2.0-p1, release/13.4.0-p3, release/14.2.0, release/13.4.0, release/14.1.0, release/13.3.0
# eb86c6c5 09-Feb-2024 John Baldwin <jhb@FreeBSD.org>

cam: Check if cam_simq_alloc fails for the xpt bus during module init

This is very unlikely to fail (and if it does, CAM isn't going to work
regardless), but fail with an error rather than a gaurant

cam: Check if cam_simq_alloc fails for the xpt bus during module init

This is very unlikely to fail (and if it does, CAM isn't going to work
regardless), but fail with an error rather than a gauranteed panic via
NULL pointer dereference.

PR: 276770
Reported by: Qiushi <w290680224@gmail.com>

show more ...


# 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.


# 6332e0f1 22-Nov-2023 Alexander Motin <mav@FreeBSD.org>

CAM: Remove return value from xpt_path_sbuf()

It is wrong to call sbuf_len() on third-party sbuf. If that sbuf
has a drain function, it ends up in assertion. But even would it
work, it would retur

CAM: Remove return value from xpt_path_sbuf()

It is wrong to call sbuf_len() on third-party sbuf. If that sbuf
has a drain function, it ends up in assertion. But even would it
work, it would return not newly written length, but the full one.
Searching through the sources I don't see this value used.

show more ...


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


# fd9a4a67 06-Nov-2023 Warner Losh <imp@FreeBSD.org>

cam: Minor opt_cam.h cleanup

sys/cam/cam.h includes opt_cam.h, so none of the clients need to do
this. cam.h does all the right dancing to conditionally include
opt_cam.h only when it makes sense. I

cam: Minor opt_cam.h cleanup

sys/cam/cam.h includes opt_cam.h, so none of the clients need to do
this. cam.h does all the right dancing to conditionally include
opt_cam.h only when it makes sense. It generally only matters when
cam_debug.h is included (it must be included before that). Many of the
stray opt_cam.h includes were after cam_debug.h which would be a problem
were it not included in cam/cam.h. The other users of CAM options that
aren't debug all already include cam/cam.h.

Also trim unneeded sys/cdefs.h files from the files touched.

Sponsored by: Netflix

show more ...


# 70f2356d 02-Nov-2023 Warner Losh <imp@FreeBSD.org>

cam: Make cam_debug macros atomic

The CAM_DEBUG* macros use multiple printfs to dump the data. This is
suboptimal when tracing things that produce even a moderate amount since
it gets intertwingled.

cam: Make cam_debug macros atomic

The CAM_DEBUG* macros use multiple printfs to dump the data. This is
suboptimal when tracing things that produce even a moderate amount since
it gets intertwingled. I can't even turn on tracing with a 24-disk HBA
on boot without it getting messed up. Add helper routines to work around
clang's over-use of the stack: that way we only pay the stack penalty
when a trace hits.

Sponsored by: Netflix
Reviewed by: ken, mav
Differential Revision: https://reviews.freebsd.org/D42411

show more ...


# 685dc743 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# 0a57cdd9 02-Aug-2023 John Baldwin <jhb@FreeBSD.org>

cam_xpt: Reimplement xpt_*nounce_periph in terms of the _sbuf versions

Use an sbuf that drains to printf to avoid duplicating code in the two
versions of each function.

Reviewed by: mav
Sponsored b

cam_xpt: Reimplement xpt_*nounce_periph in terms of the _sbuf versions

Use an sbuf that drains to printf to avoid duplicating code in the two
versions of each function.

Reviewed by: mav
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D41263

show more ...


# b8271176 02-Aug-2023 John Baldwin <jhb@FreeBSD.org>

cam_xpt: Remove fallbacks for non-sbuf protocol methods

This includes removing the kern.cam.announce_nosbuf sysctl.

Reviewed by: mav, imp
Sponsored by: Chelsio Communications
Differential Revision:

cam_xpt: Remove fallbacks for non-sbuf protocol methods

This includes removing the kern.cam.announce_nosbuf sysctl.

Reviewed by: mav, imp
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D41262

show more ...


# 76b2e390 02-Aug-2023 John Baldwin <jhb@FreeBSD.org>

cam xpt_*nounce_periph*: Various fixes for periphs without a protocol

If the periph doesn't have a valid protocol, these routines emit
fallback messages. However, the fallback messages duplicated t

cam xpt_*nounce_periph*: Various fixes for periphs without a protocol

If the periph doesn't have a valid protocol, these routines emit
fallback messages. However, the fallback messages duplicated the
periph name and unit number, and in the case of *denounce* included a
spurious newline.

Reviewed by: mav, imp
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D41177

show more ...


# 7af2f2c8 25-Jul-2023 Warner Losh <imp@FreeBSD.org>

cam: 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


# e932f0d2 27-Jun-2023 John Baldwin <jhb@FreeBSD.org>

cam_xpt: Properly fail if a sim uses an unsupported transport.

The default xport ops for a new bus is xport_default, not NULL, so
check for that when determining if a bus failed to find a suitable
t

cam_xpt: Properly fail if a sim uses an unsupported transport.

The default xport ops for a new bus is xport_default, not NULL, so
check for that when determining if a bus failed to find a suitable
transport. In addition, the path needs to be freed with xpt_free_path
instead of a plain free so that the path's reference on the sim is
dropped; otherwise, cam_sim_free in the caller after xpt_bus_register
returns failure will hang forever.

Note that we have to exempt the xpt bus from this check as it uses
xport_default on purpose.

Reviewed by: mav, imp
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D40617

show more ...


# 4d846d26 10-May-2023 Warner Losh <imp@FreeBSD.org>

spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD

The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of

spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD

The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with: pfg
MFC After: 3 days
Sponsored by: Netflix

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, release/12.4.0, release/13.1.0
# d095d6a3 01-May-2022 Warner Losh <imp@FreeBSD.org>

cam_xpt: Prefer bool to int where it's a boolean

In the places where we set an integer to 0 or 1 and then use it like a
boolean, replace int with bool and 0/1 with false/true. Left alone
places wher

cam_xpt: Prefer bool to int where it's a boolean

In the places where we set an integer to 0 or 1 and then use it like a
boolean, replace int with bool and 0/1 with false/true. Left alone
places where this is a function argument or return value. No functional
changes intended.

Sponsored by: Netflix

show more ...


# 0e5c50bf 07-Jan-2022 Alexander Motin <mav@FreeBSD.org>

cam: Relax callouts precisions.

On large systems even relatively rare callouts may fire many times
per second. This should allow them to aggregate better, since we do
not require any precision when

cam: Relax callouts precisions.

On large systems even relatively rare callouts may fire many times
per second. This should allow them to aggregate better, since we do
not require any precision when polling for media change, etc.

MFC after: 2 weeks

show more ...


Revision tags: release/12.3.0
# 8f9be1ee 05-Oct-2021 Alexander Motin <mav@FreeBSD.org>

cam(4): Improve XPT_DEV_MATCH

Remove *_MATCH_NONE enums, making no sense and so never used. Make
*_MATCH_ANY enums 0 (no any match flags set), previously used by
*_MATCH_NONE. Bump CAM_VERSION to

cam(4): Improve XPT_DEV_MATCH

Remove *_MATCH_NONE enums, making no sense and so never used. Make
*_MATCH_ANY enums 0 (no any match flags set), previously used by
*_MATCH_NONE. Bump CAM_VERSION to 0x1a reflecting those changes and
add compat shims.

When traversing through buses and devices do not descend if we can
already see that requested pattern does not match the bus or device.
It allows to save significant amount of time on system with thousands
of disks when doing limited searches.

Reviewed by: imp
MFC after: 2 weeks
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D32304

show more ...


# ed8ef7ae 25-Sep-2021 Mark Johnston <markj@FreeBSD.org>

cam: Avoiding waking up doneq threads if we're dumping

Depending on the state of the target doneq thread at the time of the
panic, the wakeup can hang indefinitely in thread_lock_block_wait().
That

cam: Avoiding waking up doneq threads if we're dumping

Depending on the state of the target doneq thread at the time of the
panic, the wakeup can hang indefinitely in thread_lock_block_wait().
That function should likely be modified to return immediately if the
scheduler is stopped, but it is also preferable to avoid wakeups in
general after a panic.

Reported by: pho
Reviewed by: mav, imp
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32126

show more ...


# abea0c6b 18-Jul-2021 Warner Losh <imp@FreeBSD.org>

cam: Mark the qos data is valid in xpd_done_direct() too.

Sponsored by: Netflix


# 50aa1daf 29-Jun-2021 Warner Losh <imp@FreeBSD.org>

cam: change xpt_clone_path to return int

xpt_clone_path originally returned a cam_status, but it doesn't do I/O
and should return an errno instead. I added it last year and it's only
used in one pla

cam: change xpt_clone_path to return int

xpt_clone_path originally returned a cam_status, but it doesn't do I/O
and should return an errno instead. I added it last year and it's only
used in one place. It's not yet documented, so no doc changes are
nneeded.

Reviewed by: scottl@, mav@
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D30884

show more ...


# 30f8afd0 29-Jun-2021 Warner Losh <imp@FreeBSD.org>

cam: fix xpt_bus_register and xpt_bus_deregister return errno

xpt_bus_register and xpt_bus_deregister returns a hybrid error that's
neither a cam_status, nor an errno, but a mix of both. Update
xpt

cam: fix xpt_bus_register and xpt_bus_deregister return errno

xpt_bus_register and xpt_bus_deregister returns a hybrid error that's
neither a cam_status, nor an errno, but a mix of both. Update
xpt_bus_register and xpt_bus_deregister to return an errno. The vast
majority of current users compare against zero, which can also be
spelled CAM_SUCCESS. Nobody uses CAM_FAILURE, so remove that symbol
to prevent comfusion (nothing returns it either).

Where the return value is saved, ensure that the variable 'error' is
used to store an errno and 'status' is used to store a cam_status where
it makes the code clearer (usually just in functions that already mix
and match). Where the return value isn't used at all, avoid storing it
at all.

Reviewed by: scottl@, mav@ (earlier version)
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D30860

show more ...


# 1ed40162 28-Jun-2021 Warner Losh <imp@FreeBSD.org>

cam: add xpt_path_sim_device to return device_t associated with a path

Return the device associated with the sim's bus when it called
xpt_bus_register, if any. Most real SIMs in the tree set this de

cam: add xpt_path_sim_device to return device_t associated with a path

Return the device associated with the sim's bus when it called
xpt_bus_register, if any. Most real SIMs in the tree set this device,
but some virtual ones do not have a device_t assocaited with them.

Reviewed by: scottl@, mav@ (earlier version)
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D30853

show more ...


# 40990d54 28-Jun-2021 Warner Losh <imp@FreeBSD.org>

cam: save parent_dev in xpt_bus_register

Reviewed by: scottl@
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D30846


12345678910>>...36