Re: [PATCH 5/7] qla2xxx: Simpify unregistration of FC-NVMe local/remote ports

Madhani, Himanshu
2017-07-21T16:25:46Z

Hi Johannes,

> On Jul 20, 2017, at 12:03 AM, Johannes Thumshirn <jthumshirn@suse.de> wrote:
>
> On Wed, Jul 19, 2017 at 11:51:49AM -0700, Himanshu Madhani wrote:
>> -static void qla_nvme_abort_all(fc_port_t *fcport)
>> -{
>> - int que, cnt;
>> - unsigned long flags;
>> - srb_t *sp;
>> - struct qla_hw_data *ha = fcport->vha->hw;
>> - struct req_que *req;
>> -
>> - spin_lock_irqsave(&ha->hardware_lock, flags);
>> - for (que = 0; que < ha->max_req_queues; que++) {
>> - req = ha->req_q_map[que];
>> - if (!req)
>> - continue;
>> - if (!req->outstanding_cmds)
>> - continue;
>> - for (cnt = 1; cnt < req->num_outstanding_cmds; cnt++) {
>> - sp = req->outstanding_cmds[cnt];
>> - if ((sp) && ((sp->type == SRB_NVME_CMD) ||
>> - (sp->type == SRB_NVME_LS)) &&
>> - (sp->fcport == fcport)) {
>> - atomic_inc(&sp->ref_count);
>> - spin_unlock_irqrestore(&ha->hardware_lock,
>> - flags);
>> - qla_nvme_abort(ha, sp);
>> - spin_lock_irqsave(&ha->hardware_lock, flags);
>> - req->outstanding_cmds[cnt] = NULL;
>> - sp->done(sp, 1);
>> - }
>> - }
>> - }
>> - spin_unlock_irqrestore(&ha->hardware_lock, flags);
>> -}
>> -
>> static void qla_nvme_unregister_remote_port(struct work_struct *work)
>> {
>> struct fc_port *fcport = container_of(work, struct fc_port,
>> @@ -719,12 +679,13 @@ void qla_nvme_delete(struct scsi_qla_host *vha)
>> ql_log(ql_log_info, fcport->vha, 0x2114, "%s: fcport=%p\n",
>> __func__, fcport);
>>
>> + init_completion(&fcport->nvme_del_done);
>> nvme_fc_unregister_remoteport(fcport->nvme_remote_port);
>> qla_nvme_wait_on_rport_del(fcport);
>> - qla_nvme_abort_all(fcport);
>
> What changed the need to abort all outstanding commands?
>

FC NVMe transport now handles _abort_ so we do not need to call qla_nvme_abort_all()

> --
> Johannes Thumshirn Storage
> jthumshirn@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