Re: [PATCH 11/17] lpfc: Use new FDMI speed definitions for 10G, 25G and 40G FCoE.

2015-12-17 Thread Hannes Reinecke

On 12/17/2015 12:12 AM, James Smart wrote:


Use new FDMI speed definitions for 10G, 25G and 40G FCoE.

Signed-off-by: Dick Kennedy 
Signed-off-by: James Smart 
---
  drivers/scsi/lpfc/lpfc_attr.c|   2 +-
  drivers/scsi/lpfc/lpfc_ct.c  | 146 ++-
  drivers/scsi/lpfc/lpfc_els.c |   3 +
  drivers/scsi/lpfc/lpfc_hbadisc.c |  29 
  drivers/scsi/lpfc/lpfc_hw4.h |   1 +
  drivers/scsi/lpfc/lpfc_init.c|  95 -
  drivers/scsi/lpfc/lpfc_scsi.c|  10 +--
  7 files changed, 150 insertions(+), 136 deletions(-)

diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c
index be40266..46b2a44 100644
--- a/drivers/scsi/lpfc/lpfc_attr.c
+++ b/drivers/scsi/lpfc/lpfc_attr.c
@@ -5271,7 +5271,7 @@ lpfc_get_host_speed(struct Scsi_Host *shost)

spin_lock_irq(shost->host_lock);

-   if (lpfc_is_link_up(phba)) {
+   if ((lpfc_is_link_up(phba)) && (!(phba->hba_flag & HBA_FCOE_MODE))) {
switch(phba->fc_linkspeed) {
case LPFC_LINK_SPEED_1GHZ:
fc_host_speed(shost) = FC_PORTSPEED_1GBIT;
diff --git a/drivers/scsi/lpfc/lpfc_ct.c b/drivers/scsi/lpfc/lpfc_ct.c
index ac6e087..79e261d 100644
--- a/drivers/scsi/lpfc/lpfc_ct.c
+++ b/drivers/scsi/lpfc/lpfc_ct.c
@@ -48,15 +48,26 @@
  #include "lpfc_vport.h"
  #include "lpfc_debugfs.h"

-/* FDMI Port Speed definitions */
-#define HBA_PORTSPEED_1GBIT0x0001  /* 1 GBit/sec */
-#define HBA_PORTSPEED_2GBIT0x0002  /* 2 GBit/sec */
-#define HBA_PORTSPEED_4GBIT0x0008  /* 4 GBit/sec */
-#define HBA_PORTSPEED_10GBIT   0x0004  /* 10 GBit/sec */
-#define HBA_PORTSPEED_8GBIT0x0010  /* 8 GBit/sec */
-#define HBA_PORTSPEED_16GBIT   0x0020  /* 16 GBit/sec */
-#define HBA_PORTSPEED_32GBIT   0x0040  /* 32 GBit/sec */
-#define HBA_PORTSPEED_UNKNOWN  0x0800  /* Unknown */
+/* FDMI Port Speed definitions - FC-GS-7 */
+#define HBA_PORTSPEED_1GFC 0x0001  /* 1G FC */
+#define HBA_PORTSPEED_2GFC 0x0002  /* 2G FC */
+#define HBA_PORTSPEED_4GFC 0x0008  /* 4G FC */
+#define HBA_PORTSPEED_10GFC0x0004  /* 10G FC */
+#define HBA_PORTSPEED_8GFC 0x0010  /* 8G FC */
+#define HBA_PORTSPEED_16GFC0x0020  /* 16G FC */
+#define HBA_PORTSPEED_32GFC0x0040  /* 32G FC */
+#define HBA_PORTSPEED_20GFC0x0080  /* 20G FC */
+#define HBA_PORTSPEED_40GFC0x0100  /* 40G FC */
+#define HBA_PORTSPEED_128GFC   0x0200  /* 128G FC */
+#define HBA_PORTSPEED_64GFC0x0400  /* 64G FC */
+#define HBA_PORTSPEED_256GFC   0x0800  /* 256G FC */
+#define HBA_PORTSPEED_UNKNOWN  0x8000  /* Unknown */
+#define HBA_PORTSPEED_10GE 0x0001  /* 10G E */
+#define HBA_PORTSPEED_40GE 0x0002  /* 40G E */
+#define HBA_PORTSPEED_100GE0x0004  /* 100G E */
+#define HBA_PORTSPEED_25GE 0x0008  /* 25G E */
+#define HBA_PORTSPEED_50GE 0x0010  /* 50G E */
+#define HBA_PORTSPEED_400GE0x0020  /* 400G E */

  #define FOURBYTES 4

@@ -1921,20 +1932,38 @@ lpfc_fdmi_port_attr_support_speed(struct lpfc_vport 
*vport,
ae = (struct lpfc_fdmi_attr_entry *)>AttrValue;

ae->un.AttrInt = 0;
-   if (phba->lmt & LMT_32Gb)
-   ae->un.AttrInt |= HBA_PORTSPEED_32GBIT;
-   if (phba->lmt & LMT_16Gb)
-   ae->un.AttrInt |= HBA_PORTSPEED_16GBIT;
-   if (phba->lmt & LMT_10Gb)
-   ae->un.AttrInt |= HBA_PORTSPEED_10GBIT;
-   if (phba->lmt & LMT_8Gb)
-   ae->un.AttrInt |= HBA_PORTSPEED_8GBIT;
-   if (phba->lmt & LMT_4Gb)
-   ae->un.AttrInt |= HBA_PORTSPEED_4GBIT;
-   if (phba->lmt & LMT_2Gb)
-   ae->un.AttrInt |= HBA_PORTSPEED_2GBIT;
-   if (phba->lmt & LMT_1Gb)
-   ae->un.AttrInt |= HBA_PORTSPEED_1GBIT;
+   if (!(phba->hba_flag & HBA_FCOE_MODE)) {
+   if (phba->lmt & LMT_32Gb)
+   ae->un.AttrInt |= HBA_PORTSPEED_32GFC;
+   if (phba->lmt & LMT_16Gb)
+   ae->un.AttrInt |= HBA_PORTSPEED_16GFC;
+   if (phba->lmt & LMT_10Gb)
+   ae->un.AttrInt |= HBA_PORTSPEED_10GFC;
+   if (phba->lmt & LMT_8Gb)
+   ae->un.AttrInt |= HBA_PORTSPEED_8GFC;
+   if (phba->lmt & LMT_4Gb)
+   ae->un.AttrInt |= HBA_PORTSPEED_4GFC;
+   if (phba->lmt & LMT_2Gb)
+   ae->un.AttrInt |= HBA_PORTSPEED_2GFC;
+   if (phba->lmt & LMT_1Gb)
+   ae->un.AttrInt |= HBA_PORTSPEED_1GFC;
+   } else {
+   /* FCoE 

Re: [PATCH 11/17] lpfc: Use new FDMI speed definitions for 10G, 25G and 40G FCoE.

2015-12-17 Thread James Smart



On 12/17/2015 12:32 AM, Hannes Reinecke wrote:

Ah. So here is the missing 32G speed.

Should be moved into the 'Fix RDP Speed reporting' patch, no?



which of these 2 patches is not that meaningful.

-- james

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 11/17] lpfc: Use new FDMI speed definitions for 10G, 25G and 40G FCoE.

2015-12-17 Thread Hannes Reinecke
On Thursday, December 17, 2015 08:03:21 AM James Smart wrote:
> On 12/17/2015 12:32 AM, Hannes Reinecke wrote:
> > Ah. So here is the missing 32G speed.
> > 
> > Should be moved into the 'Fix RDP Speed reporting' patch, no?
> 
> which of these 2 patches is not that meaningful.
> 
Yeah, and not that big deal.

Reviewed-by: Hannes Reinecke 

Cheers,

Hannes
-- 
Dr. Hannes Reinecke  zSeries & Storage
h...@suse.de+49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 11/17] lpfc: Use new FDMI speed definitions for 10G, 25G and 40G FCoE.

2015-12-16 Thread James Smart

Use new FDMI speed definitions for 10G, 25G and 40G FCoE.

Signed-off-by: Dick Kennedy 
Signed-off-by: James Smart 
---
 drivers/scsi/lpfc/lpfc_attr.c|   2 +-
 drivers/scsi/lpfc/lpfc_ct.c  | 146 ++-
 drivers/scsi/lpfc/lpfc_els.c |   3 +
 drivers/scsi/lpfc/lpfc_hbadisc.c |  29 
 drivers/scsi/lpfc/lpfc_hw4.h |   1 +
 drivers/scsi/lpfc/lpfc_init.c|  95 -
 drivers/scsi/lpfc/lpfc_scsi.c|  10 +--
 7 files changed, 150 insertions(+), 136 deletions(-)

diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c
index be40266..46b2a44 100644
--- a/drivers/scsi/lpfc/lpfc_attr.c
+++ b/drivers/scsi/lpfc/lpfc_attr.c
@@ -5271,7 +5271,7 @@ lpfc_get_host_speed(struct Scsi_Host *shost)
 
spin_lock_irq(shost->host_lock);
 
-   if (lpfc_is_link_up(phba)) {
+   if ((lpfc_is_link_up(phba)) && (!(phba->hba_flag & HBA_FCOE_MODE))) {
switch(phba->fc_linkspeed) {
case LPFC_LINK_SPEED_1GHZ:
fc_host_speed(shost) = FC_PORTSPEED_1GBIT;
diff --git a/drivers/scsi/lpfc/lpfc_ct.c b/drivers/scsi/lpfc/lpfc_ct.c
index ac6e087..79e261d 100644
--- a/drivers/scsi/lpfc/lpfc_ct.c
+++ b/drivers/scsi/lpfc/lpfc_ct.c
@@ -48,15 +48,26 @@
 #include "lpfc_vport.h"
 #include "lpfc_debugfs.h"
 
-/* FDMI Port Speed definitions */
-#define HBA_PORTSPEED_1GBIT0x0001  /* 1 GBit/sec */
-#define HBA_PORTSPEED_2GBIT0x0002  /* 2 GBit/sec */
-#define HBA_PORTSPEED_4GBIT0x0008  /* 4 GBit/sec */
-#define HBA_PORTSPEED_10GBIT   0x0004  /* 10 GBit/sec */
-#define HBA_PORTSPEED_8GBIT0x0010  /* 8 GBit/sec */
-#define HBA_PORTSPEED_16GBIT   0x0020  /* 16 GBit/sec */
-#define HBA_PORTSPEED_32GBIT   0x0040  /* 32 GBit/sec */
-#define HBA_PORTSPEED_UNKNOWN  0x0800  /* Unknown */
+/* FDMI Port Speed definitions - FC-GS-7 */
+#define HBA_PORTSPEED_1GFC 0x0001  /* 1G FC */
+#define HBA_PORTSPEED_2GFC 0x0002  /* 2G FC */
+#define HBA_PORTSPEED_4GFC 0x0008  /* 4G FC */
+#define HBA_PORTSPEED_10GFC0x0004  /* 10G FC */
+#define HBA_PORTSPEED_8GFC 0x0010  /* 8G FC */
+#define HBA_PORTSPEED_16GFC0x0020  /* 16G FC */
+#define HBA_PORTSPEED_32GFC0x0040  /* 32G FC */
+#define HBA_PORTSPEED_20GFC0x0080  /* 20G FC */
+#define HBA_PORTSPEED_40GFC0x0100  /* 40G FC */
+#define HBA_PORTSPEED_128GFC   0x0200  /* 128G FC */
+#define HBA_PORTSPEED_64GFC0x0400  /* 64G FC */
+#define HBA_PORTSPEED_256GFC   0x0800  /* 256G FC */
+#define HBA_PORTSPEED_UNKNOWN  0x8000  /* Unknown */
+#define HBA_PORTSPEED_10GE 0x0001  /* 10G E */
+#define HBA_PORTSPEED_40GE 0x0002  /* 40G E */
+#define HBA_PORTSPEED_100GE0x0004  /* 100G E */
+#define HBA_PORTSPEED_25GE 0x0008  /* 25G E */
+#define HBA_PORTSPEED_50GE 0x0010  /* 50G E */
+#define HBA_PORTSPEED_400GE0x0020  /* 400G E */
 
 #define FOURBYTES  4
 
@@ -1921,20 +1932,38 @@ lpfc_fdmi_port_attr_support_speed(struct lpfc_vport 
*vport,
ae = (struct lpfc_fdmi_attr_entry *)>AttrValue;
 
ae->un.AttrInt = 0;
-   if (phba->lmt & LMT_32Gb)
-   ae->un.AttrInt |= HBA_PORTSPEED_32GBIT;
-   if (phba->lmt & LMT_16Gb)
-   ae->un.AttrInt |= HBA_PORTSPEED_16GBIT;
-   if (phba->lmt & LMT_10Gb)
-   ae->un.AttrInt |= HBA_PORTSPEED_10GBIT;
-   if (phba->lmt & LMT_8Gb)
-   ae->un.AttrInt |= HBA_PORTSPEED_8GBIT;
-   if (phba->lmt & LMT_4Gb)
-   ae->un.AttrInt |= HBA_PORTSPEED_4GBIT;
-   if (phba->lmt & LMT_2Gb)
-   ae->un.AttrInt |= HBA_PORTSPEED_2GBIT;
-   if (phba->lmt & LMT_1Gb)
-   ae->un.AttrInt |= HBA_PORTSPEED_1GBIT;
+   if (!(phba->hba_flag & HBA_FCOE_MODE)) {
+   if (phba->lmt & LMT_32Gb)
+   ae->un.AttrInt |= HBA_PORTSPEED_32GFC;
+   if (phba->lmt & LMT_16Gb)
+   ae->un.AttrInt |= HBA_PORTSPEED_16GFC;
+   if (phba->lmt & LMT_10Gb)
+   ae->un.AttrInt |= HBA_PORTSPEED_10GFC;
+   if (phba->lmt & LMT_8Gb)
+   ae->un.AttrInt |= HBA_PORTSPEED_8GFC;
+   if (phba->lmt & LMT_4Gb)
+   ae->un.AttrInt |= HBA_PORTSPEED_4GFC;
+   if (phba->lmt & LMT_2Gb)
+   ae->un.AttrInt |= HBA_PORTSPEED_2GFC;
+   if (phba->lmt & LMT_1Gb)
+   ae->un.AttrInt |= HBA_PORTSPEED_1GFC;
+   } else {
+   /* FCoE links support only one speed */
+