From patchwork Fri Jan 26 19:22:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 10186925 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 96DCC601D5 for ; Fri, 26 Jan 2018 19:23:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 891CD29D9E for ; Fri, 26 Jan 2018 19:23:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7DB4429DDC; Fri, 26 Jan 2018 19:23:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1B15029D9E for ; Fri, 26 Jan 2018 19:23:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753012AbeAZTX2 (ORCPT ); Fri, 26 Jan 2018 14:23:28 -0500 Received: from mail-qt0-f194.google.com ([209.85.216.194]:39764 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752870AbeAZTXK (ORCPT ); Fri, 26 Jan 2018 14:23:10 -0500 Received: by mail-qt0-f194.google.com with SMTP id f4so3955625qtj.6 for ; Fri, 26 Jan 2018 11:23:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=0Z+Jy2JsFvXQg4g9jOLRybz+920Jsjg/pukgyvnYLEY=; b=sm6+6B3W6QP8KPnqVt9tSPuFwgTDGmIGa0R9PqeyxUymElsFbsuI/lwfTACYu/yfTV Y5DNOkfhzEHC0Tb7heVKLixPMiS1mdLPzW7uOvC4anX0l9uHg11X4NlGotFDG7FJD6Z7 YFtC0+tOSelRzzrJTcrrTZNDOzeIEQlej5IgMr/WIIgPS+AgxESl5hYeE6/3IXwOPKkI E3dH+3+IjovSaOQTGcB2zAXCRX5tK3T0wBk1pvrm4Y6rmqGaPMS911YByWA3LijW7FKp YBaqfW/ubOjlOIMQo0Hj6ZtolAHnDLzbmc0NMibzu9/jVAxtXjuobmXxXeqWmIqSot9Q zcag== 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=0Z+Jy2JsFvXQg4g9jOLRybz+920Jsjg/pukgyvnYLEY=; b=uY1ptOQNc04Heqph1AIlK4OeHLBkvHI4bmI8zyhF8P8idyOdBPy8tcAYkmOG1Jygoq abSI/pfyoe0VetMgF7zjihYOZSdR9AraILizS8FKn0vPtK/Zbx51weI0loIyV9eSJjxF xwOSnC8SUlJUbsC4hxX0O/7s2JT365UtA5zPmmgMydYqm85BDZJUMH9Jnjk1QJLMcFtW TCT3k1zGBFExeo5IsGC5c57WKYiSBBuyiDbiRUB32WkG/dmspCHJsYcwKR8NAo9sm9bk P5W7eWjEBScGboDCPkfGS8KjYyM6Mn+dwKKZW6MM0XNQcCvt0e0lAufe5vKcqnYYnVUd ERFw== X-Gm-Message-State: AKwxyteBWKQPJRRYGRAxTZQOHYHfvXYjLm9d4mqZJbFGvSsCLWlumnMN OZse97knTGa7w18l1TpMPRGjuQ== X-Google-Smtp-Source: AH8x226+zTk8ubq9NOjO2uYERA8AK8FmmRJzdOhyfzj911TIS+oqjQjdjA3ddsZc1YqmaTIDrgt8FA== X-Received: by 10.200.0.89 with SMTP id i25mr8747463qtg.85.1516994589359; Fri, 26 Jan 2018 11:23:09 -0800 (PST) Received: from pallmd1.broadcom.com ([192.19.223.250]) by smtp.gmail.com with ESMTPSA id f129sm3811300qke.82.2018.01.26.11.23.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 26 Jan 2018 11:23:09 -0800 (PST) From: James Smart To: linux-scsi@vger.kernel.org Cc: James Smart , Dick Kennedy , James Smart Subject: [PATCH v2 14/19] lpfc: Validate adapter support for SRIU option Date: Fri, 26 Jan 2018 11:22:34 -0800 Message-Id: <20180126192239.10727-15-jsmart2021@gmail.com> X-Mailer: git-send-email 2.13.1 In-Reply-To: <20180126192239.10727-1-jsmart2021@gmail.com> References: <20180126192239.10727-1-jsmart2021@gmail.com> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When using the special option to suppress the response iu, ensure the adapter fully supports the feature by checking feature flags from the adapter and validating the support when formatting the WQE. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- v2: Add missing snippet that changes check logic before enabling suppression in lpfc_nvmet_prep_fcp_wqe() drivers/scsi/lpfc/lpfc_hw4.h | 3 +++ drivers/scsi/lpfc/lpfc_init.c | 13 ++++++++++++- drivers/scsi/lpfc/lpfc_nvmet.c | 7 ++++--- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_hw4.h b/drivers/scsi/lpfc/lpfc_hw4.h index 7c3afc3d3121..52fe28ae50fa 100644 --- a/drivers/scsi/lpfc/lpfc_hw4.h +++ b/drivers/scsi/lpfc/lpfc_hw4.h @@ -3293,6 +3293,9 @@ struct lpfc_sli4_parameters { #define cfg_eqdr_SHIFT 8 #define cfg_eqdr_MASK 0x00000001 #define cfg_eqdr_WORD word19 +#define cfg_nosr_SHIFT 9 +#define cfg_nosr_MASK 0x00000001 +#define cfg_nosr_WORD word19 #define LPFC_NODELAY_MAX_IO 32 }; diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index 7fc2db968379..895b1da784ee 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c @@ -10473,8 +10473,19 @@ lpfc_get_sli4_parameters(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq) phba->cfg_enable_fc4_type = LPFC_ENABLE_FCP; } - if (bf_get(cfg_xib, mbx_sli4_parameters) && phba->cfg_suppress_rsp) + /* + * To support Suppress Response feature we must satisfy 3 conditions. + * lpfc_suppress_rsp module parameter must be set (default). + * In SLI4-Parameters Descriptor: + * Extended Inline Buffers (XIB) must be supported. + * Suppress Response IU Not Supported (SRIUNS) must NOT be supported + * (double negative). + */ + if (phba->cfg_suppress_rsp && bf_get(cfg_xib, mbx_sli4_parameters) && + !(bf_get(cfg_nosr, mbx_sli4_parameters))) phba->sli.sli_flag |= LPFC_SLI_SUPPRESS_RSP; + else + phba->cfg_suppress_rsp = 0; if (bf_get(cfg_eqdr, mbx_sli4_parameters)) phba->sli.sli_flag |= LPFC_SLI_USE_EQDR; diff --git a/drivers/scsi/lpfc/lpfc_nvmet.c b/drivers/scsi/lpfc/lpfc_nvmet.c index 0539585d32d4..6dd8535918f6 100644 --- a/drivers/scsi/lpfc/lpfc_nvmet.c +++ b/drivers/scsi/lpfc/lpfc_nvmet.c @@ -2290,9 +2290,10 @@ lpfc_nvmet_prep_fcp_wqe(struct lpfc_hba *phba, if (rsp->op == NVMET_FCOP_READDATA_RSP) { atomic_inc(&tgtp->xmt_fcp_read_rsp); bf_set(wqe_ar, &wqe->fcp_tsend.wqe_com, 1); - if ((ndlp->nlp_flag & NLP_SUPPRESS_RSP) && - (rsp->rsplen == 12)) { - bf_set(wqe_sup, &wqe->fcp_tsend.wqe_com, 1); + if (rsp->rsplen == LPFC_NVMET_SUCCESS_LEN) { + if (ndlp->nlp_flag & NLP_SUPPRESS_RSP) + bf_set(wqe_sup, + &wqe->fcp_tsend.wqe_com, 1); bf_set(wqe_wqes, &wqe->fcp_tsend.wqe_com, 0); bf_set(wqe_irsp, &wqe->fcp_tsend.wqe_com, 0); bf_set(wqe_irsplen, &wqe->fcp_tsend.wqe_com, 0);