mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Fam Zheng <famz@redhat.com>
Cc: linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org,
	"James E.J. Bottomley" <jejb@linux.vnet.ibm.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Jason Wang <jasowang@redhat.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	stefanha@redhat.com, virtualization@lists.linux-foundation.org
Subject: Re: [PATCH 2/2] virtio_scsi: Implement fc_host
Date: Tue, 17 Jan 2017 14:17:33 +0100	[thread overview]
Message-ID: <4049e6cf-b398-4ebd-3248-77c333e65331@redhat.com> (raw)
In-Reply-To: <20170116172656.GB11780@lemon>



On 16/01/2017 18:26, Fam Zheng wrote:
>> Is the endianness correct for big-endian host here?
>
> I think so. The fc_host sysfs uses u64 to represent port_name and node_name,
> this patch does the same, so using virtio_* helpers for these fields should
> handle the endianness correctly.

I was suspicious about it because they are defined as "u8 x[8]" in the
virtio_scsi_config struct.  So you would need to read with
virtio_cread_bytes and pass the result to wwn_to_u64.

For example, if you have 0x500123456789abcd this would be

	0x50 0x01 0x23 0x45 0x67 0x89 0xab 0cd

in virtio_scsi_config, and then virtio_cread64 would read it as a
little-endian u64, 0xcdab896745230150.  Maybe your QEMU patch is also
writing things as little-endian 64-bit integers, rather than 8-element
arrays of bytes?

Paolo

> Maybe we should use u64 in struct virtio_scsi_config as well?

  reply	other threads:[~2017-01-17 13:17 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-16 16:04 [PATCH 0/2] virtio-scsi: Implement FC_HOST feature Fam Zheng
2017-01-16 16:04 ` [PATCH 1/2] virtio_scsi: Add fc_host definitions Fam Zheng
2017-01-16 16:04 ` [PATCH 2/2] virtio_scsi: Implement fc_host Fam Zheng
2017-01-16 16:45   ` Paolo Bonzini
2017-01-16 17:26     ` Fam Zheng
2017-01-17 13:17       ` Paolo Bonzini [this message]
2017-01-17 14:05         ` Fam Zheng
2017-01-17 15:47           ` Michael S. Tsirkin
2017-01-16 19:02   ` kbuild test robot
2017-01-17  3:40     ` Fam Zheng
2017-01-16 20:24   ` kbuild test robot
2017-01-16 17:34 ` [PATCH 0/2] virtio-scsi: Implement FC_HOST feature Christoph Hellwig
2017-01-17  3:37   ` Fam Zheng
2017-01-16 17:44 ` Hannes Reinecke
2017-01-16 20:17   ` Paolo Bonzini

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=4049e6cf-b398-4ebd-3248-77c333e65331@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=famz@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=mst@redhat.com \
    --cc=stefanha@redhat.com \
    --cc=virtualization@lists.linux-foundation.org \
    /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

all inboxes | Powered by JetHome®