From owner-p4-projects@FreeBSD.ORG Fri Sep 22 17:10:14 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A524916A416; Fri, 22 Sep 2006 17:10:14 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 83EA116A403 for ; Fri, 22 Sep 2006 17:10:14 +0000 (UTC) (envelope-from mjacob@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 21F9343D53 for ; Fri, 22 Sep 2006 17:10:14 +0000 (GMT) (envelope-from mjacob@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8MHAE2w038967 for ; Fri, 22 Sep 2006 17:10:14 GMT (envelope-from mjacob@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8MHADUK038964 for perforce@freebsd.org; Fri, 22 Sep 2006 17:10:13 GMT (envelope-from mjacob@freebsd.org) Date: Fri, 22 Sep 2006 17:10:13 GMT Message-Id: <200609221710.k8MHADUK038964@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to mjacob@freebsd.org using -f From: Matt Jacob To: Perforce Change Reviews Cc: Subject: PERFORCE change 106511 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Sep 2006 17:10:14 -0000 http://perforce.freebsd.org/chv.cgi?CH=106511 Change 106511 by mjacob@newisp on 2006/09/22 17:09:15 Incorporate QFULL EVENT stuff here, plus add a target mode derbug message. Affected files ... .. //depot/projects/newisp/dev/mpt/mpt_cam.c#4 edit Differences ... ==== //depot/projects/newisp/dev/mpt/mpt_cam.c#4 (text+ko) ==== @@ -2148,10 +2148,40 @@ break; case MPI_EVENT_QUEUE_FULL: { + struct cam_sim *sim; + struct cam_path *tmppath; + struct ccb_relsim crs; PTR_EVENT_DATA_QUEUE_FULL pqf = (PTR_EVENT_DATA_QUEUE_FULL) msg->Data; - mpt_prt(mpt, "QUEUE_FULL: Bus 0x%02x Target 0x%02x Depth %d\n", - pqf->Bus, pqf->TargetID, pqf->CurrentDepth); + lun_id_t lun_id; + + mpt_prt(mpt, "QUEUE FULL EVENT: Bus 0x%02x Target 0x%02x Depth " + "%d\n", pqf->Bus, pqf->TargetID, pqf->CurrentDepth); + if (mpt->phydisk_sim) { + sim = mpt->phydisk_sim; + } else { + sim = mpt->sim; + } + MPTLOCK_2_CAMLOCK(mpt); + for (lun_id = 0; lun_id < MPT_MAX_LUNS; lun_id++) { + if (xpt_create_path(&tmppath, NULL, cam_sim_path(sim), + pqf->TargetID, lun_id) != CAM_REQ_CMP) { + mpt_prt(mpt, "unable to create a path to send " + "XPT_REL_SIMQ"); + CAMLOCK_2_MPTLOCK(mpt); + break; + } + xpt_setup_ccb(&crs.ccb_h, tmppath, 5); + crs.ccb_h.func_code = XPT_REL_SIMQ; + crs.release_flags = RELSIM_ADJUST_OPENINGS; + crs.openings = pqf->CurrentDepth - 1; + xpt_action((union ccb *)&crs); + if (crs.ccb_h.status != CAM_REQ_CMP) { + mpt_prt(mpt, "XPT_REL_SIMQ failed\n"); + } + xpt_free_path(tmppath); + } + CAMLOCK_2_MPTLOCK(mpt); break; } case MPI_EVENT_SAS_DEVICE_STATUS_CHANGE: @@ -4556,7 +4586,12 @@ tgt->state = TGT_STATE_IN_CAM; tgt->reply_desc = reply_desc; ioindex = GET_IO_INDEX(reply_desc); - + if (mpt->verbose >= MPT_PRT_DEBUG) { + mpt_dump_data(mpt, "mpt_scsi_tgt_atio response", vbuf, + max(sizeof (MPI_TARGET_FCP_CMD_BUFFER), + max(sizeof (MPI_TARGET_SSP_CMD_BUFFER), + sizeof (MPI_TARGET_SCSI_SPI_CMD_BUFFER)))); + } if (mpt->is_fc) { PTR_MPI_TARGET_FCP_CMD_BUFFER fc; fc = (PTR_MPI_TARGET_FCP_CMD_BUFFER) vbuf;