From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 11:37:33 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2FA46503; Tue, 10 Feb 2015 11:37:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 1AD00EAA; Tue, 10 Feb 2015 11:37:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1ABbWKP047325; Tue, 10 Feb 2015 11:37:32 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1ABbWAI047324; Tue, 10 Feb 2015 11:37:32 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201502101137.t1ABbWAI047324@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 10 Feb 2015 11:37:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278500 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2015 11:37:33 -0000 Author: mav Date: Tue Feb 10 11:37:32 2015 New Revision: 278500 URL: https://svnweb.freebsd.org/changeset/base/278500 Log: Do not abort already aborted tasks. This fixes abort of new tasks with the same tags as previously aborted, but still remaining on the queue. MFC after: 1 week Modified: head/sys/cam/ctl/ctl.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Tue Feb 10 07:56:14 2015 (r278499) +++ head/sys/cam/ctl/ctl.c Tue Feb 10 11:37:32 2015 (r278500) @@ -12286,64 +12286,57 @@ ctl_abort_task(union ctl_io *io) printf("%s\n", sbuf_data(&sb)); #endif - if ((xio->io_hdr.nexus.targ_port == io->io_hdr.nexus.targ_port) - && (xio->io_hdr.nexus.initid.id == - io->io_hdr.nexus.initid.id)) { - /* - * If the abort says that the task is untagged, the - * task in the queue must be untagged. Otherwise, - * we just check to see whether the tag numbers - * match. This is because the QLogic firmware - * doesn't pass back the tag type in an abort - * request. - */ + if ((xio->io_hdr.nexus.targ_port != io->io_hdr.nexus.targ_port) + || (xio->io_hdr.nexus.initid.id != io->io_hdr.nexus.initid.id) + || (xio->io_hdr.flags & CTL_FLAG_ABORT)) + continue; + + /* + * If the abort says that the task is untagged, the + * task in the queue must be untagged. Otherwise, + * we just check to see whether the tag numbers + * match. This is because the QLogic firmware + * doesn't pass back the tag type in an abort + * request. + */ #if 0 - if (((xio->scsiio.tag_type == CTL_TAG_UNTAGGED) - && (io->taskio.tag_type == CTL_TAG_UNTAGGED)) - || (xio->scsiio.tag_num == io->taskio.tag_num)) { + if (((xio->scsiio.tag_type == CTL_TAG_UNTAGGED) + && (io->taskio.tag_type == CTL_TAG_UNTAGGED)) + || (xio->scsiio.tag_num == io->taskio.tag_num)) { #endif - /* - * XXX KDM we've got problems with FC, because it - * doesn't send down a tag type with aborts. So we - * can only really go by the tag number... - * This may cause problems with parallel SCSI. - * Need to figure that out!! - */ - if (xio->scsiio.tag_num == io->taskio.tag_num) { - xio->io_hdr.flags |= CTL_FLAG_ABORT; - found = 1; - if ((io->io_hdr.flags & - CTL_FLAG_FROM_OTHER_SC) == 0 && - !(lun->flags & CTL_LUN_PRIMARY_SC)) { - union ctl_ha_msg msg_info; - - io->io_hdr.flags |= - CTL_FLAG_SENT_2OTHER_SC; - msg_info.hdr.nexus = io->io_hdr.nexus; - msg_info.task.task_action = - CTL_TASK_ABORT_TASK; - msg_info.task.tag_num = - io->taskio.tag_num; - msg_info.task.tag_type = - io->taskio.tag_type; - msg_info.hdr.msg_type = - CTL_MSG_MANAGE_TASKS; - msg_info.hdr.original_sc = NULL; - msg_info.hdr.serializing_sc = NULL; + /* + * XXX KDM we've got problems with FC, because it + * doesn't send down a tag type with aborts. So we + * can only really go by the tag number... + * This may cause problems with parallel SCSI. + * Need to figure that out!! + */ + if (xio->scsiio.tag_num == io->taskio.tag_num) { + xio->io_hdr.flags |= CTL_FLAG_ABORT; + found = 1; + if ((io->io_hdr.flags & CTL_FLAG_FROM_OTHER_SC) == 0 && + !(lun->flags & CTL_LUN_PRIMARY_SC)) { + union ctl_ha_msg msg_info; + + io->io_hdr.flags |= CTL_FLAG_SENT_2OTHER_SC; + msg_info.hdr.nexus = io->io_hdr.nexus; + msg_info.task.task_action = CTL_TASK_ABORT_TASK; + msg_info.task.tag_num = io->taskio.tag_num; + msg_info.task.tag_type = io->taskio.tag_type; + msg_info.hdr.msg_type = CTL_MSG_MANAGE_TASKS; + msg_info.hdr.original_sc = NULL; + msg_info.hdr.serializing_sc = NULL; #if 0 - printf("Sent Abort to other side\n"); + printf("Sent Abort to other side\n"); #endif - if (CTL_HA_STATUS_SUCCESS != - ctl_ha_msg_send(CTL_HA_CHAN_CTL, - (void *)&msg_info, - sizeof(msg_info), 0)) { - } + if (ctl_ha_msg_send(CTL_HA_CHAN_CTL, + (void *)&msg_info, sizeof(msg_info), 0) != + CTL_HA_STATUS_SUCCESS) { } + } #if 0 - printf("ctl_abort_task: found I/O to abort\n"); + printf("ctl_abort_task: found I/O to abort\n"); #endif - break; - } } } mtx_unlock(&lun->lun_lock);