Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 Jun 2017 06:10:18 +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: r320492 - head/sys/dev/isp
Message-ID:  <201706300610.v5U6AI0e040762@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Fri Jun 30 06:10:18 2017
New Revision: 320492
URL: https://svnweb.freebsd.org/changeset/base/320492

Log:
  Polish target_id/target_lun setting for ATIOs/INOTs.
  
  For ATIOs it is pointless to report isp_loopid to CAM, since in other
  places it operates with port database record IDs, not with loop IDs.
  
  For INOTs target_id/target_lun seems were never set, so wildcard INOTs
  probably were not working correctly when LUN IDs were important.

Modified:
  head/sys/dev/isp/isp_freebsd.c

Modified: head/sys/dev/isp/isp_freebsd.c
==============================================================================
--- head/sys/dev/isp/isp_freebsd.c	Fri Jun 30 05:49:12 2017	(r320491)
+++ head/sys/dev/isp/isp_freebsd.c	Fri Jun 30 06:10:18 2017	(r320492)
@@ -1608,7 +1608,7 @@ isp_target_putback_atio(union ccb *ccb)
 	}
 	at->at_status = CT_OK;
 	at->at_rxid = cso->tag_id;
-	at->at_iid = cso->ccb_h.target_id;
+	at->at_iid = cso->init_id;
 	if (isp_target_put_entry(isp, at)) {
 		callout_reset(&PISP_PCMD(ccb)->wdog, 10,
 		    isp_refire_putback_atio, ccb);
@@ -1693,7 +1693,7 @@ isp_handle_platform_atio2(ispsoftc_t *isp, at2_entry_t
 	atp->state = ATPD_STATE_ATIO;
 	SLIST_REMOVE_HEAD(&tptr->atios, sim_links.sle);
 	ISP_PATH_PRT(isp, ISP_LOGTDEBUG2, atiop->ccb_h.path, "Take FREE ATIO\n");
-	atiop->ccb_h.target_id = fcp->isp_loopid;
+	atiop->ccb_h.target_id = ISP_MAX_TARGETS(isp);
 	atiop->ccb_h.target_lun = lun;
 
 	/*
@@ -1872,7 +1872,7 @@ isp_handle_platform_atio7(ispsoftc_t *isp, at7_entry_t
 	SLIST_REMOVE_HEAD(&tptr->atios, sim_links.sle);
 	ISP_PATH_PRT(isp, ISP_LOGTDEBUG2, atiop->ccb_h.path, "Take FREE ATIO\n");
 	atiop->init_id = FC_PORTDB_TGT(isp, chan, lp);
-	atiop->ccb_h.target_id = FCPARAM(isp, chan)->isp_loopid;
+	atiop->ccb_h.target_id = ISP_MAX_TARGETS(isp);
 	atiop->ccb_h.target_lun = lun;
 	atiop->sense_len = 0;
 	cdbxlen = aep->at_cmnd.fcp_cmnd_alen_datadir >> FCP_CMND_ADDTL_CDBLEN_SHIFT;
@@ -2357,6 +2357,8 @@ isp_handle_platform_target_tmf(ispsoftc_t *isp, isp_no
 		goto bad;
 	}
 
+	inot->ccb_h.target_id = ISP_MAX_TARGETS(isp);
+	inot->ccb_h.target_lun = lun;
 	if (isp_find_pdb_by_portid(isp, notify->nt_channel, notify->nt_sid, &lp) == 0 &&
 	    isp_find_pdb_by_handle(isp, notify->nt_channel, notify->nt_nphdl, &lp) == 0) {
 		inot->initiator_id = CAM_TARGET_WILDCARD;



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