linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steffen Maier <maier@linux.vnet.ibm.com>
To: "Parikh, Neerav" <neerav.parikh@intel.com>
Cc: "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"Brattain, Ross B" <ross.b.brattain@intel.com>,
	"Love, Robert W" <robert.w.love@intel.com>,
	James Bottomley <James.Bottomley@HansenPartnership.com>,
	Martin Peschke <mpeschke@linux.vnet.ibm.com>,
	Daniel Hansel <daniel.hansel@linux.vnet.ibm.com>
Subject: Re: FC_PORTSPEED semantics confusion and zfcp regression
Date: Mon, 13 Aug 2012 19:17:58 +0200	[thread overview]
Message-ID: <502936C6.2080404@linux.vnet.ibm.com> (raw)
In-Reply-To: <739353123C992A4C8800D77E2094259046D72566@ORSMSX101.amr.corp.intel.com>

Hi Neerav,

thanks very much for your quick reply!

On 08/09/2012 09:29 PM, Parikh, Neerav wrote:
>> -----Original Message-----
>> From: linux-scsi-owner@vger.kernel.org [mailto:linux-scsi-
>> owner@vger.kernel.org] On Behalf Of Steffen Maier
>> Sent: Thursday, August 09, 2012 9:15 AM

>> Lately, commit
>> a9277e7783651d4e0a849f7988340b1c1cf748a4
>> "[SCSI] scsi_transport_fc: Getting FC Port Speed in sync with FC-GS"
>> reverted this.
>> (See also http://marc.info/?l=linux-scsi&m=132892310322550&w=2.)

> One thing that I seem to miss is the RPSC ELS have some different definitions
> for speed as compared to the FC_PORTSPEED before this commit as well. Does the
> zfcp HBA FW do some internal conversion resulting into speed values that
> were in sync with the prior FC_PORTSPEED values?

Assuming you refer to the reversed bit order, then this is handled by 
the HBA and therefore matches the prior FC_PORTSPEED values.

kernel before a9277e7                FC-GS RPSC ELS Sec.6.2.3.3.8+9
                                      Bit  Description
------------------------------------|------------------------------
#define FC_PORTSPEED_UNKNOWN      0  -
#define FC_PORTSPEED_1GBIT        1  15    1 Gb/s capable
#define FC_PORTSPEED_2GBIT        2  14    2 Gb/s capable
#define FC_PORTSPEED_4GBIT        4  13    4 Gb/s capable
#define FC_PORTSPEED_10GBIT       8  12   10 Gb/s capable
#define FC_PORTSPEED_8GBIT     0x10  11    8 Gb/s capable
#define FC_PORTSPEED_16GBIT    0x20  10   16 Gb/s capable
                                       9   20 Gb/s capable
                                       8   32 Gb/s capable
                                       7   40 Gb/s capable
                                      6-2  Reserved
                                       1   Unknown
#define FC_PORTSPEED_NOT_NEGOTIATED
                           (1 << 15)   0   Speed not established

>> I don't mind converting zfcp to an explicit finite bit
>> conversion based on individually defined constants, esp. since all
>> other
>> FC LLDDs (qla2xxx, bfa, lpfc, ibmvscsi, fnic, mptfc) seem to do so
>> already. The only slight drawback I can see is that the code needs to
>> be touched for new HBA generations supporting new port speeds.

I think, I'm going to bring zfcp in line with the other LLDs and do an 
explicit conversion for the following reasons:
Independence of any current kernel port speed semantics.
I have to do service for enterprise distros anyway (even if you revert 
your commit upstream) since some seem to have to picked up a9277e7 already.

>> 3) Should we have port speed defines for both RPSC ELS (in
>> include/fc/fc_els.h?) and FDMI port attributes (in
>> include/scsi/scsi_transport_fc.h? unless the bit semantic change gets
>> reverted)?
>>
>> This way I could reuse the former to convert to the latter within zfcp
>> and other users can reuse it with regard to RPSC ELS. I would send a
>> patch if we agree on this.

I guess, there is no other user currently so I might just code it inside 
zfcp without definitions in fc_els.h unless someone wants me to.

> Also, regardless of the approach you decide on wouldn't zfcp need to make
> sure the speed values reported by HBA FW is in sync with the in kernel
> values?

Not necessarily, because we don't synchronize the bit semantics between 
HBA and kernel, but between HBA and FC-GS RPSC ELS in reversed bit 
order. If the kernel would also remain using the semantics of FC-GS RPSC 
ELS in reversed bit order, then the HBA values would automatically match 
the kernel definitions.
However, that's no longer relevant with an explicit conversion in zfcp.

Regards,
Steffen

Linux on System z Development

IBM Deutschland Research & Development GmbH
Vorsitzende des Aufsichtsrats: Martina Koederitz
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      reply	other threads:[~2012-08-13 17:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-09 16:15 FC_PORTSPEED semantics confusion and zfcp regression Steffen Maier
2012-08-09 19:29 ` Parikh, Neerav
2012-08-13 17:17   ` Steffen Maier [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=502936C6.2080404@linux.vnet.ibm.com \
    --to=maier@linux.vnet.ibm.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=daniel.hansel@linux.vnet.ibm.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mpeschke@linux.vnet.ibm.com \
    --cc=neerav.parikh@intel.com \
    --cc=robert.w.love@intel.com \
    --cc=ross.b.brattain@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).