Page MenuHomeFreeBSD

Use sbufs for CAM device announcements
AcceptedPublic

Authored by scottl on Apr 18 2017, 3:31 AM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 25 2024, 11:58 PM
Unknown Object (File)
Jan 1 2024, 12:05 AM
Unknown Object (File)
Dec 28 2023, 5:22 PM
Unknown Object (File)
Dec 21 2023, 2:31 PM
Unknown Object (File)
Nov 9 2023, 1:19 AM
Unknown Object (File)
Nov 4 2023, 10:57 PM
Unknown Object (File)
Oct 31 2023, 5:25 PM
Unknown Object (File)
Oct 6 2023, 12:10 AM
Subscribers
None

Details

Reviewers
ken
imp
mav
Summary

Add infrastructure to the ATA and SCSI transports that supports
using a consumer-supplied sbuf for printing device discovery
announcements. This helps ensure that messages to the console
will be properly serialized (through sbuf_putbuf) and not be
truncated and interleaved with other messages. The
infrastructure mirrors the existing xpt_announce_periph()
entry point and is opt-in for now. No content or formatting
changes are visible to the operator other than the new coherency.

While here, eliminate the stack usage of the temporary
announcement buffer in some of the drivers. It's moved to the
softc for now, but future work will eliminate it entirely by
making the code flow more linear. Future work will also address
locking so that the sbufs can be dynamically sized.

The scsi_da, scs_cd, scsi_ses, and ata_da drivers are converted
at this point, other drivers can be converted at a later date.

Diff Detail

Event Timeline

I don't have major objections, but can't say that I like code duplication this introduces. Also I haven't found where denounce_sbuf method is used, and other things confuse me.

sys/cam/cam_xpt.c
1200

Is it right to call denounce() in announce function?

sys/cam/scsi/scsi_da.c
4233

Why 80 here, not the define?

sys/cam/cam_xpt.c
1200

Unfortunate naming of the functions. This part is correct, but there is a naming bug in xpt_announce_periph_short_sbuf()

Rewrote the xpt_announce_periph and xpt_denounce_periph functions, the
previous work tried too hard and failed at code sharing. Also add in
seatbelts for transports that don't support sbufs yet, and add a tunable
knob to force the non-use of sbufs

I have no objections, but the day when we'll be able to remove the duplication will be a holiday.

This revision is now accepted and ready to land.Apr 19 2017, 1:59 PM