[Open-FCoE] [PATCH] fcoe: exch mgr is freed while lport still retrying sequences

Ma, Steve steve.ma at intel.com
Fri Jan 30 17:45:29 UTC 2009



>-----Original Message-----
>From: Robert Love [mailto:robert.w.love at linux.intel.com]
>Sent: Friday, January 30, 2009 9:25 AM
>To: Ma, Steve
>Cc: devel at open-fcoe.org
>Subject: Re: [Open-FCoE] [PATCH] fcoe: exch mgr is freed while lport still
>retrying sequences
>
>On Fri, 2009-01-30 at 09:09 -0800, Steve Ma wrote:
>> When a sequence cannot be delivered to the target, the local
>> port will schedule retries, While this process is in progress,
>> if we issue "fcoeadm -d ethX", the fcoe_sw_destroy routine is
>> entered, and the fc_exch_mgr_free(lp->emp) is called.  Thus
>
>What about if the interface is reset while the timer is pending? Also,
I would also call cancel_delayed_work_sync() first in fc_lport_enter_reset().
>is there a reason we wouldn't cancel the timer in libfc?
Instead of calling cancel_delayed_work_sync() in fcoe_sw_destroy(), it would be better to call it in fc_fabric_logoff().
>
>> if fc_exch_alloc() is called when retrying the sequence,
>> the mempool_alloc() will fail to allocate the exchange because
>> the mempool of the exchange manager has already been released.
>> This patch is to cancel any pending retry work of the local
>> port before we start to destroy the interface.
>>
>> Signed-off-by: Steve Ma <steve.ma at intel.com>
>> ---
>>
>>  drivers/scsi/fcoe/fcoe_sw.c |    3 +++
>>  1 files changed, 3 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/scsi/fcoe/fcoe_sw.c b/drivers/scsi/fcoe/fcoe_sw.c
>> index cf83675..3b16aad 100644
>> --- a/drivers/scsi/fcoe/fcoe_sw.c
>> +++ b/drivers/scsi/fcoe/fcoe_sw.c
>> @@ -301,6 +301,9 @@ static int fcoe_sw_destroy(struct net_device *netdev)
>>       if (!lp)
>>               return -ENODEV;
>>
>> +     /* There might be local port retry in progress */
>> +     cancel_delayed_work_sync(&lp->retry_work);
>> +
>>       fc = fcoe_softc(lp);
>>
>>       /* Logout of the fabric */
>>
>> _______________________________________________
>> devel mailing list
>> devel at open-fcoe.org
>> http://www.open-fcoe.org/mailman/listinfo/devel




More information about the devel mailing list