scsi: lpfc: Add 256 Gb link speed support
authorJames Smart <jsmart2021@gmail.com>
Thu, 22 Jul 2021 22:17:19 +0000 (15:17 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 27 Jul 2021 04:06:41 +0000 (00:06 -0400)
Update routines to support 256 Gb link speed for LPe37000/LPe38000
adapters. 256 Gb speeds can be seen on trunk links.

Link: https://lore.kernel.org/r/20210722221721.74388-5-jsmart2021@gmail.com
Co-developed-by: Justin Tee <justin.tee@broadcom.com>
Signed-off-by: Justin Tee <justin.tee@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/lpfc/lpfc_attr.c
drivers/scsi/lpfc/lpfc_ct.c
drivers/scsi/lpfc/lpfc_els.c
drivers/scsi/lpfc/lpfc_hbadisc.c
drivers/scsi/lpfc/lpfc_init.c
drivers/scsi/lpfc/lpfc_scsi.h

index a5154856bc0f698c4f8b95ef3027ade39bf4053e..869c2b6f1515901c2ceac2a86704e0fc54fa4558 100644 (file)
@@ -6745,6 +6745,9 @@ lpfc_get_host_speed(struct Scsi_Host *shost)
                case LPFC_LINK_SPEED_128GHZ:
                        fc_host_speed(shost) = FC_PORTSPEED_128GBIT;
                        break;
+               case LPFC_LINK_SPEED_256GHZ:
+                       fc_host_speed(shost) = FC_PORTSPEED_256GBIT;
+                       break;
                default:
                        fc_host_speed(shost) = FC_PORTSPEED_UNKNOWN;
                        break;
index 1acb8820a08e7beaeb0318629a0eacf80e0e8e86..a1c85fa135a90053ffa1733d82a9059181422af3 100644 (file)
@@ -2846,6 +2846,8 @@ lpfc_fdmi_port_attr_support_speed(struct lpfc_vport *vport,
 
        ae->un.AttrInt = 0;
        if (!(phba->hba_flag & HBA_FCOE_MODE)) {
+               if (phba->lmt & LMT_256Gb)
+                       ae->un.AttrInt |= HBA_PORTSPEED_256GFC;
                if (phba->lmt & LMT_128Gb)
                        ae->un.AttrInt |= HBA_PORTSPEED_128GFC;
                if (phba->lmt & LMT_64Gb)
@@ -2927,6 +2929,9 @@ lpfc_fdmi_port_attr_speed(struct lpfc_vport *vport,
                case LPFC_LINK_SPEED_128GHZ:
                        ae->un.AttrInt = HBA_PORTSPEED_128GFC;
                        break;
+               case LPFC_LINK_SPEED_256GHZ:
+                       ae->un.AttrInt = HBA_PORTSPEED_256GFC;
+                       break;
                default:
                        ae->un.AttrInt = HBA_PORTSPEED_UNKNOWN;
                        break;
index 342c7e28ee95c9cf32eb6ae0a87b09ce6b39fad1..08ae2b12b92c7621691f1c74283ffc5200d16edc 100644 (file)
@@ -6105,6 +6105,12 @@ lpfc_rdp_res_speed(struct fc_rdp_port_speed_desc *desc, struct lpfc_hba *phba)
        case LPFC_LINK_SPEED_64GHZ:
                rdp_speed = RDP_PS_64GB;
                break;
+       case LPFC_LINK_SPEED_128GHZ:
+               rdp_speed = RDP_PS_128GB;
+               break;
+       case LPFC_LINK_SPEED_256GHZ:
+               rdp_speed = RDP_PS_256GB;
+               break;
        default:
                rdp_speed = RDP_PS_UNKNOWN;
                break;
@@ -6112,6 +6118,8 @@ lpfc_rdp_res_speed(struct fc_rdp_port_speed_desc *desc, struct lpfc_hba *phba)
 
        desc->info.port_speed.speed = cpu_to_be16(rdp_speed);
 
+       if (phba->lmt & LMT_256Gb)
+               rdp_cap |= RDP_PS_256GB;
        if (phba->lmt & LMT_128Gb)
                rdp_cap |= RDP_PS_128GB;
        if (phba->lmt & LMT_64Gb)
index 32fb3be42b260d6db8e246b55ffa7f8cc68ffe83..6da2daf7d9e39f76b5c937a20c3621fe5808fb9e 100644 (file)
@@ -3331,6 +3331,7 @@ lpfc_mbx_process_link_up(struct lpfc_hba *phba, struct lpfc_mbx_read_top *la)
                case LPFC_LINK_SPEED_32GHZ:
                case LPFC_LINK_SPEED_64GHZ:
                case LPFC_LINK_SPEED_128GHZ:
+               case LPFC_LINK_SPEED_256GHZ:
                        break;
                default:
                        phba->fc_linkspeed = LPFC_LINK_SPEED_UNKNOWN;
index ead8e91e862577e3c772a3fdd47d8f2f05de25f7..2c0aaa0a301d3d40d828513fa5c89c642ff865ef 100644 (file)
@@ -4679,6 +4679,8 @@ static void lpfc_host_supported_speeds_set(struct Scsi_Host *shost)
        if (phba->hba_flag & HBA_FCOE_MODE)
                return;
 
+       if (phba->lmt & LMT_256Gb)
+               fc_host_supported_speeds(shost) |= FC_PORTSPEED_256GBIT;
        if (phba->lmt & LMT_128Gb)
                fc_host_supported_speeds(shost) |= FC_PORTSPEED_128GBIT;
        if (phba->lmt & LMT_64Gb)
@@ -5087,6 +5089,9 @@ lpfc_sli4_port_speed_parse(struct lpfc_hba *phba, uint32_t evt_code,
                case LPFC_FC_LA_SPEED_128G:
                        port_speed = 128000;
                        break;
+               case LPFC_FC_LA_SPEED_256G:
+                       port_speed = 256000;
+                       break;
                default:
                        port_speed = 0;
                }
index f76667b7da7bdeaa8c815ffe93454c77e0d42244..46989532c23d4a4b438433c5fd82490eac3d8110 100644 (file)
@@ -142,6 +142,10 @@ struct lpfc_scsicmd_bkt {
 #define FC_PORTSPEED_128GBIT   0x2000
 #endif
 
+#ifndef FC_PORTSPEED_256GBIT
+#define FC_PORTSPEED_256GBIT   0x4000
+#endif
+
 #define TXRDY_PAYLOAD_LEN      12
 
 /* For sysfs/debugfs tmp string max len */