Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp2610551ybi; Sat, 13 Jul 2019 19:21:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqxGcPEmX6W5SzPc0Sa8VlGkViXwJzR1KQnb0UsnAA91fpT1Y6EqrCNiXilVMNaCFoakVMbN X-Received: by 2002:a63:4823:: with SMTP id v35mr13420724pga.138.1563070863406; Sat, 13 Jul 2019 19:21:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563070863; cv=none; d=google.com; s=arc-20160816; b=PvRhMRJELNBaJVj308ebEJGtlTFTuIshMnMPFGf7eXkU7O0ECKt/OUluXbVaYSVUzA KDtHDU8+z+xNapZPUshDEtGQAImm0IvCpXN7mUiZm8McHKaTGHR64WUjeqQinTJtrtHp Y2Sn7Joqgwbez9BTUxPR/dXrhU3UtnCZL4TMAgmFo+s9GqqfTeFh8w6UiEOOGA7Lgfo2 uSZyIsiakEUjG/1Wa0vNhUvCO182hf5Nhrq6driSFDu8hKAgrWx192nD05Dfivu6GcsO TLuLOITbt5f+HxoXwqnInhIwo32zA+tpBgBJUldvpwUTftDeP996C7AGokUh7Th/VQa8 juTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:dlp-filter:cms-type :content-transfer-encoding:date:message-id:in-reply-to:cc:to:from :reply-to:subject:mime-version:dkim-signature:dkim-filter; bh=yNAoPuRoPzyZ4mRfa7HYfRK55kOEm67EhAubhyYqoXQ=; b=xTUx6PxNRNXPAwVQMhaRH6vHWG1TLOyWmy5lqVRYqdAr/rfp627dsYmJXHhv5Xfp0u snUy2eDLYdW/zJBQTBZ5orxh5XC0iEIsbx7T3L6fl3oRmxNV9tsXiX0JkhZJfZDKw6T4 q6WTLD2QQ3Sh8q35ctbVN6e/qWBjGOI5rQkxhYs7P51ExfC49JNBmgChWSNsvv3P0wrt Bp6/Z7eys6XQu1QkFUZgva5JiCLpW24EsoYF0mPAU+3lKc1AoKU+3H1eAWDaacNrR4Xu axecL45lAthYVcBrLD+0kS0gMmH4PohYRGsNJv+wDNX4SbnizvC7tfNshbyDthhDEw8f isSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=l8n9tSki; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i23si12394961pgh.26.2019.07.13.19.20.11; Sat, 13 Jul 2019 19:21:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=l8n9tSki; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728095AbfGNCR6 (ORCPT + 99 others); Sat, 13 Jul 2019 22:17:58 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:14488 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727944AbfGNCR6 (ORCPT ); Sat, 13 Jul 2019 22:17:58 -0400 Received: from epcas2p2.samsung.com (unknown [182.195.41.54]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20190714021754epoutp0324bbe09e9756c9517c57b3954b11422d~xJH9P6hs52684926849epoutp03A for ; Sun, 14 Jul 2019 02:17:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20190714021754epoutp0324bbe09e9756c9517c57b3954b11422d~xJH9P6hs52684926849epoutp03A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1563070674; bh=yNAoPuRoPzyZ4mRfa7HYfRK55kOEm67EhAubhyYqoXQ=; h=Subject:Reply-To:From:To:CC:In-Reply-To:Date:References:From; b=l8n9tSki1NutIF5cz/cTpm4aUr9VCCh1SOcv48mS97giPgH7pPidWfj3zJAxu92zi xeqfNbQFuNVFHXtu4fTQsvwpEd/9pflI9Im0SwJBVLt3bhi88XggMbrWOzjJROphp5 DLaIPP5dkd3+bERtL3M30IQVs3tBQ4GykTqK4EDc= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas2p3.samsung.com (KnoxPortal) with ESMTP id 20190714021754epcas2p38ba7dd96266371e2281d77273b97b176~xJH8o00nl2917029170epcas2p3G; Sun, 14 Jul 2019 02:17:54 +0000 (GMT) Received: from epsmges2p2.samsung.com (unknown [182.195.40.189]) by epsnrtp1.localdomain (Postfix) with ESMTP id 45mVgP0swczMqYlh; Sun, 14 Jul 2019 02:17:53 +0000 (GMT) X-AuditID: b6c32a46-fd5ff70000001035-85-5d2a90d0f030 Received: from epcas2p4.samsung.com ( [182.195.41.56]) by epsmges2p2.samsung.com (Symantec Messaging Gateway) with SMTP id 16.61.04149.0D09A2D5; Sun, 14 Jul 2019 11:17:53 +0900 (KST) Mime-Version: 1.0 Subject: Re: [RESEND RFC PATCH] mpt3sas: support target smid for [abort|query] task Reply-To: minwoo.im@samsung.com From: Minwoo Im To: Sreekanth Reddy , Minwoo Im CC: "sathya.prakash@broadcom.com" , "suganath-prabu.subramani@broadcom.com" , "jejb@linux.ibm.com" , "martin.petersen@oracle.com" , "MPT-FusionLinux.pdl@broadcom.com" , "linux-kernel@vger.kernel.org" , "linux-scsi@vger.kernel.org" , "linux-block@vger.kernel.org" , Euihyeok Kwon , Sarah Cho , Sanggwan Lee , Gyeongmin Nam , "minwoo.im.dev@gmail.com" X-Priority: 3 X-Content-Kind-Code: NORMAL In-Reply-To: X-Drm-Type: N,general X-Msg-Generator: Mail X-Msg-Type: PERSONAL X-Reply-Demand: N Message-ID: <20190714021752epcms2p6994026d1e2b3738f2857f8eff307c866@epcms2p6> Date: Sun, 14 Jul 2019 11:17:52 +0900 X-CMS-MailID: 20190714021752epcms2p6994026d1e2b3738f2857f8eff307c866 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrNJsWRmVeSWpSXmKPExsWy7bCmhe7FCVqxBm2nmSw+rtjFbvHwnbPF ohvbmCz23tK2uLxrDptF9/UdbBbLj/9jsvjVyW3x7PQBZou5rxuYLBZtfc9qsWHeLRaL9Ycm sFnM/PqU3eLZmRgHfo9Z98+yeeycdZfdY8KiA4weH5/eYvHo27KK0ePzJrkAtqgcm4zUxJTU IoXUvOT8lMy8dFsl7+B453hTMwNDXUNLC3MlhbzE3FRbJRefAF23zByge5UUyhJzSoFCAYnF xUr6djZF+aUlqQoZ+cUltkqpBSk5BYaGBXrFibnFpXnpesn5uVaGBgZGpkCVCTkZsz+cYy14 JVjReG4OWwPjdd4uRk4OCQETiVNbJzB2MXJxCAnsYJRY+OcTaxcjBwevgKDE3x3CIDXCAqES kx+dZQEJCwnIS/x4ZQAR1pR4t/sMK4jNJqAu0TD1FQuILSIQLvFo1mdGEJtZ4DqrxKs98hCr eCVmtD9lgbClJbYv3wpWwykQKHHm5Wl2iLioxM3Vb+Hs98fmM0LYIhKt984yQ9iCEg9+7mYE OUdCQELi3js7CLNeYssKC5BHJARaGCVuvFkL1aov0fj8I9haXgFfiYcHfzKB2CwCqhJHDy2D Guki8fHoVBaIk+Ultr+dwwwykxnoxfW79CHGK0scuQVVwSfRcfgvO8xTO+Y9YYKwlSU+HjoE NVFSYvml12wQtofE9q9zmSBhfIdRYsXcNUwTGBVmIYJ5FpLFsxAWL2BkXsUollpQnJueWmxU YIQcs5sYwQlXy20H45JzPocYBTgYlXh4d3BrxQqxJpYVV+YeYpTgYFYS4V31Xz1WiDclsbIq tSg/vqg0J7X4EKMp0P8TmaVEk/OB2SCvJN7Q1MjMzMDS1MLUzMhCSZx3E/fNGCGB9MSS1OzU 1ILUIpg+Jg5OqQbGXaXLem4nbdobMufCNG3ZQo+HD6Yt4b8Xvqyj81zy3dfbO23P77cITtWc 2nK8KKgy2WOpx5rXh6++eKasXV2QMeFdx42GTV/4Sz7vLl12t39e6YrTSxmSwkw+MPO5bf32 SE1Ha1XUrJ9ds5ecra+u7jt3JFfx/onjDXK3Nxq0PXzSUlV5bY3iOiWW4oxEQy3mouJEAN6E pE/OAwAA DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20190621063708epcms2p309f4173afabe5de28942ba15d13987f7 References: <20190621063708epcms2p309f4173afabe5de28942ba15d13987f7@epcms2p3> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Sreekanth, > > drivers/scsi/mpt3sas/mpt3sas_ctl.c | 10 ++++++---- > > 1 file changed, 6 insertions(+), 4 deletions(-) > > > > diff --git a/drivers/scsi/mpt3sas/mpt3sas_ctl.c > b/drivers/scsi/mpt3sas/mpt3sas_ctl.c > > index b2bb47c14d35..5c7539dae713 100644 > > --- a/drivers/scsi/mpt3sas/mpt3sas_ctl.c > > +++ b/drivers/scsi/mpt3sas/mpt3sas_ctl.c > > @@ -596,15 +596,17 @@ _ctl_set_task_mid(struct MPT3SAS_ADAPTER *ioc, > struct mpt3_ioctl_command *karg, > > if (priv_data->sas_target->handle != handle) > > continue; > > st = scsi_cmd_priv(scmd); > > - tm_request->TaskMID = cpu_to_le16(st->smid); > > - found = 1; > > + if (tm_request->TaskMID == st->smid) { > > I think it will difficult for the user to find the smid that he want > to abort. For this user has to enable the scsi logging level and get > the tag and pass the ioctl with tag +1 value in TaskMID field. And > hence currently driver will loop over all the smid's and if it fines > any outstanding smid then it will issue task abort or task query TM > for this outstanding smid to the HBA firmware. Sreekanth, You're exactly right because I have done this kind of abort based on The scsi logs with logging level configured. > > May be we can do like below, > * First check whether user provided "TaskMID" is non zero or not. if > user provided TaskMID is non-zero and if this TaskMID is outstanding > then driver will issue TaskAbort/QueryTask TM with this TaskMID value Okay. If I get it right, you mean to check the given TaskMID(!=0) is Outstanding or not is by an iteration first. > else driver will loop over all the smid's and if finds any smid is > outstanding then it will issue TaskAbort/QueryTask TM with TaskMID > value set to outstanding smid. Got your point here. I'll make a conditional statement for the case where the TaskMID is zero which is the legacy behaviour. > With the above logic still legacy application will be supported > without breaking anything where they provide TaskMID filed as zero. > And it also allows the user to abort the IO which he wants. Sure, I'll prepare V2 patch soon. Thanks Sreekanth, Minwoo Im