From owner-svn-src-stable-10@freebsd.org Mon Mar 6 06:24:55 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B4AECFA9AC; Mon, 6 Mar 2017 06:24:55 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0DF141A8D; Mon, 6 Mar 2017 06:24:54 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v266Ost1095054; Mon, 6 Mar 2017 06:24:54 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v266OsdW095053; Mon, 6 Mar 2017 06:24:54 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201703060624.v266OsdW095053@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 6 Mar 2017 06:24:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314737 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Mar 2017 06:24:55 -0000 Author: mav Date: Mon Mar 6 06:24:53 2017 New Revision: 314737 URL: https://svnweb.freebsd.org/changeset/base/314737 Log: MFC r314193: Some code cleanup. Modified: stable/10/sys/cam/ctl/scsi_ctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/scsi_ctl.c ============================================================================== --- stable/10/sys/cam/ctl/scsi_ctl.c Mon Mar 6 06:24:24 2017 (r314736) +++ stable/10/sys/cam/ctl/scsi_ctl.c Mon Mar 6 06:24:53 2017 (r314737) @@ -842,52 +842,32 @@ ctlfestart(struct cam_periph *periph, un (io->io_hdr.flags & CTL_FLAG_ABORT_STATUS) == 0) { io->io_hdr.flags &= ~CTL_FLAG_STATUS_QUEUED; - /* - * If this command was aborted, we don't - * need to send status back to the SIM. - * Just free the CTIO and ctl_io, and - * recycle the ATIO back to the SIM. - */ - xpt_print(periph->path, "%s: aborted " - "command 0x%04x discarded\n", - __func__, io->scsiio.tag_num); - /* - * For a wildcard attachment, commands can - * come in with a specific target/lun. Reset - * the target and LUN fields back to the - * wildcard values before we send them back - * down to the SIM. The SIM has a wildcard - * LUN enabled, not whatever target/lun - * these happened to be. - */ - if (softc->flags & CTLFE_LUN_WILDCARD) { - atio->ccb_h.target_id = CAM_TARGET_WILDCARD; - atio->ccb_h.target_lun = CAM_LUN_WILDCARD; - } - - if (atio->ccb_h.func_code != XPT_ACCEPT_TARGET_IO) { - xpt_print(periph->path, "%s: func_code " - "is %#x\n", __func__, - atio->ccb_h.func_code); - } + /* Tell the SIM that we've aborted this ATIO */ +#ifdef CTLFEDEBUG + printf("%s: tag %04x abort\n", __func__, atio->tag_id); +#endif + KASSERT(atio->ccb_h.func_code == XPT_ACCEPT_TARGET_IO, + ("func_code %#x is not ATIO", atio->ccb_h.func_code)); start_ccb->ccb_h.func_code = XPT_ABORT; start_ccb->cab.abort_ccb = (union ccb *)atio; - - /* Tell the SIM that we've aborted this ATIO */ xpt_action(start_ccb); softc->ccbs_freed++; xpt_release_ccb(start_ccb); /* * Send the ATIO back down to the SIM. + * For a wildcard attachment, commands can come in + * with a specific target/lun. Reset the target and + * LUN fields back to the wildcard values before we + * send them back down to the SIM. */ + if (softc->flags & CTLFE_LUN_WILDCARD) { + atio->ccb_h.target_id = CAM_TARGET_WILDCARD; + atio->ccb_h.target_lun = CAM_LUN_WILDCARD; + } xpt_action((union ccb *)atio); - /* - * If we still have work to do, ask for - * another CCB. Otherwise, deactivate our - * callout. - */ + /* If we still have work to do, ask for another CCB. */ if (!TAILQ_EMPTY(&softc->work_queue)) xpt_schedule(periph, /*priority*/ 1); return; @@ -911,9 +891,6 @@ ctlfestart(struct cam_periph *periph, un if (csio->sense_len != 0) { csio->sense_data = io->scsiio.sense_data; flags |= CAM_SEND_SENSE; - } else if (scsi_status == SCSI_STATUS_CHECK_COND) { - xpt_print(periph->path, "%s: check condition " - "with no sense\n", __func__); } }