All of lore.kernel.org
 help / color / mirror / Atom feed
From: Muneendra <muneendra.kumar@broadcom.com>
To: linux-block@vger.kernel.org, linux-scsi@vger.kernel.org
Cc: pbonzini@redhat.com, emilne@redhat.com, mkumar@redhat.com,
	Gaurav Srivastava <gaurav.srivastava@broadcom.com>,
	James Smart <jsmart2021@gmail.com>,
	Muneendra <muneendra.kumar@broadcom.com>
Subject: [RFC 13/16] lpfc: vmid: Appends the vmid in the wqe before sending request
Date: Tue,  4 Aug 2020 07:43:13 +0530	[thread overview]
Message-ID: <1596507196-27417-14-git-send-email-muneendra.kumar@broadcom.com> (raw)
In-Reply-To: <1596507196-27417-1-git-send-email-muneendra.kumar@broadcom.com>

From: Gaurav Srivastava <gaurav.srivastava@broadcom.com>

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  <gaurav.srivastava@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
Signed-off-by: Muneendra <muneendra.kumar@broadcom.com>
---
 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 bf006ec4ceb1..c5d6c1a927fb 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 <ringno> 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
-- 
2.18.2


  parent reply	other threads:[~2020-08-04  9:07 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-04  2:13 [RFC 00/16] Application specific identification support Muneendra
2020-08-04  2:13 ` [RFC 01/16] blkcg:Introduce blkio.app_identifier knob to blkio controller Muneendra
2020-08-04 11:31   ` Daniel Wagner
2020-08-04 14:21     ` Tejun Heo
2020-08-05  0:39       ` James Smart
2020-08-05  3:59         ` Ming Lei
2020-08-05  6:33           ` Hannes Reinecke
2020-08-05 14:39             ` Tejun Heo
2020-08-05 17:14               ` Muneendra Kumar M
2020-08-05 17:31                 ` Tejun Heo
2020-08-06  2:22                 ` Ming Lei
2020-08-06 12:31                   ` Muneendra Kumar M
2020-08-06 13:41                   ` Paolo Bonzini
2020-08-04  2:13 ` [RFC 02/16] lpfc: vmid: Add the datastructure for supporting VMID in lpfc Muneendra
2020-08-04  2:13 ` [RFC 03/16] lpfc: vmid: API to check if VMID is enabled Muneendra
2020-08-04  2:13 ` [RFC 04/16] lpfc: vmid: Supplementary data structures for vmid Muneendra
2020-08-04  2:13 ` [RFC 05/16] lpfc: vmid: Forward declarations for APIs Muneendra
2020-08-04  2:13 ` [RFC 06/16] lpfc: vmid: Add support for vmid in mailbox command Muneendra
2020-08-04  2:13 ` [RFC 07/16] lpfc: vmid: VMID params initialization Muneendra
2020-08-04  2:13 ` [RFC 08/16] lpfc: vmid: vmid resource allocation Muneendra
2020-08-04  2:13 ` [RFC 09/16] lpfc: vmid: cleanup vmid resources Muneendra
2020-08-04  2:13 ` [RFC 10/16] lpfc: vmid: Implements ELS commands for appid patch Muneendra
2020-08-04  2:13 ` [RFC 11/16] lpfc: vmid: Functions to manage vmids Muneendra
2020-08-04  2:13 ` [RFC 12/16] lpfc: vmid: Implements CT commands for appid Muneendra
2020-08-04  2:13 ` Muneendra [this message]
2020-08-04  2:13 ` [RFC 14/16] lpfc: vmid: Timeout implementation for vmid Muneendra
2020-08-04  2:13 ` [RFC 15/16] lpfc: vmid: Adding qfpa and vmid timeout check in worker thread Muneendra
2020-08-04  2:13 ` [RFC 16/16] lpfc: vmid: Introducing vmid in io path Muneendra
2020-08-05  7:16   ` Hannes Reinecke
2020-08-05 23:38     ` James Smart
2020-08-06 12:34       ` Muneendra Kumar M
2020-08-06 14:32         ` Paolo Bonzini
2020-08-06 16:26           ` Muneendra Kumar M
2020-08-06 18:41             ` Paolo Bonzini
2020-08-07 11:24               ` Muneendra Kumar M
2020-08-07 11:38                 ` Paolo Bonzini
2020-08-07 12:17                   ` Muneendra Kumar M
2020-08-10  9:03                     ` Paolo Bonzini
2020-08-10 12:13                       ` Muneendra Kumar M
2020-08-12  7:54                         ` Paolo Bonzini
2020-08-12 12:16                           ` Muneendra Kumar M
2020-08-07 12:32                   ` Muneendra Kumar M
2020-08-11 23:48             ` James Smart
2020-08-06 14:41         ` Tejun Heo
2020-08-06 14:46           ` Paolo Bonzini
2020-08-06 14:48             ` Tejun Heo
2020-08-06 14:54               ` Paolo Bonzini
2020-08-06 14:59                 ` Tejun Heo
2020-08-06 18:39                   ` Paolo Bonzini
2020-08-06 18:49                     ` Tejun Heo
2020-08-06 19:20                       ` Paolo Bonzini
2020-08-06 19:32                         ` Tejun Heo
2020-08-07 12:14                           ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1596507196-27417-14-git-send-email-muneendra.kumar@broadcom.com \
    --to=muneendra.kumar@broadcom.com \
    --cc=emilne@redhat.com \
    --cc=gaurav.srivastava@broadcom.com \
    --cc=jsmart2021@gmail.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mkumar@redhat.com \
    --cc=pbonzini@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.