Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Sep 2015 15:21:23 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r287784 - head/sys/cam/ctl
Message-ID:  <201509141521.t8EFLNme027097@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Mon Sep 14 15:21:23 2015
New Revision: 287784
URL: https://svnweb.freebsd.org/changeset/base/287784

Log:
  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.

Modified:
  head/sys/cam/ctl/ctl.c

Modified: head/sys/cam/ctl/ctl.c
==============================================================================
--- head/sys/cam/ctl/ctl.c	Mon Sep 14 15:15:32 2015	(r287783)
+++ head/sys/cam/ctl/ctl.c	Mon Sep 14 15:21:23 2015	(r287784)
@@ -978,6 +978,8 @@ ctl_isc_event_handler(ctl_ha_channel cha
 			 * 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 +
@@ -1060,6 +1062,8 @@ ctl_isc_event_handler(ctl_ha_channel cha
 				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;
@@ -12207,6 +12211,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
@@ -12590,10 +12595,12 @@ ctl_datamove_remote_xfer(union ctl_io *i
 	 * 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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201509141521.t8EFLNme027097>