From patchwork Mon Nov 9 04:24:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muneendra Kumar X-Patchwork-Id: 321788 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.2 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 BFE14C388F7 for ; Mon, 9 Nov 2020 11:18:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5B906206E5 for ; Mon, 9 Nov 2020 11:18:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="einMT9gx" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729520AbgKILST (ORCPT ); Mon, 9 Nov 2020 06:18:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728462AbgKILSS (ORCPT ); Mon, 9 Nov 2020 06:18:18 -0500 Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B309BC0613CF for ; Mon, 9 Nov 2020 03:18:18 -0800 (PST) Received: by mail-pl1-x642.google.com with SMTP id t6so4569124plq.11 for ; Mon, 09 Nov 2020 03:18:18 -0800 (PST) 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=5FLd1Y+k2rIGOQ2qL6zJ2X3/ft242CADGCklQeivQkw=; b=einMT9gxoJHOAFu4JuPjdxDCy1RbVkQPYlX783MzIQY7WubdRjF/99H4WA1zJKAAzE haBCMa6t/pAkV1zhgR4L4bCOxLGM6rqP0IdlwMXC2wQj+Aub5C+i3yg6Wox9pbuF+RNj kePW9xkenLD1cyL0oBkHQSNFEa4+32IU+Xnpw= 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=5FLd1Y+k2rIGOQ2qL6zJ2X3/ft242CADGCklQeivQkw=; b=H3lmpth9o9izATgCXtIav5DllKkrWn/E2m8JyfuoHOTYJ3s1aHHhxG4X5G/rqoH79v SjFY4xsSglCAcxsLEgH3b0Kzs9baCacobSJ5qG6lkt9StxtDvKk7P22qnbgHgAp7YZmg r/4iA9TkVZtdgjq/28ODH9sPivC8n9om2dEzkXPLbG/MwJNhpulEXaYbfsMmE2lInS0t PtPhQZnhpm2qFe7sJBfPSKT4Sn5eir+JVCRs5NN9huMB7L+fpA3XBihKfp4iz5oJoMsS wpFjhdihjg9VMtqaqz4c4xhK9+RLfoT3sNK33COgqxtETowR8O8Xby9Kjymkailkn4pP wYlw== X-Gm-Message-State: AOAM531UikdX0IVz6mtIcr0h4pskhltG7K3y47TKdpPA0sqQxJmZRozK fRFQB8mo/Bf5uJUunu9ZNw2QRg== X-Google-Smtp-Source: ABdhPJxcPkQeVrey5D0LUH/bkdu8avuYIvEzA/i6HmJpldjcKKraF+0u2X5cjVzMy3HiZIKRM2QwGg== X-Received: by 2002:a17:902:7487:b029:d6:c03b:bce4 with SMTP id h7-20020a1709027487b02900d6c03bbce4mr12440956pll.36.1604920698197; Mon, 09 Nov 2020 03:18:18 -0800 (PST) Received: from localhost.localdomain ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id k9sm10889364pfp.68.2020.11.09.03.18.15 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Nov 2020 03:18:17 -0800 (PST) From: Muneendra To: linux-block@vger.kernel.org, linux-scsi@vger.kernel.org, tj@kernel.org, linux-nvme@lists.infradead.org Cc: jsmart2021@gmail.com, emilne@redhat.com, mkumar@redhat.com, pbonzini@redhat.com, Gaurav Srivastava Subject: [PATCH v4 15/19] lpfc: vmid: Appends the vmid in the wqe before sending request Date: Mon, 9 Nov 2020 09:54:01 +0530 Message-Id: <1604895845-2587-16-git-send-email-muneendra.kumar@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1604895845-2587-1-git-send-email-muneendra.kumar@broadcom.com> References: <1604895845-2587-1-git-send-email-muneendra.kumar@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Gaurav Srivastava This patch adds the vmid in wqe before sending out the request. The type of vmid depends on the configured type and is checked before being appended. Signed-off-by: Gaurav Srivastava Signed-off-by: James Smart Reviewed-by: Hannes Reinecke --- v4: No change v3: No change v2: Ported the patch on top of 5.10/scsi-queue --- drivers/scsi/lpfc/lpfc_sli.c | 56 +++++++++++++++++++++++++++++++++++- 1 file changed, 55 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index 51b99b7beaf9..53dbd6a3f460 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c @@ -3724,7 +3724,7 @@ lpfc_sli_sp_handle_rspiocb(struct lpfc_hba *phba, struct lpfc_sli_ring *pring, if (irsp->ulpStatus) { /* Rsp ring error: IOCB */ - lpfc_printf_log(phba, KERN_WARNING, LOG_SLI, + lpfc_printf_log(phba, KERN_ERR, LOG_SLI, "0328 Rsp Ring %d error: " "IOCB Data: " "x%x x%x x%x x%x " @@ -9625,6 +9625,8 @@ lpfc_sli4_iocb2wqe(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq, *pcmd == ELS_CMD_RSCN_XMT || *pcmd == ELS_CMD_FDISC || *pcmd == ELS_CMD_LOGO || + *pcmd == ELS_CMD_QFPA || + *pcmd == ELS_CMD_UVEM || *pcmd == ELS_CMD_PLOGI)) { bf_set(els_req64_sp, &wqe->els_req, 1); bf_set(els_req64_sid, &wqe->els_req, @@ -9756,6 +9758,24 @@ lpfc_sli4_iocb2wqe(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq, ptr = &wqe->words[22]; memcpy(ptr, fcp_cmnd, sizeof(struct fcp_cmnd)); } + + /* add the VMID tags as per the switch */ + if (iocbq->iocb_flag & LPFC_IO_VMID) { + union lpfc_wqe128 *wqe128; + + if (phba->pport->vmid_priority_tagging) { + bf_set(wqe_ccpe, &wqe->fcp_iwrite.wqe_com, 1); + bf_set(wqe_ccp, &wqe->fcp_iwrite.wqe_com, + (iocbq->vmid_tag.cs_ctl_vmid)); + /* Bit 0 must be 0 */ + } else { + wqe128 = (union lpfc_wqe128 *)wqe; + bf_set(wqe_appid, &wqe->fcp_iwrite.wqe_com, 1); + bf_set(wqe_wqes, &wqe128->fcp_iwrite.wqe_com, + 1); + wqe128->words[31] = iocbq->vmid_tag.app_id; + } + } break; case CMD_FCP_IREAD64_CR: /* word3 iocb=iotag wqe=payload_offset_len */ @@ -9820,6 +9840,23 @@ lpfc_sli4_iocb2wqe(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq, ptr = &wqe->words[22]; memcpy(ptr, fcp_cmnd, sizeof(struct fcp_cmnd)); } + + /* add the VMID tags as per the switch */ + if (iocbq->iocb_flag & LPFC_IO_VMID) { + union lpfc_wqe128 *wqe128; + + if (phba->pport->vmid_priority_tagging) { + bf_set(wqe_ccpe, &wqe->fcp_iread.wqe_com, 1); + bf_set(wqe_ccp, &wqe->fcp_iread.wqe_com, + (iocbq->vmid_tag.cs_ctl_vmid)); + /* Bit 0 must be 0 */ + } else { + wqe128 = (union lpfc_wqe128 *)wqe; + bf_set(wqe_appid, &wqe->fcp_iread.wqe_com, 1); + bf_set(wqe_wqes, &wqe128->fcp_iread.wqe_com, 1); + wqe128->words[31] = iocbq->vmid_tag.app_id; + } + } break; case CMD_FCP_ICMND64_CR: /* word3 iocb=iotag wqe=payload_offset_len */ @@ -9877,6 +9914,23 @@ lpfc_sli4_iocb2wqe(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq, ptr = &wqe->words[22]; memcpy(ptr, fcp_cmnd, sizeof(struct fcp_cmnd)); } + + /* add the VMID tags as per the switch */ + if (iocbq->iocb_flag & LPFC_IO_VMID) { + union lpfc_wqe128 *wqe128; + + if (phba->pport->vmid_priority_tagging) { + bf_set(wqe_ccpe, &wqe->fcp_icmd.wqe_com, 1); + bf_set(wqe_ccp, &wqe->fcp_icmd.wqe_com, + (iocbq->vmid_tag.cs_ctl_vmid)); + /* Bit 0 must be 0 */ + } else { + wqe128 = (union lpfc_wqe128 *)wqe; + bf_set(wqe_appid, &wqe->fcp_icmd.wqe_com, 1); + bf_set(wqe_wqes, &wqe128->fcp_icmd.wqe_com, 1); + wqe128->words[31] = iocbq->vmid_tag.app_id; + } + } break; case CMD_GEN_REQUEST64_CR: /* For this command calculate the xmit length of the