From patchwork Tue Jan 30 23:58:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 10192931 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 602F760291 for ; Tue, 30 Jan 2018 23:59:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5267127F54 for ; Tue, 30 Jan 2018 23:59:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4748027FAC; Tue, 30 Jan 2018 23:59:36 +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 E020327F54 for ; Tue, 30 Jan 2018 23:59:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754179AbeA3X7e (ORCPT ); Tue, 30 Jan 2018 18:59:34 -0500 Received: from mail-qt0-f194.google.com ([209.85.216.194]:37621 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753842AbeA3X7b (ORCPT ); Tue, 30 Jan 2018 18:59:31 -0500 Received: by mail-qt0-f194.google.com with SMTP id d54so19652873qtd.4 for ; Tue, 30 Jan 2018 15:59:31 -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=Y2JQyY1HkrHuzb1UgAF7tCINdxUIGC6yRWw7qeeE4js=; b=pbc9Umi8DZbJZ2NihP+zsSd8rN+Hw5gRR+jdrwZOrx51HnlNVy3AwsHpl/5bs6aTos kfon/qZ4JGfqj340nVZZ2RgNuJh/zuViiZho2kHTsj3XlZ0dmQVWj+8g7meff1LDrF1S WlhFFaUUCJLZi20kO29mR2vwef6Bci8PdheykAvmMZa4os4OqYXqoEry8gDdc8M/3rGW +SHq1Y3cG8RiJeMoi/3sKaQSBST/C4WeiMyZkzxiTqyLSCNT5F6++08967+EYplVp+zD UKR8Qgo4Z4dqnhAnql6FwiVCqhNYfGIUztHHoAtv5kiPQlQcYLEpLX7JxBzqjzLQ4rmA 1Pbw== 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=Y2JQyY1HkrHuzb1UgAF7tCINdxUIGC6yRWw7qeeE4js=; b=KKfzVsUjSfG///U9+w+N26xNuRWeGUNhbScwKFCAf0siv5UZSAgHUao5i2wycO/Z1v 449JZQbM3frVsaSKLg6RSSWrOn9otKlUvu55fRif+nhIgw+Z/Zf41TMvk80oODACiJKq 1R+uCE462T6wWDmmcwJXveLG4BVgFtizsacFM1decx6uR0y0rTeneNmQjvCyOxwV1C/z g2Gggm3OolRYciv4DusZq5d5Hd8/1GyB2zTk9LxLsHd6MkPTuihW7O9XSWUItXA/cVyS ieCJjropIrNrYK5WPucbBqRjfbM+yYyKHaezVXq4Njy6jez9lRUCblB2Lnp95W/+1mz0 1M7g== X-Gm-Message-State: AKwxytcxOk6OuGCiRlQU+8sZPsnnc0duBUaS5ddfd+kj2fE+DiDEgvPT 84L/0CLz1AStC/GwzuYLmE5YcQ== X-Google-Smtp-Source: AH8x226wn3FMnmc203avnPdUwh/70YRLiF3H1anvQzLcUCCaED3wvLBSrcGSS2mn8dMKQVgnP/7XQA== X-Received: by 10.237.60.74 with SMTP id u10mr49555873qte.235.1517356770457; Tue, 30 Jan 2018 15:59:30 -0800 (PST) Received: from pallmd1.broadcom.com ([192.19.223.250]) by smtp.gmail.com with ESMTPSA id i39sm12438537qte.19.2018.01.30.15.59.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 30 Jan 2018 15:59:30 -0800 (PST) From: James Smart To: linux-scsi@vger.kernel.org Cc: James Smart , Dick Kennedy , James Smart Subject: [PATCH v3 14/19] lpfc: Validate adapter support for SRIU option Date: Tue, 30 Jan 2018 15:58:58 -0800 Message-Id: <20180130235903.5316-15-jsmart2021@gmail.com> X-Mailer: git-send-email 2.13.1 In-Reply-To: <20180130235903.5316-1-jsmart2021@gmail.com> References: <20180130235903.5316-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 Reviewed-by: Hannes Reinecke --- 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 aa7872a7b493..f2d2faef8710 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);