]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
scsi: lpfc: Update class of service bit field to 3 bits for WQE submissions
authorJustin Tee <justin.tee@broadcom.com>
Thu, 12 Feb 2026 21:30:05 +0000 (13:30 -0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 24 Feb 2026 18:06:52 +0000 (13:06 -0500)
WQE submissions only require a 3 bit field when specifying the class of
service to use.  So, update WQE submission paths to use a 3 bit field
instead of 0x0f as the bit mask.  A NLP_FCP_CLASS_MASK bitmask is
defined to ensure only a 3 bit mask is used.

Signed-off-by: Justin Tee <justin.tee@broadcom.com>
Link: https://patch.msgid.link/20260212213008.149873-11-justintee8345@gmail.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/lpfc/lpfc_disc.h
drivers/scsi/lpfc/lpfc_scsi.c

index de0adeecf668a02354a1b20fddf708ffc92322cc..a377e97cbe65106492312a7920c63449e2ac2ec2 100644 (file)
@@ -1,7 +1,7 @@
 /*******************************************************************
  * This file is part of the Emulex Linux Device Driver for         *
  * Fibre Channel Host Bus Adapters.                                *
- * Copyright (C) 2017-2025 Broadcom. All Rights Reserved. The term *
+ * Copyright (C) 2017-2026 Broadcom. All Rights Reserved. The term *
  * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries.     *
  * Copyright (C) 2004-2013 Emulex.  All rights reserved.           *
  * EMULEX and SLI are trademarks of Emulex.                        *
@@ -137,7 +137,8 @@ struct lpfc_nodelist {
        uint16_t        nlp_maxframe;           /* Max RCV frame size */
        uint8_t         nlp_class_sup;          /* Supported Classes */
        uint8_t         nlp_retry;              /* used for ELS retries */
-       uint8_t         nlp_fcp_info;           /* class info, bits 0-3 */
+       uint8_t         nlp_fcp_info;           /* class info, bits 0-2 */
+#define NLP_FCP_CLASS_MASK 0x07                        /* class info bitmask */
 #define NLP_FCP_2_DEVICE   0x10                        /* FCP-2 device */
        u8              nlp_nvme_info;          /* NVME NSLER Support */
        uint8_t         vmid_support;           /* destination VMID support */
index 69bf1ac6f846cec75f4da25ef3850456fcfa37c7..e9d27703bc44734c3565b37408287bfd3a826525 100644 (file)
@@ -1,7 +1,7 @@
 /*******************************************************************
  * This file is part of the Emulex Linux Device Driver for         *
  * Fibre Channel Host Bus Adapters.                                *
- * Copyright (C) 2017-2025 Broadcom. All Rights Reserved. The term *
+ * Copyright (C) 2017-2026 Broadcom. All Rights Reserved. The term *
  * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries.     *
  * Copyright (C) 2004-2016 Emulex.  All rights reserved.           *
  * EMULEX and SLI are trademarks of Emulex.                        *
@@ -4665,7 +4665,7 @@ static int lpfc_scsi_prep_cmnd_buf_s3(struct lpfc_vport *vport,
        else
                piocbq->iocb.ulpFCP2Rcvy = 0;
 
-       piocbq->iocb.ulpClass = (pnode->nlp_fcp_info & 0x0f);
+       piocbq->iocb.ulpClass = (pnode->nlp_fcp_info & NLP_FCP_CLASS_MASK);
        piocbq->io_buf  = lpfc_cmd;
        if (!piocbq->cmd_cmpl)
                piocbq->cmd_cmpl = lpfc_scsi_cmd_iocb_cmpl;
@@ -4777,7 +4777,7 @@ static int lpfc_scsi_prep_cmnd_buf_s4(struct lpfc_vport *vport,
                bf_set(wqe_erp, &wqe->generic.wqe_com, 1);
 
        bf_set(wqe_class, &wqe->generic.wqe_com,
-              (pnode->nlp_fcp_info & 0x0f));
+              (pnode->nlp_fcp_info & NLP_FCP_CLASS_MASK));
 
         /* Word 8 */
        wqe->generic.wqe_com.abort_tag = pwqeq->iotag;
@@ -4877,7 +4877,7 @@ lpfc_scsi_prep_task_mgmt_cmd_s3(struct lpfc_vport *vport,
        piocb->ulpCommand = CMD_FCP_ICMND64_CR;
        piocb->ulpContext = ndlp->nlp_rpi;
        piocb->ulpFCP2Rcvy = (ndlp->nlp_fcp_info & NLP_FCP_2_DEVICE) ? 1 : 0;
-       piocb->ulpClass = (ndlp->nlp_fcp_info & 0x0f);
+       piocb->ulpClass = (ndlp->nlp_fcp_info & NLP_FCP_CLASS_MASK);
        piocb->ulpPU = 0;
        piocb->un.fcpi.fcpi_parm = 0;
 
@@ -4945,7 +4945,7 @@ lpfc_scsi_prep_task_mgmt_cmd_s4(struct lpfc_vport *vport,
        bf_set(wqe_erp, &wqe->fcp_icmd.wqe_com,
               ((ndlp->nlp_fcp_info & NLP_FCP_2_DEVICE) ? 1 : 0));
        bf_set(wqe_class, &wqe->fcp_icmd.wqe_com,
-              (ndlp->nlp_fcp_info & 0x0f));
+              (ndlp->nlp_fcp_info & NLP_FCP_CLASS_MASK));
 
        /* ulpTimeout is only one byte */
        if (lpfc_cmd->timeout > 0xff) {