From patchwork Mon Sep 28 04:50:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muneendra Kumar X-Patchwork-Id: 287309 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.9 required=3.0 tests=BAYES_00, DATE_IN_PAST_06_12, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MIME_HEADER_CTYPE_ONLY,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, T_TVD_MIME_NO_HEADERS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8322FC2D0A8 for ; Mon, 28 Sep 2020 11:44:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 344FC2100A for ; Mon, 28 Sep 2020 11:44:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="C65Iz9Sh" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726625AbgI1Lol (ORCPT ); Mon, 28 Sep 2020 07:44:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726477AbgI1Lol (ORCPT ); Mon, 28 Sep 2020 07:44:41 -0400 Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0266C061755 for ; Mon, 28 Sep 2020 04:44:41 -0700 (PDT) Received: by mail-pf1-x442.google.com with SMTP id f18so743874pfa.10 for ; Mon, 28 Sep 2020 04:44:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=MScz8qgOEcJMNFyXsLi4DRQ4XJsmdKpa2t/CJVpa96s=; b=C65Iz9ShCQOmduaJmR/0Ae07RDIQIPgl26c9uxshcvb2WKM6m8VM1F7sFwpJ5iYCTa aBlS4XJOm+EcrNY394C4GhyxDGBV8y1JpbSg7dC8wysfFqNtvT2F+XLGCHPN8BIbjQGz rMIo87uce3MYl4sImKpPNXOeSFIi4dnhWlZNw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=MScz8qgOEcJMNFyXsLi4DRQ4XJsmdKpa2t/CJVpa96s=; b=RqTOUcbwZG+oL42MXt7CsRO/Mp3GrENDErx3+GcdCBU3fdPv14fpEsbmYrpvpCrJVV wB7NM6tgXTA26N8QiPRh4Ke1pkIRPTAQk77wJy8hltpGOsWQP0qE+xE8zYrZCWE2CXts MPDl8gmzC6VZdD7TPQgAK+5H6tlvRVaY+dhXOEyHgBC8ZkvonjB6wFRpUEufSUX7Ps+a nrIfKg2zY+03FaMdbXh5BVpKVYJCH6rXw3FORn9lmRy/LVVsJPkPvsm227X83q8GhM1J dEDNtFV/l61jKCcNzwQidUDMIXgO0IQWhgShs6Uy0acjBghAWHUIPZz4h66kND568xNs cJWw== X-Gm-Message-State: AOAM531OTQXXQtzYl053lcg81Y4RMgNQK0LM9jYMm+L40ANwH/qR4lU3 zAmmO5eS4ufOrdtgYohiu8Yr9Jg8jJ5q+I8ICfQ5+WJ57YF8OC93BXXS7FUOC+LxhV/530PqE6o zxujNozULNjh5Wgcf1xC2nd6pc8J7Hm7RR+x6m+4VIYy8Tb7ntEHXLSORrr7LXnMHDOV44IU0V/ IQ77251R4K X-Google-Smtp-Source: ABdhPJw51E5epEnrlcBoTyvWksyIf3k3CPe1vw7VkTfqlkZVNiQQhCoTOCbSJqt1BHF3Vgz9clktJg== X-Received: by 2002:a17:902:a618:b029:d2:6379:ac0c with SMTP id u24-20020a170902a618b02900d26379ac0cmr1248403plq.82.1601293480600; Mon, 28 Sep 2020 04:44:40 -0700 (PDT) Received: from localhost.localdomain ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id w19sm1468866pfq.60.2020.09.28.04.44.38 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Sep 2020 04:44:40 -0700 (PDT) From: Muneendra To: linux-scsi@vger.kernel.org, hare@suse.de Cc: jsmart2021@gmail.com, emilne@redhat.com, mkumar@redhat.com, Muneendra Subject: [PATCH v2 4/8] scsi: No retries on abort success Date: Mon, 28 Sep 2020 10:20:53 +0530 Message-Id: <1601268657-940-5-git-send-email-muneendra.kumar@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1601268657-940-1-git-send-email-muneendra.kumar@broadcom.com> References: <1601268657-940-1-git-send-email-muneendra.kumar@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Made an additional check in scsi_noretry_cmd to verify whether user has decided not to do retries on abort success by setting the SCMD_NORETRIES_ABORT bit If SCMD_NORETRIES_ABORT bit is set we are making sure there won't be any retries done on the same path and also setting the host byte as DID_TRANSPORT_MARGINAL so that the error can be propogated as recoverable transport error to the blk layers. Signed-off-by: Muneendra --- v2: set the hostbyte as DID_TRANSPORT_MARGINAL instead of DID_TRANSPORT_FAILFAST. --- drivers/scsi/scsi_error.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index 5f3726abed78..3f14ea10d5da 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@ -1748,6 +1748,16 @@ int scsi_noretry_cmd(struct scsi_cmnd *scmd) return 0; check_type: + /* + * Check whether caller has decided not to do retries on + * abort success by setting the SCMD_NORETRIES_ABORT bit + */ + if ((test_bit(SCMD_NORETRIES_ABORT, &scmd->state)) && + (scmd->request->cmd_flags & REQ_FAILFAST_TRANSPORT)) { + set_host_byte(scmd, DID_TRANSPORT_MARGINAL); + return 1; + } + /* * assume caller has checked sense and determined * the check condition was retryable.