From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 6CA8F36E for ; Thu, 10 Mar 2016 08:19:19 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP; 09 Mar 2016 23:19:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,314,1455004800"; d="scan'208";a="930744042" Received: from shwdeisgchi083.ccr.corp.intel.com (HELO [10.239.67.193]) ([10.239.67.193]) by orsmga002.jf.intel.com with ESMTP; 09 Mar 2016 23:19:17 -0800 To: Yuanhan Liu , dev@dpdk.org References: <1457593280-25412-1-git-send-email-yuanhan.liu@linux.intel.com> From: "Tan, Jianfeng" Message-ID: <56E11FF5.8050508@intel.com> Date: Thu, 10 Mar 2016 15:19:17 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <1457593280-25412-1-git-send-email-yuanhan.liu@linux.intel.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] virtio: fix wrong features returned for legacy virtio X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Mar 2016 07:19:19 -0000 On 3/10/2016 3:01 PM, Yuanhan Liu wrote: > Declare dst as type uint32_t instead of uint64_t, otherwise, we will get > a random upper 32 bit feature bits, as the following io port read reads > lower 32 bit only. It could lead a feature bits that include VIRTIO_F_VERSION_1 > (the 32th bit) for legacy virtio, which is obviously wrong. > > Fixes: b8f04520ad71 ("virtio: use PCI ioport API") > > Cc: David Marchand > Signed-off-by: Yuanhan Liu > --- > drivers/net/virtio/virtio_pci.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/virtio/virtio_pci.c b/drivers/net/virtio/virtio_pci.c > index 98fc370..c007959 100644 > --- a/drivers/net/virtio/virtio_pci.c > +++ b/drivers/net/virtio/virtio_pci.c > @@ -74,7 +74,7 @@ legacy_write_dev_config(struct virtio_hw *hw, size_t offset, > static uint64_t > legacy_get_features(struct virtio_hw *hw) > { > - uint64_t dst; > + uint32_t dst; > > rte_eal_pci_ioport_read(&hw->io, &dst, 4, VIRTIO_PCI_HOST_FEATURES); > return dst; Acked-by: Jianfeng Tan