> -----Original Message-----
> From: James Smart [mailto:james.sm...@emulex.com]
> Sent: Thursday, January 05, 2012 7:27 AM
> To: Parikh, Neerav
> Cc: devel@open-fcoe.org
> Subject: Re: [Open-FCoE] [PATCH 2/4] scsi_transport_fc: Getting FC Port
> Speed in sync with FC-GS
> 
> Uh - there isn't a mandate that the internals of the fc transport have
> values
> that are the same as hbaapi/etc... although, it usually is the proper
> thing to
> do.  Where standards have been bad/screwy (especially true of hbaapi),
> the
> more natural or better implementation within the kernel should win out
> - with
> libraries like hbaapi translating from kernel implementation to
> standard
> presentation.  As you point out - the sysfs attribute routine insulates
> the
> user-side from internal values - so there's no actual need to have it
> track
> the same values as hbaapi.    I actually like that 4G shows up as value
> 4 -
> and we could even obsolete the string lookup in the sysfs routine if
> desired.
> In fact, I would recommend the transport kill the 10G value (it doesn't
> exist
> in product anywhere) and go with 4 for 4G, 8 for 8G, 16 for 16G
> (unless -
> we're also trying to bring in fcoe link speeds - which I don't think we
> should). If it's not used to report capabilities (multiple values) - we
> could
> even convert the field to just the integer speed value explicitly.
> 
> Was the sysfs attribute the only user-side compatibility issue seen ?
> 
> For proper subsystem review - this patch must be submitted to
> linux-s...@vger.kernel.org
> 
> -- james s
> 
> PS: I was wondering why I originally had these values - and I believed
> I
> followed the argument above - to have 4G be 4.
> 
> 
> 
I agree with you that there is no mandate to keep the values in the kernel
sync up with the standards and in any case the values are not reported 
directly but in string form. So, even after the change the reporting of 
the sysfs attributes speed/supported_speed remains the same. Any user space 
application reading these attributes won't see the difference.

The reason I swapped the values was because; as part of adding the FDMI 
support in libfc when I was adding the Port Speed and SupportedSpeed 
attributes I wanted to make sure the FC Management service receives the 
correct values as per the standard.
Now to do that one option was to modify the #defines for the 10G/4G speeds 
and make them consistent with the standards or add code to convert to 
standard values based on the kernel values. I chose to do the prior than 
later and not introduce another set of defines.

On the removal of the 10G value from transport, it may be true for FC HBA
that 10G is not there anywhere. And you're right that it is currently being
 used for reporting the current speed/supported_speed by the open-FCoE 
stack when configured on top of 10Gbps NIC/CNA. 
Do you think it is incorrect to use the 10G speed by FCoE capable HBA/CNAs?

Thanks,
Neerav

> On 1/3/2012 1:35 PM, Neerav Parikh wrote:
> > The values for the 4G and 10G speeds are not in sync with
> > definitions in SM-HBA/FC-GS-x/etc.
> > This patch brings them in sync to these specifications.
> >
> > The values are converted to strings when represented via
> > sysfs attribute, hence that should cover for user space
> > apps as they may not see any change.
> >
> > Signed-off-by: Neerav Parikh<neerav.par...@intel.com>
> > Tested-by: Ross Brattain<ross.b.bratt...@intel.com>
> > ---
> >   include/scsi/scsi_transport_fc.h |    4 ++--
> >   1 files changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/include/scsi/scsi_transport_fc.h
> b/include/scsi/scsi_transport_fc.h
> > index 0135cbc..719faf1 100644
> > --- a/include/scsi/scsi_transport_fc.h
> > +++ b/include/scsi/scsi_transport_fc.h
> > @@ -126,8 +126,8 @@ enum fc_vport_state {
> >                                          incapable of reporting */
> >   #define FC_PORTSPEED_1GBIT                1
> >   #define FC_PORTSPEED_2GBIT                2
> > -#define FC_PORTSPEED_4GBIT         4
> > -#define FC_PORTSPEED_10GBIT                8
> > +#define FC_PORTSPEED_10GBIT                4
> > +#define FC_PORTSPEED_4GBIT         8
> >   #define FC_PORTSPEED_8GBIT                0x10
> >   #define FC_PORTSPEED_16GBIT               0x20
> >   #define FC_PORTSPEED_NOT_NEGOTIATED       (1<<  15) /* Speed not
> established */
> >
> > _______________________________________________
> > devel mailing list
> > devel@open-fcoe.org
> > https://lists.open-fcoe.org/mailman/listinfo/devel
> >
_______________________________________________
devel mailing list
devel@open-fcoe.org
https://lists.open-fcoe.org/mailman/listinfo/devel

Reply via email to