Re: [PATCH v2 1/6] qla2xxx: Add FC-NVMe port discovery and PRLI handling

2017-06-28 Thread Madhani, Himanshu
Hi James,

> On Jun 28, 2017, at 2:15 PM, James Bottomley 
>  wrote:
> 
> On Wed, 2017-06-21 at 13:48 -0700, Madhani, Himanshu wrote:
>> From: Duane Grigsby 
>> 
>> Added logic to change the login process into an optional PRIL
>> step for FC-NVMe ports as a separate operation, such that we can
>> change type to 0x28 (NVMe).
>> 
>> Currently, the driver performs the PLOGI/PRLI together as one
>> operation, but if the discovered port is an NVMe port then we
>> first issue the PLOGI and then we issue the PRLI. Also, the
>> fabric discovery logic was changed to mark each discovered FC
>> NVMe port, so that we can register them with the FC-NVMe transport
>> later.
>> 
>> Signed-off-by: Darren Trapp 
>> Signed-off-by: Duane Grigsby 
>> Signed-off-by: Anil Gurumurthy 
> 
> I just got a whole load of bounces from this: you've misspelled Anil's
> email address (h and t transposed).  It looks like a generic cut and
> paste, so could you fix it for next time?
> 
> Thanks,
> 
> James
> 

Sorry about that. Will fix this up for next time.

Thanks,
- Himanshu



Re: [PATCH v2 1/6] qla2xxx: Add FC-NVMe port discovery and PRLI handling

2017-06-28 Thread James Bottomley
On Wed, 2017-06-21 at 13:48 -0700, Madhani, Himanshu wrote:
> From: Duane Grigsby 
> 
> Added logic to change the login process into an optional PRIL
> step for FC-NVMe ports as a separate operation, such that we can
> change type to 0x28 (NVMe).
> 
> Currently, the driver performs the PLOGI/PRLI together as one
> operation, but if the discovered port is an NVMe port then we
> first issue the PLOGI and then we issue the PRLI. Also, the
> fabric discovery logic was changed to mark each discovered FC
> NVMe port, so that we can register them with the FC-NVMe transport
> later.
> 
> Signed-off-by: Darren Trapp 
> Signed-off-by: Duane Grigsby 
> Signed-off-by: Anil Gurumurthy 

I just got a whole load of bounces from this: you've misspelled Anil's
email address (h and t transposed).  It looks like a generic cut and
paste, so could you fix it for next time?

Thanks,

James



Re: [PATCH v2 1/6] qla2xxx: Add FC-NVMe port discovery and PRLI handling

2017-06-22 Thread Hannes Reinecke
On 06/21/2017 10:48 PM, Madhani, Himanshu wrote:
> From: Duane Grigsby 
> 
> Added logic to change the login process into an optional PRIL
> step for FC-NVMe ports as a separate operation, such that we can
> change type to 0x28 (NVMe).
> 
> Currently, the driver performs the PLOGI/PRLI together as one
> operation, but if the discovered port is an NVMe port then we
> first issue the PLOGI and then we issue the PRLI. Also, the
> fabric discovery logic was changed to mark each discovered FC
> NVMe port, so that we can register them with the FC-NVMe transport
> later.
> 
> Signed-off-by: Darren Trapp 
> Signed-off-by: Duane Grigsby 
> Signed-off-by: Anil Gurumurthy 
> Signed-off-by: Giridhar Malavali 
> Signed-off-by: Himanshu Madhani 
> Reviewed-by: Johannes Thumshirn 
> ---
>  drivers/scsi/qla2xxx/qla_dbg.c|   9 +-
>  drivers/scsi/qla2xxx/qla_def.h|  30 ++-
>  drivers/scsi/qla2xxx/qla_fw.h |  13 ++-
>  drivers/scsi/qla2xxx/qla_gbl.h|   1 +
>  drivers/scsi/qla2xxx/qla_init.c   | 168 
> --
>  drivers/scsi/qla2xxx/qla_iocb.c   |  21 +
>  drivers/scsi/qla2xxx/qla_mbx.c|  33 +---
>  drivers/scsi/qla2xxx/qla_os.c |   4 +
>  drivers/scsi/qla2xxx/qla_target.c |   4 +-
>  9 files changed, 256 insertions(+), 27 deletions(-)
> 
Reviewed-by: Hannes Reinecke 

Cheers,

Hannes
-- 
Dr. Hannes ReineckeTeamlead Storage & Networking
h...@suse.de   +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)


[PATCH v2 1/6] qla2xxx: Add FC-NVMe port discovery and PRLI handling

2017-06-21 Thread Madhani, Himanshu
From: Duane Grigsby 

Added logic to change the login process into an optional PRIL
step for FC-NVMe ports as a separate operation, such that we can
change type to 0x28 (NVMe).

Currently, the driver performs the PLOGI/PRLI together as one
operation, but if the discovered port is an NVMe port then we
first issue the PLOGI and then we issue the PRLI. Also, the
fabric discovery logic was changed to mark each discovered FC
NVMe port, so that we can register them with the FC-NVMe transport
later.

Signed-off-by: Darren Trapp 
Signed-off-by: Duane Grigsby 
Signed-off-by: Anil Gurumurthy 
Signed-off-by: Giridhar Malavali 
Signed-off-by: Himanshu Madhani 
Reviewed-by: Johannes Thumshirn 
---
 drivers/scsi/qla2xxx/qla_dbg.c|   9 +-
 drivers/scsi/qla2xxx/qla_def.h|  30 ++-
 drivers/scsi/qla2xxx/qla_fw.h |  13 ++-
 drivers/scsi/qla2xxx/qla_gbl.h|   1 +
 drivers/scsi/qla2xxx/qla_init.c   | 168 --
 drivers/scsi/qla2xxx/qla_iocb.c   |  21 +
 drivers/scsi/qla2xxx/qla_mbx.c|  33 +---
 drivers/scsi/qla2xxx/qla_os.c |   4 +
 drivers/scsi/qla2xxx/qla_target.c |   4 +-
 9 files changed, 256 insertions(+), 27 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_dbg.c b/drivers/scsi/qla2xxx/qla_dbg.c
index c0c90dcc7c7b..cf4f47603a91 100644
--- a/drivers/scsi/qla2xxx/qla_dbg.c
+++ b/drivers/scsi/qla2xxx/qla_dbg.c
@@ -15,9 +15,10 @@
  * |  || 0x015b-0x0160 |
  * |  || 0x016e
|
  * | Mailbox commands |   0x1199   | 0x1193
|
- * | Device Discovery |   0x2004   | 0x2016
|
- * |  || 0x2011-0x2012, |
- * |  || 0x2099-0x20a4  |
+ * | Device Discovery |   0x2131   | 0x210e-0x2116  |
+ * | || 0x211a |
+ * |  || 0x211c-0x2128  |
+ * |  || 0x212a-0x2130  |
  * | Queue Command and IO tracing |   0x3074   | 0x300b |
  * |  || 0x3027-0x3028  |
  * |  || 0x303d-0x3041  |
@@ -59,7 +60,7 @@
  * |  || 0xb13c-0xb140  |
  * |  || 0xb149
|
  * | MultiQ   |   0xc010   |   |
- * | Misc |   0xd301   | 0xd031-0xd0ff |
+ * | Misc |   0xd302   | 0xd031-0xd0ff |
  * |  || 0xd101-0xd1fe |
  * |  || 0xd214-0xd2fe |
  * | Target Mode |   0xe081   ||
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
index e1af9db3691d..6f8df9cea8ff 100644
--- a/drivers/scsi/qla2xxx/qla_def.h
+++ b/drivers/scsi/qla2xxx/qla_def.h
@@ -343,6 +343,7 @@ struct srb_iocb {
 #define SRB_LOGIN_RETRIED  BIT_0
 #define SRB_LOGIN_COND_PLOGI   BIT_1
 #define SRB_LOGIN_SKIP_PRLIBIT_2
+#define SRB_LOGIN_NVME_PRLIBIT_3
uint16_t data[2];
u32 iop[2];
} logio;
@@ -436,6 +437,7 @@ struct srb_iocb {
 #define SRB_NACK_PLOGI 16
 #define SRB_NACK_PRLI  17
 #define SRB_NACK_LOGO  18
+#define SRB_PRLI_CMD   21
 
 enum {
TYPE_SRB,
@@ -1088,6 +1090,7 @@ struct mbx_cmd_32 {
 #defineMBX_1   BIT_1
 #defineMBX_0   BIT_0
 
+#define RNID_TYPE_PORT_LOGIN   0x7
 #define RNID_TYPE_SET_VERSION  0x9
 #define RNID_TYPE_ASIC_TEMP0xC
 
@@ -2152,6 +2155,7 @@ typedef struct {
uint8_t fabric_port_name[WWN_SIZE];
uint16_t fp_speed;
uint8_t fc4_type;
+   uint8_t fc4f_nvme;  /* nvme fc4 feature bits */
 } sw_info_t;
 
 /* FCP-4 types */
@@ -2180,7 +2184,8 @@ typedef enum {
FCT_SWITCH,
FCT_BROADCAST,
FCT_INITIATOR,
-   FCT_TARGET
+   FCT_TARGET,
+   FCT_NVME
 } fc_port_type_t;
 
 enum qla_sess_deletion {
@@ -2237,10 +2242,12 @@ enum fcport_mgt_event {
FCME_RSCN,
FCME_GIDPN_DONE,
FCME_PLOGI_DONE,/* Initiator side sent LLIOCB */
+   FCME_PRLI_DONE,
FCME_GNL_DONE,
FCME_GPSC_DONE,
FCME_GPDB_DONE,
FCME_GPNID_DONE,
+   FCME_GFFID_DONE,
FCME_DELETE_DONE,
 };
 
@@ -2274,6 +2281,16 @@ typedef struct fc_port {
unsigned int login_pause:1;
unsigned int login_succ:1;
 
+   struct