Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 Oct 2015 10:47:19 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r288782 - stable/10/sys/cam/ctl
Message-ID:  <201510051047.t95AlJJV073270@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Mon Oct  5 10:47:18 2015
New Revision: 288782
URL: https://svnweb.freebsd.org/changeset/base/288782

Log:
  MFC r288021: Mark with DMA flag I/Os waiting for iSCSI write data after R2T.
  
  Reads and immediate writes are not blocking, so don't bother.

Modified:
  stable/10/sys/cam/ctl/ctl_frontend_iscsi.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c
==============================================================================
--- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c	Mon Oct  5 10:46:24 2015	(r288781)
+++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c	Mon Oct  5 10:47:18 2015	(r288782)
@@ -963,6 +963,7 @@ cfiscsi_pdu_handle_data_out(struct icl_p
 		done = (io->scsiio.ext_data_filled != cdw->cdw_r2t_end ||
 		    io->scsiio.ext_data_filled == io->scsiio.kern_data_len);
 		uma_zfree(cfiscsi_data_wait_zone, cdw);
+		io->io_hdr.flags &= ~CTL_FLAG_DMA_INPROG;
 		if (done)
 			io->scsiio.be_move_done(io);
 		else
@@ -1136,6 +1137,7 @@ cfiscsi_session_terminate_tasks(struct c
 		 * assuming that the data transfer actually succeeded
 		 * and writing uninitialized data to disk.
 		 */
+		cdw->cdw_ctl_io->io_hdr.flags &= ~CTL_FLAG_DMA_INPROG;
 		cdw->cdw_ctl_io->scsiio.io_hdr.port_status = 42;
 		cdw->cdw_ctl_io->scsiio.be_move_done(cdw->cdw_ctl_io);
 		uma_zfree(cfiscsi_data_wait_zone, cdw);
@@ -2665,6 +2667,7 @@ cfiscsi_datamove_out(union ctl_io *io)
 		cfiscsi_session_terminate(cs);
 		return;
 	}
+	io->io_hdr.flags |= CTL_FLAG_DMA_INPROG;
 	bhsr2t = (struct iscsi_bhs_r2t *)response->ip_bhs;
 	bhsr2t->bhsr2t_opcode = ISCSI_BHS_OPCODE_R2T;
 	bhsr2t->bhsr2t_flags = 0x80;
@@ -2841,6 +2844,8 @@ cfiscsi_task_management_done(union ctl_i
 #endif
 			TAILQ_REMOVE(&cs->cs_waiting_for_data_out,
 			    cdw, cdw_next);
+			io->io_hdr.flags &= ~CTL_FLAG_DMA_INPROG;
+			cdw->cdw_ctl_io->scsiio.io_hdr.port_status = 43;
 			cdw->cdw_ctl_io->scsiio.be_move_done(cdw->cdw_ctl_io);
 			uma_zfree(cfiscsi_data_wait_zone, cdw);
 		}



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