Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Dec 2016 14:19:53 +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: r310266 - head/sys/cam/ctl
Message-ID:  <201612191419.uBJEJra4099316@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Mon Dec 19 14:19:52 2016
New Revision: 310266
URL: https://svnweb.freebsd.org/changeset/base/310266

Log:
  Add support for NUAR bit in Control mode page.
  
  MFC after:	2 weeks

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

Modified: head/sys/cam/ctl/ctl.c
==============================================================================
--- head/sys/cam/ctl/ctl.c	Mon Dec 19 13:25:53 2016	(r310265)
+++ head/sys/cam/ctl/ctl.c	Mon Dec 19 14:19:52 2016	(r310266)
@@ -253,7 +253,7 @@ const static struct scsi_control_page co
 	/*page_code*/SMS_CONTROL_MODE_PAGE,
 	/*page_length*/sizeof(struct scsi_control_page) - 2,
 	/*rlec*/SCP_DSENSE,
-	/*queue_flags*/SCP_QUEUE_ALG_MASK,
+	/*queue_flags*/SCP_QUEUE_ALG_MASK | SCP_NUAR,
 	/*eca_and_aen*/SCP_SWP,
 	/*flags4*/0,
 	/*aen_holdoff_period*/{0, 0},
@@ -8440,12 +8440,11 @@ ctl_persistent_reserve_out(struct ctl_sc
 		lun->pr_res_type = 0;
 
 		/*
-		 * if this isn't an exclusive access
-		 * res generate UA for all other
-		 * registrants.
+		 * If this isn't an exclusive access reservation and NUAR
+		 * is not set, generate UA for all other registrants.
 		 */
-		if (type != SPR_TYPE_EX_AC
-		 && type != SPR_TYPE_WR_EX) {
+		if (type != SPR_TYPE_EX_AC && type != SPR_TYPE_WR_EX &&
+		    (lun->MODE_CTRL.queue_flags & SCP_NUAR) == 0) {
 			for (i = softc->init_min; i < softc->init_max; i++) {
 				if (i == residx || ctl_get_prkey(lun, i) == 0)
 					continue;
@@ -8595,11 +8594,12 @@ ctl_hndl_per_res_out_on_other_sc(union c
 
 	case CTL_PR_RELEASE:
 		/*
-		 * if this isn't an exclusive access res generate UA for all
-		 * other registrants.
+		 * If this isn't an exclusive access reservation and NUAR
+		 * is not set, generate UA for all other registrants.
 		 */
 		if (lun->pr_res_type != SPR_TYPE_EX_AC &&
-		    lun->pr_res_type != SPR_TYPE_WR_EX) {
+		    lun->pr_res_type != SPR_TYPE_WR_EX &&
+		    (lun->MODE_CTRL.queue_flags & SCP_NUAR) == 0) {
 			for (i = softc->init_min; i < softc->init_max; i++)
 				if (i == residx || ctl_get_prkey(lun, i) == 0)
 					continue;



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