From: "Tan, Jianfeng" <jianfeng.tan@intel.com>
To: Yuanhan Liu <yuanhan.liu@linux.intel.com>, dev@dpdk.org
Subject: Re: [PATCH] virtio: fix wrong features returned for legacy virtio
Date: Thu, 10 Mar 2016 15:19:17 +0800 [thread overview]
Message-ID: <56E11FF5.8050508@intel.com> (raw)
In-Reply-To: <1457593280-25412-1-git-send-email-yuanhan.liu@linux.intel.com>
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 <david.marchand@6wind.com>
> Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
> ---
> 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 <jianfeng.tan@intel.com>
next prev parent reply other threads:[~2016-03-10 7:19 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-10 7:01 [PATCH] virtio: fix wrong features returned for legacy virtio Yuanhan Liu
2016-03-10 7:19 ` Tan, Jianfeng [this message]
2016-03-10 7:43 ` David Marchand
2016-03-10 7:50 ` Yuanhan Liu
2016-03-14 10:48 ` Bruce Richardson
2016-03-14 12:44 ` Yuanhan Liu
2016-03-14 13:54 ` Bruce Richardson
2016-03-14 22:21 ` Thomas Monjalon
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=56E11FF5.8050508@intel.com \
--to=jianfeng.tan@intel.com \
--cc=dev@dpdk.org \
--cc=yuanhan.liu@linux.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.