Page MenuHomeFreeBSD

Convert CAM to use sbufs for 'da' arrival announcements
AcceptedPublic

Authored by scottl on Feb 14 2017, 10:51 PM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 1 2024, 5:02 AM
Unknown Object (File)
Nov 11 2023, 6:50 AM
Unknown Object (File)
Aug 17 2023, 7:04 AM
Unknown Object (File)
Apr 26 2023, 4:02 PM
Unknown Object (File)
Apr 9 2023, 6:30 AM
Unknown Object (File)
Jan 12 2023, 2:52 AM
Unknown Object (File)
Jan 5 2023, 2:28 AM
Unknown Object (File)
Nov 27 2022, 6:47 PM
Subscribers
None

Details

Reviewers
ken
imp
Summary

Add infrastructure so that periphs can use sbufs for device
arrival announcements. Only scsi_da is converted at the moment,
everything else remains working and unchanged. Have not added
device departure infrastructure, nor ATA/SATA infrastructure.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 7465
Build 7627: arc lint + arc unit

Event Timeline

scottl retitled this revision from to Convert CAM to use sbufs for 'da' arrival announcements.
scottl updated this object.
scottl edited the test plan for this revision. (Show Details)
scottl added reviewers: imp, ken.
imp edited edge metadata.

Looks reasonable to my eye.

This revision is now accepted and ready to land.Feb 16 2017, 7:32 AM

So, the question is, should we just have one version of these functions, and use a stack buffer to re-implement in terms of the new sbuf routines, or would we risk stack overflow?

sys/cam/cam_xpt.c
1079

Instead of duplicating xpt_announce_periph() in sbuf form, what do you think about re-implementing it to just call xpt_announce_periph_sbuf() with a static buffer and then printf that?

I guess the question would be how big of a stack buffer we're talking about, and whether that would cause things to blow up in any particular situation.

1144

Same question here.

sys/cam/scsi/scsi_all.c
5476

And I suppose the same question goes here. Should we just implement scsi_print_inquiry() in terms of scsi_print_inquiry_sbuf()?

sys/cam/scsi/scsi_xpt.c
3132

And the same question here. Should we just re-implement in terms of scsi_announce_periph_sbuf()?

sys/cam/cam_xpt.c
1079

This path has had problems in the past with blowing out the stack. Adding more to the stack makes me nervous. We can try your suggestion, and I've done it to a lesser degree in some places. However what I'd really like to do is get everything converted, add fine-grained draining, and then remove the legacy functions. This is just an intermediate step to that goal.

sys/cam/scsi/scsi_all.c
5476

Would there be any side effects in camcontrol and other userland utilities from doing this? I would have to be careful about using sbuf_putbuf() because it doesn't exist in userland (and I'm not sure how it would be implemented there).