]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
scsi: lpfc: Introduce 128G link speed selection and support
authorJustin Tee <justin.tee@broadcom.com>
Tue, 31 Mar 2026 20:59:26 +0000 (13:59 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 3 Apr 2026 01:34:02 +0000 (21:34 -0400)
128G link speed selection and support is added for various mailbox
commands, defines, and ACQE handling.  The default behavior to
autonegotiate supported link speed remains the same.

Signed-off-by: Justin Tee <justin.tee@broadcom.com>
Link: https://patch.msgid.link/20260331205928.119833-9-justintee8345@gmail.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/lpfc/lpfc.h
drivers/scsi/lpfc/lpfc_attr.c
drivers/scsi/lpfc/lpfc_els.c
drivers/scsi/lpfc/lpfc_hbadisc.c
drivers/scsi/lpfc/lpfc_init.c
drivers/scsi/lpfc/lpfc_mbox.c

index c92b96d0c325226e1f71e9e36885f53b95b83087..44b04ff9acc4f578af79d186495b2325f390ec76 100644 (file)
@@ -812,9 +812,10 @@ struct unsol_rcv_ct_ctx {
 #define LPFC_USER_LINK_SPEED_16G       16      /* 16 Gigabaud */
 #define LPFC_USER_LINK_SPEED_32G       32      /* 32 Gigabaud */
 #define LPFC_USER_LINK_SPEED_64G       64      /* 64 Gigabaud */
-#define LPFC_USER_LINK_SPEED_MAX       LPFC_USER_LINK_SPEED_64G
+#define LPFC_USER_LINK_SPEED_128G      128     /* 128 Gigabaud */
+#define LPFC_USER_LINK_SPEED_MAX       LPFC_USER_LINK_SPEED_128G
 
-#define LPFC_LINK_SPEED_STRING "0, 1, 2, 4, 8, 10, 16, 32, 64"
+#define LPFC_LINK_SPEED_STRING "0, 1, 2, 4, 8, 10, 16, 32, 64, 128"
 
 enum nemb_type {
        nemb_mse = 1,
index 9f7df51f893d0e4a8760d8a44ed623701614892b..c91fa44b12d493ab6a6e900b888adfaf366657bd 100644 (file)
@@ -4415,7 +4415,7 @@ static DEVICE_ATTR_RO(lpfc_static_vport);
 /*
 # lpfc_link_speed: Link speed selection for initializing the Fibre Channel
 # connection.
-# Value range is [0,16]. Default value is 0.
+# Value range is [0,128]. Default value is 0.
 */
 /**
  * lpfc_link_speed_store - Set the adapters link speed
@@ -4468,14 +4468,15 @@ lpfc_link_speed_store(struct device *dev, struct device_attribute *attr,
                "3055 lpfc_link_speed changed from %d to %d %s\n",
                phba->cfg_link_speed, val, nolip ? "(nolip)" : "(lip)");
 
-       if (((val == LPFC_USER_LINK_SPEED_1G) && !(phba->lmt & LMT_1Gb)) ||
-           ((val == LPFC_USER_LINK_SPEED_2G) && !(phba->lmt & LMT_2Gb)) ||
-           ((val == LPFC_USER_LINK_SPEED_4G) && !(phba->lmt & LMT_4Gb)) ||
-           ((val == LPFC_USER_LINK_SPEED_8G) && !(phba->lmt & LMT_8Gb)) ||
-           ((val == LPFC_USER_LINK_SPEED_10G) && !(phba->lmt & LMT_10Gb)) ||
-           ((val == LPFC_USER_LINK_SPEED_16G) && !(phba->lmt & LMT_16Gb)) ||
-           ((val == LPFC_USER_LINK_SPEED_32G) && !(phba->lmt & LMT_32Gb)) ||
-           ((val == LPFC_USER_LINK_SPEED_64G) && !(phba->lmt & LMT_64Gb))) {
+       if ((val == LPFC_USER_LINK_SPEED_1G && !(phba->lmt & LMT_1Gb)) ||
+           (val == LPFC_USER_LINK_SPEED_2G && !(phba->lmt & LMT_2Gb)) ||
+           (val == LPFC_USER_LINK_SPEED_4G && !(phba->lmt & LMT_4Gb)) ||
+           (val == LPFC_USER_LINK_SPEED_8G && !(phba->lmt & LMT_8Gb)) ||
+           (val == LPFC_USER_LINK_SPEED_10G && !(phba->lmt & LMT_10Gb)) ||
+           (val == LPFC_USER_LINK_SPEED_16G && !(phba->lmt & LMT_16Gb)) ||
+           (val == LPFC_USER_LINK_SPEED_32G && !(phba->lmt & LMT_32Gb)) ||
+           (val == LPFC_USER_LINK_SPEED_64G && !(phba->lmt & LMT_64Gb)) ||
+           (val == LPFC_USER_LINK_SPEED_128G && !(phba->lmt & LMT_128Gb))) {
                lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
                                "2879 lpfc_link_speed attribute cannot be set "
                                "to %d. Speed is not supported by this port.\n",
@@ -4500,6 +4501,7 @@ lpfc_link_speed_store(struct device *dev, struct device_attribute *attr,
        case LPFC_USER_LINK_SPEED_16G:
        case LPFC_USER_LINK_SPEED_32G:
        case LPFC_USER_LINK_SPEED_64G:
+       case LPFC_USER_LINK_SPEED_128G:
                prev_val = phba->cfg_link_speed;
                phba->cfg_link_speed = val;
                if (nolip)
@@ -4564,6 +4566,7 @@ lpfc_link_speed_init(struct lpfc_hba *phba, int val)
        case LPFC_USER_LINK_SPEED_16G:
        case LPFC_USER_LINK_SPEED_32G:
        case LPFC_USER_LINK_SPEED_64G:
+       case LPFC_USER_LINK_SPEED_128G:
                phba->cfg_link_speed = val;
                return 0;
        default:
index 10b3e6027a57a24d2e6eb64a1cf85cdba6923bd1..0f4b706bb14a36502b736a341ee42810f777c283 100644 (file)
@@ -4329,18 +4329,28 @@ lpfc_format_edc_cgn_desc(struct lpfc_hba *phba, struct fc_tlv_desc *tlv)
 static bool
 lpfc_link_is_lds_capable(struct lpfc_hba *phba)
 {
-       if (!(phba->lmt & LMT_64Gb))
+       if (!(phba->lmt & (LMT_64Gb | LMT_128Gb)))
                return false;
        if (phba->sli_rev != LPFC_SLI_REV4)
                return false;
 
        if (phba->sli4_hba.conf_trunk) {
-               if (phba->trunk_link.phy_lnk_speed == LPFC_USER_LINK_SPEED_64G)
+               switch (phba->trunk_link.phy_lnk_speed) {
+               case LPFC_USER_LINK_SPEED_128G:
+               case LPFC_USER_LINK_SPEED_64G:
                        return true;
-       } else if (phba->fc_linkspeed == LPFC_LINK_SPEED_64GHZ) {
+               default:
+                       return false;
+               }
+       }
+
+       switch (phba->fc_linkspeed) {
+       case LPFC_LINK_SPEED_128GHZ:
+       case LPFC_LINK_SPEED_64GHZ:
                return true;
+       default:
+               return false;
        }
-       return false;
 }
 
  /**
index 73e78e633d41b154cdf53aeb402c7044b349ede7..34f8d58192ce985ca8b96e3ee103aba866183ad8 100644 (file)
@@ -3817,7 +3817,7 @@ lpfc_mbx_cmpl_read_topology(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
                if (phba->cmf_active_mode != LPFC_CFG_OFF)
                        lpfc_cmf_signal_init(phba);
 
-               if (phba->lmt & LMT_64Gb)
+               if (phba->lmt & (LMT_64Gb | LMT_128Gb))
                        lpfc_read_lds_params(phba);
 
        } else if (attn_type == LPFC_ATT_LINK_DOWN ||
@@ -4410,7 +4410,7 @@ out:
                                        LOG_INIT | LOG_ELS | LOG_DISCOVERY,
                                        "4220 Issue EDC status x%x Data x%x\n",
                                        rc, phba->cgn_init_reg_signal);
-               } else if (phba->lmt & LMT_64Gb) {
+               } else if (phba->lmt & (LMT_64Gb | LMT_128Gb)) {
                        /* may send link fault capability descriptor */
                        lpfc_issue_els_edc(vport, 0);
                } else {
index 2e056bf3aef4a1366498d0ee77217814e4189c95..658556409d85cc8e4b93439f87fdbcef739fb623 100644 (file)
@@ -788,7 +788,9 @@ lpfc_hba_init_link_fc_topology(struct lpfc_hba *phba, uint32_t fc_topology,
            ((phba->cfg_link_speed == LPFC_USER_LINK_SPEED_32G) &&
             !(phba->lmt & LMT_32Gb)) ||
            ((phba->cfg_link_speed == LPFC_USER_LINK_SPEED_64G) &&
-            !(phba->lmt & LMT_64Gb))) {
+            !(phba->lmt & LMT_64Gb)) ||
+           ((phba->cfg_link_speed == LPFC_USER_LINK_SPEED_128G) &&
+            !(phba->lmt & LMT_128Gb))) {
                /* Reset link speed to auto */
                lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
                                "1302 Invalid speed for this board:%d "
@@ -2534,7 +2536,9 @@ lpfc_get_hba_model_desc(struct lpfc_hba *phba, uint8_t *mdp, uint8_t *descp)
                return;
        }
 
-       if (phba->lmt & LMT_64Gb)
+       if (phba->lmt & LMT_128Gb)
+               max_speed = 128;
+       else if (phba->lmt & LMT_64Gb)
                max_speed = 64;
        else if (phba->lmt & LMT_32Gb)
                max_speed = 32;
@@ -10146,6 +10150,10 @@ lpfc_sli4_read_config(struct lpfc_hba *phba)
                                phba->cfg_link_speed =
                                        LPFC_USER_LINK_SPEED_64G;
                                break;
+                       case LINK_SPEED_128G:
+                               phba->cfg_link_speed =
+                                       LPFC_USER_LINK_SPEED_128G;
+                               break;
                        case 0xffff:
                                phba->cfg_link_speed =
                                        LPFC_USER_LINK_SPEED_AUTO;
index 572db734880676b2e3497cae3c52fe522914c751..4c058904758d71f29c6b056488c842a0acee45e8 100644 (file)
@@ -625,6 +625,10 @@ lpfc_init_link(struct lpfc_hba * phba,
                        mb->un.varInitLnk.link_flags |= FLAGS_LINK_SPEED;
                        mb->un.varInitLnk.link_speed = LINK_SPEED_64G;
                        break;
+               case LPFC_USER_LINK_SPEED_128G:
+                       mb->un.varInitLnk.link_flags |= FLAGS_LINK_SPEED;
+                       mb->un.varInitLnk.link_speed = LINK_SPEED_128G;
+                       break;
                case LPFC_USER_LINK_SPEED_AUTO:
                default:
                        mb->un.varInitLnk.link_speed = LINK_SPEED_AUTO;