public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Tyrel Datwyler <turtle.in.the.kernel@gmail.com>
To: Brian King <brking@linux.vnet.ibm.com>,
	Hannes Reinecke <hare@suse.de>,
	Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
Cc: "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>
Subject: Re: ibmvfc oddities
Date: Thu, 21 Sep 2017 11:29:55 -0700	[thread overview]
Message-ID: <41162a79-9bf8-97c2-7282-e8cde619cd27@gmail.com> (raw)
In-Reply-To: <4b11b1f6-cc46-5f40-2810-02f8ae9792cb@linux.vnet.ibm.com>

On 09/21/2017 08:13 AM, Brian King wrote:
> On 09/21/2017 05:02 AM, Hannes Reinecke wrote:
>> Hi Brian,
>>
>> I was looking at the ibmvfc code (trying to hook up libfc), and have
>> found this definition:
>>
>> struct ibmvfc_fcp_rsp_info {
>> 	__be16 reserved;
>> 	u8 rsp_code;
>> 	u8 reserved2[4];
>> }__attribute__((packed, aligned (2)));
>>
>> in comparison, libfc has this:
>>
>> struct fcp_resp_rsp_info {
>>     __u8      _fr_resvd[3];       /* reserved */
>>     __u8      rsp_code;           /* Response Info Code */
>>     __u8      _fr_resvd2[4];      /* reserved */
>> };
>>
>> So both look _nearly_ identical, except the missing byte at the start.
>> It might be inserted due to some compile alignment magic, but I'd rather
>> not rely on this.
>> Could you clarify if the two structures really are different, or if this
>> is a simple oversight?
> 
> Looks like a bug to me. We should probably just have ibmvfc use the
> libfc definition.

Yes, after looking at the FC spec we most definitely have it defined wrong, and I'm pretty
certain that we aren't getting saved by any compiler magic.

> 
> Tyrel - can you do this conversion and run a bit of regression testing?
> Looking at the possible values of rsp_code, the most likely place where
> this might cause us some issues is in TMF handling. I'm a little
> worried this could result in a potential double completion in error
> handling in some rare cases.... Tyrel - are you aware of any issues
> like that, which this might explain?

I certainly can. I recollect something like a double completion issue, but its been so
long I can't remember if we were seeing it in the vfc driver or the vscsi driver. Anyhow,
I do feel like from what I recall it seems like rsp_code is always zero in reported error
messages.

-Tyrel

> 
> Thanks,
> 
> Brian
> 

  reply	other threads:[~2017-09-21 18:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-21 10:02 ibmvfc oddities Hannes Reinecke
2017-09-21 15:13 ` Brian King
2017-09-21 18:29   ` Tyrel Datwyler [this message]
2017-09-22  5:59     ` Hannes Reinecke

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=41162a79-9bf8-97c2-7282-e8cde619cd27@gmail.com \
    --to=turtle.in.the.kernel@gmail.com \
    --cc=brking@linux.vnet.ibm.com \
    --cc=hare@suse.de \
    --cc=linux-scsi@vger.kernel.org \
    --cc=tyreld@linux.vnet.ibm.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