DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] virtio: fix wrong features returned for legacy virtio
@ 2016-03-10  7:01 Yuanhan Liu
  2016-03-10  7:19 ` Tan, Jianfeng
  2016-03-10  7:43 ` David Marchand
  0 siblings, 2 replies; 8+ messages in thread
From: Yuanhan Liu @ 2016-03-10  7:01 UTC (permalink / raw)
  To: dev

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;
-- 
1.9.0

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [PATCH] virtio: fix wrong features returned for legacy virtio
  2016-03-10  7:01 [dpdk-dev] [PATCH] virtio: fix wrong features returned for legacy virtio Yuanhan Liu
@ 2016-03-10  7:19 ` Tan, Jianfeng
  2016-03-10  7:43 ` David Marchand
  1 sibling, 0 replies; 8+ messages in thread
From: Tan, Jianfeng @ 2016-03-10  7:19 UTC (permalink / raw)
  To: Yuanhan Liu, dev



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>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [PATCH] virtio: fix wrong features returned for legacy virtio
  2016-03-10  7:01 [dpdk-dev] [PATCH] virtio: fix wrong features returned for legacy virtio Yuanhan Liu
  2016-03-10  7:19 ` Tan, Jianfeng
@ 2016-03-10  7:43 ` David Marchand
  2016-03-10  7:50   ` Yuanhan Liu
  2016-03-14 22:21   ` Thomas Monjalon
  1 sibling, 2 replies; 8+ messages in thread
From: David Marchand @ 2016-03-10  7:43 UTC (permalink / raw)
  To: Yuanhan Liu; +Cc: dev

On Thu, Mar 10, 2016 at 8:01 AM, Yuanhan Liu
<yuanhan.liu@linux.intel.com> 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>

Argh, good catch.
Relooked at my patch, this should be the only bug (of this kind ;-)).

Reviewed-by: David Marchand <david.marchand@6wind.com>


-- 
David Marchand

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [PATCH] virtio: fix wrong features returned for legacy virtio
  2016-03-10  7:43 ` David Marchand
@ 2016-03-10  7:50   ` Yuanhan Liu
  2016-03-14 10:48     ` Bruce Richardson
  2016-03-14 22:21   ` Thomas Monjalon
  1 sibling, 1 reply; 8+ messages in thread
From: Yuanhan Liu @ 2016-03-10  7:50 UTC (permalink / raw)
  To: David Marchand; +Cc: dev

On Thu, Mar 10, 2016 at 08:43:37AM +0100, David Marchand wrote:
> On Thu, Mar 10, 2016 at 8:01 AM, Yuanhan Liu
> <yuanhan.liu@linux.intel.com> 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>
> 
> Argh, good catch.
> Relooked at my patch, this should be the only bug (of this kind ;-)).

Yes, I also have a check while making this patch.

	--yliu
> 
> Reviewed-by: David Marchand <david.marchand@6wind.com>
> 
> 
> -- 
> David Marchand

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [PATCH] virtio: fix wrong features returned for legacy virtio
  2016-03-10  7:50   ` Yuanhan Liu
@ 2016-03-14 10:48     ` Bruce Richardson
  2016-03-14 12:44       ` Yuanhan Liu
  0 siblings, 1 reply; 8+ messages in thread
From: Bruce Richardson @ 2016-03-14 10:48 UTC (permalink / raw)
  To: Yuanhan Liu; +Cc: David Marchand, dev

On Thu, Mar 10, 2016 at 03:50:54PM +0800, Yuanhan Liu wrote:
> On Thu, Mar 10, 2016 at 08:43:37AM +0100, David Marchand wrote:
> > On Thu, Mar 10, 2016 at 8:01 AM, Yuanhan Liu
> > <yuanhan.liu@linux.intel.com> 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>
> > 
> > Argh, good catch.
> > Relooked at my patch, this should be the only bug (of this kind ;-)).
> 
> Yes, I also have a check while making this patch.
> 
> 	--yliu
> > 
> > Reviewed-by: David Marchand <david.marchand@6wind.com>
> > 
> > 
> > -- 
> > David Marchand
Hi,

this patch no longer applies to dpdk-next-net/rel_16_04 branch due to changes
in legacy_get_features function. Is it still needed? If so, please do a V2.

Regards,
/Bruce

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [PATCH] virtio: fix wrong features returned for legacy virtio
  2016-03-14 10:48     ` Bruce Richardson
@ 2016-03-14 12:44       ` Yuanhan Liu
  2016-03-14 13:54         ` Bruce Richardson
  0 siblings, 1 reply; 8+ messages in thread
From: Yuanhan Liu @ 2016-03-14 12:44 UTC (permalink / raw)
  To: Bruce Richardson, Thomas Monjalon; +Cc: David Marchand, dev

On Mon, Mar 14, 2016 at 10:48:31AM +0000, Bruce Richardson wrote:
> On Thu, Mar 10, 2016 at 03:50:54PM +0800, Yuanhan Liu wrote:
> > On Thu, Mar 10, 2016 at 08:43:37AM +0100, David Marchand wrote:
> > > On Thu, Mar 10, 2016 at 8:01 AM, Yuanhan Liu
> > > <yuanhan.liu@linux.intel.com> 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>
> > > 
> > > Argh, good catch.
> > > Relooked at my patch, this should be the only bug (of this kind ;-)).
> > 
> > Yes, I also have a check while making this patch.
> > 
> > 	--yliu
> > > 
> > > Reviewed-by: David Marchand <david.marchand@6wind.com>
> > > 
> > > 
> > > -- 
> > > David Marchand
> Hi,
> 
> this patch no longer applies to dpdk-next-net/rel_16_04 branch due to changes
> in legacy_get_features function.

Hi Bruce,

It's a patch based on Thomas' tree. And this patch fixes an regression
at there, too.

	--yliu

> Is it still needed? If so, please do a V2.
> 
> Regards,
> /Bruce

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [PATCH] virtio: fix wrong features returned for legacy virtio
  2016-03-14 12:44       ` Yuanhan Liu
@ 2016-03-14 13:54         ` Bruce Richardson
  0 siblings, 0 replies; 8+ messages in thread
From: Bruce Richardson @ 2016-03-14 13:54 UTC (permalink / raw)
  To: Yuanhan Liu; +Cc: Thomas Monjalon, David Marchand, dev

On Mon, Mar 14, 2016 at 08:44:32PM +0800, Yuanhan Liu wrote:
> On Mon, Mar 14, 2016 at 10:48:31AM +0000, Bruce Richardson wrote:
> > On Thu, Mar 10, 2016 at 03:50:54PM +0800, Yuanhan Liu wrote:
> > > On Thu, Mar 10, 2016 at 08:43:37AM +0100, David Marchand wrote:
> > > > On Thu, Mar 10, 2016 at 8:01 AM, Yuanhan Liu
> > > > <yuanhan.liu@linux.intel.com> 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>
> > > > 
> > > > Argh, good catch.
> > > > Relooked at my patch, this should be the only bug (of this kind ;-)).
> > > 
> > > Yes, I also have a check while making this patch.
> > > 
> > > 	--yliu
> > > > 
> > > > Reviewed-by: David Marchand <david.marchand@6wind.com>
> > > > 
> > > > 
> > > > -- 
> > > > David Marchand
> > Hi,
> > 
> > this patch no longer applies to dpdk-next-net/rel_16_04 branch due to changes
> > in legacy_get_features function.
> 
> Hi Bruce,
> 
> It's a patch based on Thomas' tree. And this patch fixes an regression
> at there, too.
> 
> 	--yliu
> 
Ok, thanks for the info.
Thomas, I'm delegating this patch to you in patchwork to apply to your tree.

/Bruce

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [PATCH] virtio: fix wrong features returned for legacy virtio
  2016-03-10  7:43 ` David Marchand
  2016-03-10  7:50   ` Yuanhan Liu
@ 2016-03-14 22:21   ` Thomas Monjalon
  1 sibling, 0 replies; 8+ messages in thread
From: Thomas Monjalon @ 2016-03-14 22:21 UTC (permalink / raw)
  To: Yuanhan Liu; +Cc: dev, David Marchand

2016-03-10 08:43, David Marchand:
> On Thu, Mar 10, 2016 at 8:01 AM, Yuanhan Liu
> <yuanhan.liu@linux.intel.com> 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>
> 
> Argh, good catch.
> Relooked at my patch, this should be the only bug (of this kind ;-)).
> 
> Reviewed-by: David Marchand <david.marchand@6wind.com>

Applied, thanks

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-03-14 22:22 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-10  7:01 [dpdk-dev] [PATCH] virtio: fix wrong features returned for legacy virtio Yuanhan Liu
2016-03-10  7:19 ` Tan, Jianfeng
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).