scsi: lpfc: Introduce 128G link speed selection and support

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>
This commit is contained in:
Justin Tee
2026-03-31 13:59:26 -07:00
committed by Martin K. Petersen
parent a1421afa0d
commit 39d1d94166
6 changed files with 46 additions and 20 deletions

View 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,

View 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:

View 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) {
return true;
default:
return false;
}
}
switch (phba->fc_linkspeed) {
case LPFC_LINK_SPEED_128GHZ:
case LPFC_LINK_SPEED_64GHZ:
return true;
default:
return false;
}
return false;
}
/**

View 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 @@ lpfc_mbx_cmpl_ns_reg_login(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
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 {

View 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;

View 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;