diff options
author | mav <mav@FreeBSD.org> | 2015-10-05 09:20:09 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2015-10-05 09:20:09 +0000 |
commit | cb0cd525755a333609ecfe32cfbc2870f1354990 (patch) | |
tree | 0efd0503176ed9f497ae1f93e8ff619c00cdc39b | |
parent | aa4a28b040c873ded06e7e1c4ed52deb584834c3 (diff) | |
download | FreeBSD-src-cb0cd525755a333609ecfe32cfbc2870f1354990.zip FreeBSD-src-cb0cd525755a333609ecfe32cfbc2870f1354990.tar.gz |
MFC r287784: Implement data/status aggregation for secondary HA node.
For short read requests this reduces latency by 30%, reporting command
completion after two interlink roundtrips instead of full three.
-rw-r--r-- | sys/cam/ctl/ctl.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c index a95e9fb..4499733 100644 --- a/sys/cam/ctl/ctl.c +++ b/sys/cam/ctl/ctl.c @@ -980,6 +980,8 @@ ctl_isc_event_handler(ctl_ha_channel channel, ctl_ha_event event, int param) * when the datamove is complete. */ io->io_hdr.serializing_sc = msg->hdr.serializing_sc; + if (msg->hdr.status == CTL_SUCCESS) + io->io_hdr.status = msg->hdr.status; if (msg->dt.sg_sequence == 0) { i = msg->dt.kern_sg_entries + @@ -1062,6 +1064,8 @@ ctl_isc_event_handler(ctl_ha_channel channel, ctl_ha_event event, int param) memcpy(&io->scsiio.sense_data, &msg->scsi.sense_data, msg->scsi.sense_len); + if (msg->hdr.status == CTL_SUCCESS) + io->io_hdr.flags |= CTL_FLAG_STATUS_SENT; } ctl_enqueue_isc(io); break; @@ -12209,6 +12213,7 @@ ctl_datamove(union ctl_io *io) msg.hdr.original_sc = io->io_hdr.original_sc; msg.hdr.serializing_sc = io; msg.hdr.nexus = io->io_hdr.nexus; + msg.hdr.status = io->io_hdr.status; msg.dt.flags = io->io_hdr.flags; /* * We convert everything into a S/G list here. We can't @@ -12592,10 +12597,12 @@ ctl_datamove_remote_xfer(union ctl_io *io, unsigned command, * failure. */ if ((rq == NULL) - && ((io->io_hdr.status & CTL_STATUS_MASK) != CTL_STATUS_NONE)) + && ((io->io_hdr.status & CTL_STATUS_MASK) != CTL_STATUS_NONE && + (io->io_hdr.status & CTL_STATUS_MASK) != CTL_SUCCESS)) ctl_set_busy(&io->scsiio); - if ((io->io_hdr.status & CTL_STATUS_MASK) != CTL_STATUS_NONE) { + if ((io->io_hdr.status & CTL_STATUS_MASK) != CTL_STATUS_NONE && + (io->io_hdr.status & CTL_STATUS_MASK) != CTL_SUCCESS) { if (rq != NULL) ctl_dt_req_free(rq); |