From patchwork Mon Sep 28 04:50:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muneendra Kumar X-Patchwork-Id: 287311 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=-4.5 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, MAILING_LIST_MULTI, MIME_HEADER_CTYPE_ONLY, MIME_NO_TEXT, SPF_HELO_NONE, SPF_PASS, T_TVD_MIME_NO_HEADERS, USER_AGENT_GIT autolearn=no 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 02BE4C2D0A8 for ; Mon, 28 Sep 2020 11:44:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 92FF92100A for ; Mon, 28 Sep 2020 11:44:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="WQb4Sp8w" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726558AbgI1Lob (ORCPT ); Mon, 28 Sep 2020 07:44:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726477AbgI1Lob (ORCPT ); Mon, 28 Sep 2020 07:44:31 -0400 Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C788C061755 for ; Mon, 28 Sep 2020 04:44:31 -0700 (PDT) Received: by mail-pg1-x542.google.com with SMTP id o25so651567pgm.0 for ; Mon, 28 Sep 2020 04:44:31 -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; bh=obUBtPxlORffaS4hciBC4CdSk5D4Hq4oKXBW6EAVC0E=; b=WQb4Sp8w+Be59ok7wgudJMnxyqhKi1VkuNldJe4cPQ8SJgdib978/Me58pk+9axMxv zZCHpz/jyT5l0+4PqW0IY4Ch4DgLM80M878HPMxmqtl9dgoDmYpqhVj1tz/GAbArEIP3 Gp/YcstySHOV8cm5ViXlSKeqrnzBAPM1LDB58= 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; bh=obUBtPxlORffaS4hciBC4CdSk5D4Hq4oKXBW6EAVC0E=; b=S/JUS2LhEj8VcrUKYD1UxKYTKT8EDSYdWg6s+DsJv8NURPpDviSHyM5Ho18d2yKQM6 NKLH/KDQplyDGZbXIqoTjdIUtTY85Fi1EFr9VTbvzT+IwjsH9bXdXnWr0p4D9NzE1wml BrjHWICNmC2iksmqQih4ICsV2PLDLVVFD0VoaSj1fr2XV5EW656Hh2bbACahVSvx7bkf oK+uQcqdVbOSjtfbn68CLKSU296jgSxWAwnapRqEtVlOlmIO76hrY8VOV20oSbS3iDBT oQYmNDVNXnve0W/BTO59ndQgWvgmgEAq03bXBDWXruCIpODTnXc3DGk51C5lFPM8UGqd ER1Q== X-Gm-Message-State: AOAM533mAat2ie+hur9lw6L05A2yx7PzMM8mT1TF8tkND6K+no9GYsSj yCW4MpxgVHrKTAdsUKbUuUaxDOO6DiDZu+3VNMIHi69ulRkAsgqqHsi35AqwrDSY4OElruBbJbt tzIs8wqm5l6pXIbFsvCWuclyPXb+YjS0iRkJOA0mSCnl53vfS/IHwnzHUW7QBENGAvn41yusShW DPNOaOjgNN X-Google-Smtp-Source: ABdhPJzoZBfKoJZAzsBK1BeKv5BG4rVIwCHVJXUBrjnrMka1z3tWxTKK/gv/mKBc4KFgiO2PUf1P0A== X-Received: by 2002:a62:6044:0:b029:151:1a04:895 with SMTP id u65-20020a6260440000b02901511a040895mr1069346pfb.34.1601293469882; Mon, 28 Sep 2020 04:44:29 -0700 (PDT) Received: from localhost.localdomain ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id w19sm1468866pfq.60.2020.09.28.04.44.27 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Sep 2020 04:44:28 -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 0/8] scsi: Support to handle Intermittent errors Date: Mon, 28 Sep 2020 10:20:49 +0530 Message-Id: <1601268657-940-1-git-send-email-muneendra.kumar@broadcom.com> X-Mailer: git-send-email 1.8.3.1 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org This patch adds a support to prevent retries of all the pending/inflight io's after an abort succeeds on a particular device when transport connectivity to the device is encountering intermittent errors. Intermittent connectivity is a condition that can be detected by transport fabric notifications. A service can monitor the ELS notifications and take action on all the outstanding io's of a scsi device at that instant. This feature is intended to be used when the device is part of a multipath environment. When the service detects the poor connectivity, the multipath path can be placed in a marginal path group and ignored further io operations. After placing a path in the marginal path group,the daemon sets the port_state to Marginal which sets bit in scmd->state for all the outstanding io's on that particular device with the new sysfs interface provided in this patch.This prevent retries of all the pending/inflight io's if an io hits a scsi timeout which inturn issues an abort. On Abort succeeds on a marginal path the io will be immediately retried on another active path.On abort fails then the things escalates to existing target reset sg interface recovery process. Below is the interface provided to set the port state to Marginal and Online. echo "Marginal" >> /sys/class/fc_transport/targetX\:Y\:Z/port_state echo "Online" >> /sys/class/fc_transport/targetX\:Y\:Z/port_state The patches were cut against 5.10/scsi-queue tree --- v2: Added new error code DID_TRANSPORT_MARGINAL to handle marginal errors. Added a new rport_state FC_PORTSTATE_MARGINAL and also added a new sysfs interface port_state to set the port_state to marginal. Added the support in lpfc to handle the marginal state. Muneendra (8): scsi: Added a new definition in scsi_cmnd.h scsi: Added a new error code in scsi.h scsi: Clear state bit SCMD_NORETRIES_ABORT of scsi_cmd before start request scsi: No retries on abort success scsi: Added routine to set/clear SCMD_NORETRIES_ABORT bit for outstanding io on scsi_dev scsi_transport_fc: Added a new rport state FC_PORTSTATE_MARGINAL scsi_transport_fc: Added a new sysfs attribute port_state lpfc: Added support to handle marginal state drivers/scsi/lpfc/lpfc_scsi.c | 6 ++ drivers/scsi/scsi_error.c | 86 +++++++++++++++++++ drivers/scsi/scsi_lib.c | 2 + drivers/scsi/scsi_priv.h | 2 + drivers/scsi/scsi_transport_fc.c | 140 +++++++++++++++++++++++++++---- include/scsi/scsi.h | 1 + include/scsi/scsi_cmnd.h | 3 + include/scsi/scsi_transport_fc.h | 24 ++++++ 8 files changed, 246 insertions(+), 18 deletions(-)