[Open-FCoE] [RFC PATCH 5/5] libfc: stop sending KA if port is not logged in

Joe Eykholt joe.eykholt at gmail.com
Sat Jan 15 03:26:09 UTC 2011

On 1/14/11 5:40 PM, Vasu Dev wrote:
> On Fri, 2011-01-14 at 15:21 -0800, Joe Eykholt wrote:
>> On 1/14/11 12:13 PM, Vasu Dev wrote:
>> There's no description on this patch.  Note that the series description never
>> gets committed, so the individual patch descriptions are what's important
>> for posterity.
> I'll update in final patch.
>>> Reported-by: Frank Zhang<frank_1.Zhang at intel.com>
>>> Signed-off-by: Vasu Dev<vasu.dev at intel.com>
>>> ---
>>>    drivers/scsi/fcoe/libfcoe.c |    4 ++--
>>>    1 files changed, 2 insertions(+), 2 deletions(-)
>>> diff --git a/drivers/scsi/fcoe/libfcoe.c b/drivers/scsi/fcoe/libfcoe.c
>>> index 625c6be..c04e208 100644
>>> --- a/drivers/scsi/fcoe/libfcoe.c
>>> +++ b/drivers/scsi/fcoe/libfcoe.c
>>> @@ -464,7 +464,7 @@ static void fcoe_ctlr_send_keep_alive(struct fcoe_ctlr *fip,
>>>    	fcf = fip->sel_fcf;
>>>    	lp = fip->lp;
>>> -	if (!fcf || (ports&&   !lp->port_id))
>>> +	if (!fcf || (lport&&   !lp->port_id))
>>>    		return;
>> I think the above change might be wrong.   At least I don't see what it fixes.
> If KA triggers between LOGO and before next FLOGI then FLOGI gets
> rejected with reason 0x29, then perhaps stack needs to go thru
> restarting FIP (vlan discovery would be good restart or least
> solicitation). I tried this w/ debug code but actually not seen on Linux
> but seems like a rarely possible case and Frank has seen this on ESX
> leaving port offline in some other case. Anycase KA is needed for only
> established links maintenance and therefore skip sending KA if lport id
> is zero.
There's no need to check lport != NULL in that case.
>> If we're sending a port keep-alive, (ports is != 0) then there's no point in
>> doing it if the port_id is zero.
> Patch still have check for (!lp->port_id), my intent is to not send if
> control KA also (ports == 0) if lp->port_id is zero (logged out). I
> think I might be missing something here, correct me if I'm wrong
>>   However, for the controller keep-alive,
>> we want to send it even if we happen to be logged off at this instant.
>> At least that was my intent.
> I see FCF list is maintained that way but we should make sure least
> master link established, no KA if no established link.
I think it's OK as you've changed it, but I'm not sure it should matter.
>>   I guess we won't get a CVL if we're not logged in,
>> so maybe there's no need in doing the KA in that case either.
> Yes no CVL but no FLOGI success either.
>>>    	len = sizeof(*kal) + ports * sizeof(*vn);
>>> @@ -1649,7 +1649,7 @@ static void fcoe_ctlr_timer_work(struct work_struct *work)
>>>    	}
>>>    	if (send_ctlr_ka)
>>> -		fcoe_ctlr_send_keep_alive(fip, NULL, 0, fip->ctl_src_addr);
>>> +		fcoe_ctlr_send_keep_alive(fip, fip->lp, 0, fip->ctl_src_addr);
>> This can be left as is.   The second arg shouldn't be used if the third arg is 0.
> lp is needed to check port_id.
Disagree.  There are two local port variables in that function.  lp is gotten from the fip structure and is
the main lport.  lport is the second arg and should only be used for port keep-alive.
It may be a vport.


More information about the devel mailing list