From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750884AbdAPR1C (ORCPT ); Mon, 16 Jan 2017 12:27:02 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56636 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750777AbdAPR1A (ORCPT ); Mon, 16 Jan 2017 12:27:00 -0500 Date: Tue, 17 Jan 2017 01:26:56 +0800 From: Fam Zheng To: Paolo Bonzini Cc: linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, "James E.J. Bottomley" , "Michael S. Tsirkin" , Jason Wang , "Martin K. Petersen" , stefanha@redhat.com, virtualization@lists.linux-foundation.org Subject: Re: [PATCH 2/2] virtio_scsi: Implement fc_host Message-ID: <20170116172656.GB11780@lemon> References: <20170116160430.11815-1-famz@redhat.com> <20170116160430.11815-3-famz@redhat.com> <95f96b48-aa75-0094-a634-db9c13035336@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <95f96b48-aa75-0094-a634-db9c13035336@redhat.com> User-Agent: Mutt/1.7.1 (2016-10-04) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Mon, 16 Jan 2017 17:27:01 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 01/16 17:45, Paolo Bonzini wrote: > > > On 16/01/2017 17:04, Fam Zheng wrote: > > + node_name = virtio_cread64(vdev, > > + offsetof(struct virtio_scsi_config, primary_wwnn)); > > + port_name = virtio_cread64(vdev, > > + offsetof(struct virtio_scsi_config, primary_wwpn)); > > + } else { > > + node_name = virtio_cread64(vdev, > > + offsetof(struct virtio_scsi_config, secondary_wwnn)); > > + port_name = virtio_cread64(vdev, > > + offsetof(struct virtio_scsi_config, secondary_wwpn)); > > 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. Maybe we should use u64 in struct virtio_scsi_config as well? Fam