Commit 4afa62be authored by Warner Losh's avatar Warner Losh
Browse files

cam: Set the CAM_QOS_VALID when valid

When the elapsed time of the operation is complete and stored in the QOS
field, set the CAM_QOS_VALID bit.  In iosched, test to make sure it's
set before using it.

Sponsored by:		Netflix
parent 13604fb0
......@@ -1685,7 +1685,8 @@ cam_iosched_bio_complete(struct cam_iosched_softc *isc, struct bio *bp,
printf("Completing command with bio_cmd == %#x\n", bp->bio_cmd);
}
if (!(bp->bio_flags & BIO_ERROR) && done_ccb != NULL) {
if ((bp->bio_flags & BIO_ERROR) == 0 && done_ccb != NULL &&
(done_ccb->ccb_h.status & CAM_QOS_VALID) != 0) {
sbintime_t sim_latency;
sim_latency = cam_iosched_sbintime_t(done_ccb->ccb_h.qos.periph_data);
......
......@@ -4617,6 +4617,7 @@ xpt_done(union ccb *done_ccb)
/* Store the time the ccb was in the sim */
done_ccb->ccb_h.qos.periph_data = cam_iosched_delta_t(done_ccb->ccb_h.qos.periph_data);
done_ccb->ccb_h.status |= CAM_QOS_VALID;
hash = (u_int)(done_ccb->ccb_h.path_id + done_ccb->ccb_h.target_id +
done_ccb->ccb_h.target_lun) % cam_num_doneqs;
queue = &cam_doneqs[hash];
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment