Re: [PATCH 4/6] qla2xxx: Send FC4 type NVMe to the management server

2017-06-21 Thread Madhani, Himanshu

> On Jun 21, 2017, at 12:07 AM, Johannes Thumshirn  wrote:
> 
> Ah and I think you forgot to Cc the linux-nvme [1] list on your submission. It
> would be good to have it on linux-nvme as well as on linux-scsi so Sagi,
> Christoph and Keith see it as well.

Sounds good. I’ll cc linux-nvme on v2 of the series that i am going to send out 
in few hours today. 

Thanks,
- Himanshu



Re: [PATCH 4/6] qla2xxx: Send FC4 type NVMe to the management server

2017-06-21 Thread Johannes Thumshirn
On Tue, Jun 20, 2017 at 10:13:04PM +, Madhani, Himanshu wrote:
> Somehow in the actual code this does not look like issue. (i.e. correct 
> indentation is seen) 
> i am not sure why in patch view its showing one space off.

Strange. I guess we'll have to live with it then.

Ah and I think you forgot to Cc the linux-nvme [1] list on your submission. It
would be good to have it on linux-nvme as well as on linux-scsi so Sagi,
Christoph and Keith see it as well.

Byte,
Johannes

[1] linux-n...@lists.infradead.org
-- 
Johannes Thumshirn  Storage
jthumsh...@suse.de+49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850


Re: [PATCH 4/6] qla2xxx: Send FC4 type NVMe to the management server

2017-06-20 Thread Madhani, Himanshu
Hi Johannes, 

> On Jun 19, 2017, at 3:06 AM, Johannes Thumshirn  wrote:
> 
> On Fri, Jun 16, 2017 at 03:47:42PM -0700, Himanshu Madhani wrote:
>> From: Duane Grigsby 
>> 
>> This patch adds switch command support for FC-4 type of FC-NVMe (0x28)
>> for resgistering HBA port to the management server. RFT_ID command is
>> used to register FC-4 type of 0x28 and RFF_ID is used to register
>> FC-4 features bits for FC-NVMe port.
>> 
>> 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 
>> ---
> 
> [...]
> 
>> +   ct_rsp = >ct_desc.ct_sns->p.rsp;
>> +   /*
>> +* FC-GS-7, 5.2.3.12 FC-4 Features - format
>> +* The format of the FC-4 Features object, as defined by the FC-4,
>> +* Shall be an array of 4-bit values, one for each type code value
>> +*/
> 
> Indentation looks a bit odd here. Did you run checkpatch.pl on the series?
> 

forgot to reply to this earlier. Yes. I ran checkpatch.pl on this series.

Somehow in the actual code this does not look like issue. (i.e. correct 
indentation is seen) 
i am not sure why in patch view its showing one space off.
 
>> @@ -4634,6 +4637,12 @@ qla2x00_configure_fabric(scsi_qla_host_t *vha)
>>  >dpc_flags))
>>  break;
>>  }
>> +if (vha->flags.nvme_enabled) {
>> +if (qla2x00_rff_id(vha, FC4_TYPE_NVME)) {
> 
>   if (vha->flags.nvme_enabled && 
>   qla2x00_rff_id(vha, FC4_TYPE_NVME)) 
>   ql_dbg(ql_dbg_disc, vha, 0x2049, )
> 
>> +ql_dbg(ql_dbg_disc, vha, 0x2049,
>> +"Register NVME FC Type Features 
>> failed.\n");
>> +}
>> +}
> 
> -- 
> Johannes Thumshirn  Storage
> jthumsh...@suse.de+49 911 74053 689
> SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
> GF: Felix Imendörffer, Jane Smithard, Graham Norton
> HRB 21284 (AG Nürnberg)
> Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

Thanks,
- Himanshu



Re: [PATCH 4/6] qla2xxx: Send FC4 type NVMe to the management server

2017-06-19 Thread James Smart

On 6/16/2017 3:47 PM, Himanshu Madhani wrote:

From: Duane Grigsby 

This patch adds switch command support for FC-4 type of FC-NVMe (0x28)
for resgistering HBA port to the management server. RFT_ID command is
used to register FC-4 type of 0x28 and RFF_ID is used to register
FC-4 features bits for FC-NVMe port.

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: James Smart 



Re: [PATCH 4/6] qla2xxx: Send FC4 type NVMe to the management server

2017-06-19 Thread Johannes Thumshirn
On Fri, Jun 16, 2017 at 03:47:42PM -0700, Himanshu Madhani wrote:
> From: Duane Grigsby 
> 
> This patch adds switch command support for FC-4 type of FC-NVMe (0x28)
> for resgistering HBA port to the management server. RFT_ID command is
> used to register FC-4 type of 0x28 and RFF_ID is used to register
> FC-4 features bits for FC-NVMe port.
> 
> 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 
> ---

[...]

> +   ct_rsp = >ct_desc.ct_sns->p.rsp;
> +   /*
> + * FC-GS-7, 5.2.3.12 FC-4 Features - format
> + * The format of the FC-4 Features object, as defined by the FC-4,
> + * Shall be an array of 4-bit values, one for each type code value
> + */

Indentation looks a bit odd here. Did you run checkpatch.pl on the series?

> @@ -4634,6 +4637,12 @@ qla2x00_configure_fabric(scsi_qla_host_t *vha)
>   >dpc_flags))
>   break;
>   }
> + if (vha->flags.nvme_enabled) {
> + if (qla2x00_rff_id(vha, FC4_TYPE_NVME)) {

if (vha->flags.nvme_enabled && 
qla2x00_rff_id(vha, FC4_TYPE_NVME)) 
ql_dbg(ql_dbg_disc, vha, 0x2049, )

> + ql_dbg(ql_dbg_disc, vha, 0x2049,
> + "Register NVME FC Type Features 
> failed.\n");
> + }
> + }

-- 
Johannes Thumshirn  Storage
jthumsh...@suse.de+49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850


[PATCH 4/6] qla2xxx: Send FC4 type NVMe to the management server

2017-06-16 Thread Himanshu Madhani
From: Duane Grigsby 

This patch adds switch command support for FC-4 type of FC-NVMe (0x28)
for resgistering HBA port to the management server. RFT_ID command is
used to register FC-4 type of 0x28 and RFF_ID is used to register
FC-4 features bits for FC-NVMe port.

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 
---
 drivers/scsi/qla2xxx/qla_def.h  |   1 +
 drivers/scsi/qla2xxx/qla_gbl.h  |   6 +-
 drivers/scsi/qla2xxx/qla_gs.c   | 118 +++-
 drivers/scsi/qla2xxx/qla_init.c |  11 +++-
 4 files changed, 131 insertions(+), 5 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
index c1edfa55b071..c68c1cb1aadf 100644
--- a/drivers/scsi/qla2xxx/qla_def.h
+++ b/drivers/scsi/qla2xxx/qla_def.h
@@ -2866,6 +2866,7 @@ struct ct_sns_rsp {
} gpsc;
 
 #define GFF_FCP_SCSI_OFFSET7
+#define GFF_NVME_OFFSET23 /* type = 28h */
struct {
uint8_t fc4_features[128];
} gff_id;
diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h
index fc2c03bda731..1a2b5b791e22 100644
--- a/drivers/scsi/qla2xxx/qla_gbl.h
+++ b/drivers/scsi/qla2xxx/qla_gbl.h
@@ -34,6 +34,7 @@ extern void qla_nvme_fcp_abort(struct nvme_fc_local_port *,
 struct nvme_fc_remote_port *, void *, struct nvmefc_fcp_req *);
 extern void qla24xx_nvme_ls4_iocb(scsi_qla_host_t *, struct pt_ls4_request *,
 struct req_que *);
+extern void qla24xx_async_gffid_sp_done(void *, int);
 
 /*
  * Global Function Prototypes in qla_init.c source file.
@@ -634,7 +635,7 @@ extern int qla2x00_gpn_id(scsi_qla_host_t *, sw_info_t *);
 extern int qla2x00_gnn_id(scsi_qla_host_t *, sw_info_t *);
 extern void qla2x00_gff_id(scsi_qla_host_t *, sw_info_t *);
 extern int qla2x00_rft_id(scsi_qla_host_t *);
-extern int qla2x00_rff_id(scsi_qla_host_t *);
+extern int qla2x00_rff_id(scsi_qla_host_t *, u8);
 extern int qla2x00_rnn_id(scsi_qla_host_t *);
 extern int qla2x00_rsnn_nn(scsi_qla_host_t *);
 extern void *qla2x00_prep_ms_fdmi_iocb(scsi_qla_host_t *, uint32_t, uint32_t);
@@ -660,7 +661,8 @@ void qla24xx_handle_gpnid_event(scsi_qla_host_t *, struct 
event_arg *);
 int qla24xx_post_gpsc_work(struct scsi_qla_host *, fc_port_t *);
 int qla24xx_async_gpsc(scsi_qla_host_t *, fc_port_t *);
 int qla2x00_mgmt_svr_login(scsi_qla_host_t *);
-
+void qla24xx_handle_gffid_event(scsi_qla_host_t *vha, struct event_arg *ea);
+int qla24xx_async_gffid(scsi_qla_host_t *vha, fc_port_t *fcport);
 /*
  * Global Function Prototypes in qla_attr.c source file.
  */
diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c
index 540fec524ccb..c91478529b51 100644
--- a/drivers/scsi/qla2xxx/qla_gs.c
+++ b/drivers/scsi/qla2xxx/qla_gs.c
@@ -550,6 +550,8 @@ qla2x00_rft_id(scsi_qla_host_t *vha)
 
ct_req->req.rft_id.fc4_types[2] = 0x01; /* FCP-3 */
 
+   if (vha->flags.nvme_enabled)
+   ct_req->req.rft_id.fc4_types[6] = 1;/* NVMe type 28h */
/* Execute MS IOCB */
rval = qla2x00_issue_iocb(vha, ha->ms_iocb, ha->ms_iocb_dma,
sizeof(ms_iocb_entry_t));
@@ -575,7 +577,7 @@ qla2x00_rft_id(scsi_qla_host_t *vha)
  * Returns 0 on success.
  */
 int
-qla2x00_rff_id(scsi_qla_host_t *vha)
+qla2x00_rff_id(scsi_qla_host_t *vha, u8 type)
 {
int rval;
struct qla_hw_data *ha = vha->hw;
@@ -613,7 +615,7 @@ qla2x00_rff_id(scsi_qla_host_t *vha)
 
qlt_rff_id(vha, ct_req);
 
-   ct_req->req.rff_id.fc4_type = 0x08; /* SCSI - FCP */
+   ct_req->req.rff_id.fc4_type = type; /* SCSI - FCP */
 
/* Execute MS IOCB */
rval = qla2x00_issue_iocb(vha, ha->ms_iocb, ha->ms_iocb_dma,
@@ -2754,6 +2756,10 @@ qla2x00_gff_id(scsi_qla_host_t *vha, sw_info_t *list)
list[i].fc4_type = FC4_TYPE_FCP_SCSI;
else
list[i].fc4_type = FC4_TYPE_OTHER;
+
+   list[i].fc4f_nvme =
+   ct_rsp->rsp.gff_id.fc4_features[GFF_NVME_OFFSET];
+   list[i].fc4f_nvme &= 0xf;
}
 
/* Last device exit. */
@@ -3305,3 +3311,111 @@ int qla24xx_async_gpnid(scsi_qla_host_t *vha, port_id_t 
*id)
 done:
return rval;
 }
+
+void qla24xx_handle_gffid_event(scsi_qla_host_t *vha, struct event_arg *ea)
+{
+   fc_port_t *fcport = ea->fcport;
+
+   qla24xx_post_gnl_work(vha, fcport);
+}
+
+void qla24xx_async_gffid_sp_done(void *s, int res)
+{
+   struct srb *sp = s;
+   struct scsi_qla_host *vha = sp->vha;
+   fc_port_t *fcport = sp->fcport;
+   struct ct_sns_rsp *ct_rsp;
+