Ma, Steve wrote:
>
>> -----Original Message-----
>> From: Robert Love [mailto:[EMAIL PROTECTED]
>> Sent: Wednesday, October 15, 2008 9:35 AM
>> To: [EMAIL PROTECTED]; Ma, Steve
>> Cc: [email protected]
>> Subject: Re: [Open-FCoE] [PATCH 1/2] libfc: Fixing the problem of
>> showinglocal port id in /sys
>>
>> On Tue, 2008-10-14 at 17:46 -0700, Steve Ma wrote:
>>> The local port id is not showing correctly in /sys.
>>> This patch is to allow the most recent local port id setting
>>> to show in /sys.
>>>
>>> Signed-off-by: Steve Ma <[EMAIL PROTECTED]>
>>> ---
>>>
>>> drivers/scsi/libfc/fc_lport.c | 20 ++++++++------------
>>> include/scsi/libfc/libfc.h | 5 -----
>>> 2 files changed, 8 insertions(+), 17 deletions(-)
>>>
>>> diff --git a/drivers/scsi/libfc/fc_lport.c
>> b/drivers/scsi/libfc/fc_lport.c
>>> index 569fdc1..d6136ee 100644
>>> --- a/drivers/scsi/libfc/fc_lport.c
>>> +++ b/drivers/scsi/libfc/fc_lport.c
>>> @@ -180,18 +180,6 @@ static void fc_lport_ptp_setup(struct fc_lport
>> *lport,
>>> fc_lport_enter_ready(lport);
>>> }
>>>
>>> -/**
>>> - * fc_get_host_port_state - supports fc_function_template
>>> - * @shost: The host whose port state should be returned
>>> - */
>>> -void fc_get_host_port_id(struct Scsi_Host *shost)
>>> -{
>>> - struct fc_lport *lp = shost_priv(shost);
>>> -
>>> - fc_host_port_id(shost) = lp->fid;
>>> -}
>>> -EXPORT_SYMBOL(fc_get_host_port_id);
>>> -
>>> void fc_get_host_port_type(struct Scsi_Host *shost)
>>> {
>>> /* TODO - currently just NPORT */
>>> @@ -199,6 +187,10 @@ void fc_get_host_port_type(struct Scsi_Host
> *shost)
>>> }
>>> EXPORT_SYMBOL(fc_get_host_port_type);
>>>
>>> +/**
>>> + * fc_get_host_port_state - supports fc_function_template
>>> + * @shost: The host whose port state should be returned
>>> + */
>>> void fc_get_host_port_state(struct Scsi_Host *shost)
>>> {
>>> struct fc_lport *lp = shost_priv(shost);
>>> @@ -675,6 +667,7 @@ static void fc_lport_recv_flogi_req(struct fc_seq
>> *sp_in,
>>> }
>>>
>>> lport->fid = local_fid;
>>> + fc_host_port_id(lport->host) = lport->fid;
>> Joe: Wasn't your comment that we shouldn't even have an lport->fid?
> Instead
>> we should just use the fc_host_port_id(Scsi_Host) all the time. Also,
> that
>> we should try and eliminate any other duplicated fields.
That was my suggestion, but it isn't much memory. Actually having the
duplicate fields saves memory if you count instructions as well as data.
Referencing lp->fid is less code (both in text and in binary) than
lp->host->shost_data->port_name (paraphrasing a bit here), so you probably
save more on just one reference than you do by eliminating the field,
assuming you only have a few instances.
> This is one way to fix. I would prefer to add a line in
> fcoe_transport_function as ".get_host_port_id = fc_get_host_port_id,"
> This is a one line change and also can keep the rest of code free from
> this attribute call.
Eliminating the function is a good idea. Eliminating the field
probably doesn't matter. In the grand scheme of things, anything
that works is fine.
Joe
_______________________________________________
devel mailing list
[email protected]
http://www.open-fcoe.org/mailman/listinfo/devel