DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] vhost: fix virtqueue initialization
@ 2020-11-06 14:47 Maxime Coquelin
  2020-11-06 15:56 ` David Marchand
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Maxime Coquelin @ 2020-11-06 14:47 UTC (permalink / raw)
  To: dev, chenbo.xia, amorenoz; +Cc: stable, Maxime Coquelin, Yu Jiang

This patches fixes virtqueue initialization issue causing
segfault or file descriptor being closed unexpectedly.

The wrong index was passed to init_vring_queue() by
alloc_vring_queue() when a hole in the virtqueue array was
met.

Fixes: 8acd7c213353 ("vhost: fix virtqueues metadata allocation")
Cc: stable@dpdk.org

Reported-by: Yu Jiang <yux.jiang@intel.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 lib/librte_vhost/vhost.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c
index 8a151a9c1d..b83cf639eb 100644
--- a/lib/librte_vhost/vhost.c
+++ b/lib/librte_vhost/vhost.c
@@ -605,7 +605,7 @@ alloc_vring_queue(struct virtio_net *dev, uint32_t vring_idx)
 		}
 
 		dev->virtqueue[i] = vq;
-		init_vring_queue(dev, vring_idx);
+		init_vring_queue(dev, i);
 		rte_spinlock_init(&vq->access_lock);
 		vq->avail_wrap_counter = 1;
 		vq->used_wrap_counter = 1;
-- 
2.26.2


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

* Re: [dpdk-dev] [PATCH] vhost: fix virtqueue initialization
  2020-11-06 14:47 [dpdk-dev] [PATCH] vhost: fix virtqueue initialization Maxime Coquelin
@ 2020-11-06 15:56 ` David Marchand
  2020-11-09  5:09 ` Jiang, YuX
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: David Marchand @ 2020-11-06 15:56 UTC (permalink / raw)
  To: Maxime Coquelin
  Cc: dev, Xia, Chenbo, Adrian Moreno Zapata, dpdk stable, Yu Jiang

On Fri, Nov 6, 2020 at 3:48 PM Maxime Coquelin
<maxime.coquelin@redhat.com> wrote:
>
> This patches fixes virtqueue initialization issue causing
> segfault or file descriptor being closed unexpectedly.
>
> The wrong index was passed to init_vring_queue() by
> alloc_vring_queue() when a hole in the virtqueue array was
> met.
>
> Fixes: 8acd7c213353 ("vhost: fix virtqueues metadata allocation")
> Cc: stable@dpdk.org
>
> Reported-by: Yu Jiang <yux.jiang@intel.com>
> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> ---
>  lib/librte_vhost/vhost.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c
> index 8a151a9c1d..b83cf639eb 100644
> --- a/lib/librte_vhost/vhost.c
> +++ b/lib/librte_vhost/vhost.c
> @@ -605,7 +605,7 @@ alloc_vring_queue(struct virtio_net *dev, uint32_t vring_idx)
>                 }
>
>                 dev->virtqueue[i] = vq;
> -               init_vring_queue(dev, vring_idx);
> +               init_vring_queue(dev, i);
>                 rte_spinlock_init(&vq->access_lock);
>                 vq->avail_wrap_counter = 1;
>                 vq->used_wrap_counter = 1;
> --
> 2.26.2
>

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


-- 
David Marchand


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

* Re: [dpdk-dev] [PATCH] vhost: fix virtqueue initialization
  2020-11-06 14:47 [dpdk-dev] [PATCH] vhost: fix virtqueue initialization Maxime Coquelin
  2020-11-06 15:56 ` David Marchand
@ 2020-11-09  5:09 ` Jiang, YuX
  2020-11-09 18:38   ` Ferruh Yigit
  2020-11-09 16:31 ` Maxime Coquelin
  2020-11-09 18:37 ` Ferruh Yigit
  3 siblings, 1 reply; 8+ messages in thread
From: Jiang, YuX @ 2020-11-09  5:09 UTC (permalink / raw)
  To: Maxime Coquelin, dev, Xia, Chenbo, amorenoz
  Cc: stable, Wang, Yinan, Jiang, YuX

Tested-by: JiangYuX <yux.jiang@intel.com>

    Best Regards
    Jiang yu

> -----Original Message-----
> From: Maxime Coquelin [mailto:maxime.coquelin@redhat.com]
> Sent: Friday, November 6, 2020 10:48 PM
> To: dev@dpdk.org; Xia, Chenbo <chenbo.xia@intel.com>;
> amorenoz@redhat.com
> Cc: stable@dpdk.org; Maxime Coquelin <maxime.coquelin@redhat.com>;
> Jiang, YuX <yux.jiang@intel.com>
> Subject: [PATCH] vhost: fix virtqueue initialization
> 
> This patches fixes virtqueue initialization issue causing segfault or file
> descriptor being closed unexpectedly.
> 
> The wrong index was passed to init_vring_queue() by
> alloc_vring_queue() when a hole in the virtqueue array was met.
> 
> Fixes: 8acd7c213353 ("vhost: fix virtqueues metadata allocation")
> Cc: stable@dpdk.org
> 
> Reported-by: Yu Jiang <yux.jiang@intel.com>
> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> ---
>  lib/librte_vhost/vhost.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c index
> 8a151a9c1d..b83cf639eb 100644
> --- a/lib/librte_vhost/vhost.c
> +++ b/lib/librte_vhost/vhost.c
> @@ -605,7 +605,7 @@ alloc_vring_queue(struct virtio_net *dev, uint32_t
> vring_idx)
>  		}
> 
>  		dev->virtqueue[i] = vq;
> -		init_vring_queue(dev, vring_idx);
> +		init_vring_queue(dev, i);
>  		rte_spinlock_init(&vq->access_lock);
>  		vq->avail_wrap_counter = 1;
>  		vq->used_wrap_counter = 1;
> --
> 2.26.2


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

* Re: [dpdk-dev] [PATCH] vhost: fix virtqueue initialization
  2020-11-06 14:47 [dpdk-dev] [PATCH] vhost: fix virtqueue initialization Maxime Coquelin
  2020-11-06 15:56 ` David Marchand
  2020-11-09  5:09 ` Jiang, YuX
@ 2020-11-09 16:31 ` Maxime Coquelin
  2020-11-09 18:37 ` Ferruh Yigit
  3 siblings, 0 replies; 8+ messages in thread
From: Maxime Coquelin @ 2020-11-09 16:31 UTC (permalink / raw)
  To: dev, chenbo.xia, amorenoz; +Cc: stable, Yu Jiang



On 11/6/20 3:47 PM, Maxime Coquelin wrote:
> This patches fixes virtqueue initialization issue causing
> segfault or file descriptor being closed unexpectedly.
> 
> The wrong index was passed to init_vring_queue() by
> alloc_vring_queue() when a hole in the virtqueue array was
> met.
> 
> Fixes: 8acd7c213353 ("vhost: fix virtqueues metadata allocation")
> Cc: stable@dpdk.org
> 
> Reported-by: Yu Jiang <yux.jiang@intel.com>
> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> ---
>  lib/librte_vhost/vhost.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c
> index 8a151a9c1d..b83cf639eb 100644
> --- a/lib/librte_vhost/vhost.c
> +++ b/lib/librte_vhost/vhost.c
> @@ -605,7 +605,7 @@ alloc_vring_queue(struct virtio_net *dev, uint32_t vring_idx)
>  		}
>  
>  		dev->virtqueue[i] = vq;
> -		init_vring_queue(dev, vring_idx);
> +		init_vring_queue(dev, i);
>  		rte_spinlock_init(&vq->access_lock);
>  		vq->avail_wrap_counter = 1;
>  		vq->used_wrap_counter = 1;
> 

Applied to dpdk-next-virtio/main.

Thanks,
Maxime


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

* Re: [dpdk-dev] [PATCH] vhost: fix virtqueue initialization
  2020-11-06 14:47 [dpdk-dev] [PATCH] vhost: fix virtqueue initialization Maxime Coquelin
                   ` (2 preceding siblings ...)
  2020-11-09 16:31 ` Maxime Coquelin
@ 2020-11-09 18:37 ` Ferruh Yigit
  2020-11-09 18:39   ` Maxime Coquelin
  2020-11-09 18:40   ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
  3 siblings, 2 replies; 8+ messages in thread
From: Ferruh Yigit @ 2020-11-09 18:37 UTC (permalink / raw)
  To: Maxime Coquelin, dev, chenbo.xia, amorenoz; +Cc: stable, Yu Jiang

On 11/6/2020 2:47 PM, Maxime Coquelin wrote:
> This patches fixes virtqueue initialization issue causing
> segfault or file descriptor being closed unexpectedly.
> 
> The wrong index was passed to init_vring_queue() by
> alloc_vring_queue() when a hole in the virtqueue array was
> met.
> 
> Fixes: 8acd7c213353 ("vhost: fix virtqueues metadata allocation")
> Cc: stable@dpdk.org
> 

Since the issue is introduced in this release, there is nothing to backport and 
stable tag is not required, removing it in next-net.

> Reported-by: Yu Jiang <yux.jiang@intel.com>
> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> ---
>   lib/librte_vhost/vhost.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c
> index 8a151a9c1d..b83cf639eb 100644
> --- a/lib/librte_vhost/vhost.c
> +++ b/lib/librte_vhost/vhost.c
> @@ -605,7 +605,7 @@ alloc_vring_queue(struct virtio_net *dev, uint32_t vring_idx)
>   		}
>   
>   		dev->virtqueue[i] = vq;
> -		init_vring_queue(dev, vring_idx);
> +		init_vring_queue(dev, i);
>   		rte_spinlock_init(&vq->access_lock);
>   		vq->avail_wrap_counter = 1;
>   		vq->used_wrap_counter = 1;
> 


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

* Re: [dpdk-dev] [PATCH] vhost: fix virtqueue initialization
  2020-11-09  5:09 ` Jiang, YuX
@ 2020-11-09 18:38   ` Ferruh Yigit
  0 siblings, 0 replies; 8+ messages in thread
From: Ferruh Yigit @ 2020-11-09 18:38 UTC (permalink / raw)
  To: Jiang, YuX, Maxime Coquelin, dev, Xia, Chenbo, amorenoz
  Cc: stable, Wang, Yinan

On 11/9/2020 5:09 AM, Jiang, YuX wrote:
> Tested-by: JiangYuX <yux.jiang@intel.com>
> 

Please don't top post.

Also tag should be: "Tested-by: Yu Jiang <yux.jiang@intel.com>"

> 
>> -----Original Message-----
>> From: Maxime Coquelin [mailto:maxime.coquelin@redhat.com]
>> Sent: Friday, November 6, 2020 10:48 PM
>> To: dev@dpdk.org; Xia, Chenbo <chenbo.xia@intel.com>;
>> amorenoz@redhat.com
>> Cc: stable@dpdk.org; Maxime Coquelin <maxime.coquelin@redhat.com>;
>> Jiang, YuX <yux.jiang@intel.com>
>> Subject: [PATCH] vhost: fix virtqueue initialization
>>
>> This patches fixes virtqueue initialization issue causing segfault or file
>> descriptor being closed unexpectedly.
>>
>> The wrong index was passed to init_vring_queue() by
>> alloc_vring_queue() when a hole in the virtqueue array was met.
>>
>> Fixes: 8acd7c213353 ("vhost: fix virtqueues metadata allocation")
>> Cc: stable@dpdk.org
>>
>> Reported-by: Yu Jiang <yux.jiang@intel.com>
>> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
>> ---
>>   lib/librte_vhost/vhost.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c index
>> 8a151a9c1d..b83cf639eb 100644
>> --- a/lib/librte_vhost/vhost.c
>> +++ b/lib/librte_vhost/vhost.c
>> @@ -605,7 +605,7 @@ alloc_vring_queue(struct virtio_net *dev, uint32_t
>> vring_idx)
>>   		}
>>
>>   		dev->virtqueue[i] = vq;
>> -		init_vring_queue(dev, vring_idx);
>> +		init_vring_queue(dev, i);
>>   		rte_spinlock_init(&vq->access_lock);
>>   		vq->avail_wrap_counter = 1;
>>   		vq->used_wrap_counter = 1;
>> --
>> 2.26.2
> 


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

* Re: [dpdk-dev] [PATCH] vhost: fix virtqueue initialization
  2020-11-09 18:37 ` Ferruh Yigit
@ 2020-11-09 18:39   ` Maxime Coquelin
  2020-11-09 18:40   ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
  1 sibling, 0 replies; 8+ messages in thread
From: Maxime Coquelin @ 2020-11-09 18:39 UTC (permalink / raw)
  To: Ferruh Yigit, dev, chenbo.xia, amorenoz; +Cc: stable, Yu Jiang



On 11/9/20 7:37 PM, Ferruh Yigit wrote:
> On 11/6/2020 2:47 PM, Maxime Coquelin wrote:
>> This patches fixes virtqueue initialization issue causing
>> segfault or file descriptor being closed unexpectedly.
>>
>> The wrong index was passed to init_vring_queue() by
>> alloc_vring_queue() when a hole in the virtqueue array was
>> met.
>>
>> Fixes: 8acd7c213353 ("vhost: fix virtqueues metadata allocation")
>> Cc: stable@dpdk.org
>>
> 
> Since the issue is introduced in this release, there is nothing to
> backport and stable tag is not required, removing it in next-net.

I cc'ed stable because it is fixing a fix that was stable candidate.


>> Reported-by: Yu Jiang <yux.jiang@intel.com>
>> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
>> ---
>>   lib/librte_vhost/vhost.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c
>> index 8a151a9c1d..b83cf639eb 100644
>> --- a/lib/librte_vhost/vhost.c
>> +++ b/lib/librte_vhost/vhost.c
>> @@ -605,7 +605,7 @@ alloc_vring_queue(struct virtio_net *dev, uint32_t
>> vring_idx)
>>           }
>>             dev->virtqueue[i] = vq;
>> -        init_vring_queue(dev, vring_idx);
>> +        init_vring_queue(dev, i);
>>           rte_spinlock_init(&vq->access_lock);
>>           vq->avail_wrap_counter = 1;
>>           vq->used_wrap_counter = 1;
>>
> 


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

* Re: [dpdk-dev] [dpdk-stable] [PATCH] vhost: fix virtqueue initialization
  2020-11-09 18:37 ` Ferruh Yigit
  2020-11-09 18:39   ` Maxime Coquelin
@ 2020-11-09 18:40   ` Ferruh Yigit
  1 sibling, 0 replies; 8+ messages in thread
From: Ferruh Yigit @ 2020-11-09 18:40 UTC (permalink / raw)
  To: Maxime Coquelin, dev, chenbo.xia, amorenoz; +Cc: stable, Yu Jiang

On 11/9/2020 6:37 PM, Ferruh Yigit wrote:
> On 11/6/2020 2:47 PM, Maxime Coquelin wrote:
>> This patches fixes virtqueue initialization issue causing
>> segfault or file descriptor being closed unexpectedly.
>>
>> The wrong index was passed to init_vring_queue() by
>> alloc_vring_queue() when a hole in the virtqueue array was
>> met.
>>
>> Fixes: 8acd7c213353 ("vhost: fix virtqueues metadata allocation")
>> Cc: stable@dpdk.org
>>
> 
> Since the issue is introduced in this release, there is nothing to backport and 
> stable tag is not required, removing it in next-net.
> 

But it is fixing a fix, there is a chain, so adding it back, sorry for noise ...

>> Reported-by: Yu Jiang <yux.jiang@intel.com>
>> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
>> ---
>>   lib/librte_vhost/vhost.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c
>> index 8a151a9c1d..b83cf639eb 100644
>> --- a/lib/librte_vhost/vhost.c
>> +++ b/lib/librte_vhost/vhost.c
>> @@ -605,7 +605,7 @@ alloc_vring_queue(struct virtio_net *dev, uint32_t vring_idx)
>>           }
>>           dev->virtqueue[i] = vq;
>> -        init_vring_queue(dev, vring_idx);
>> +        init_vring_queue(dev, i);
>>           rte_spinlock_init(&vq->access_lock);
>>           vq->avail_wrap_counter = 1;
>>           vq->used_wrap_counter = 1;
>>
> 


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

end of thread, other threads:[~2020-11-09 18:40 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-06 14:47 [dpdk-dev] [PATCH] vhost: fix virtqueue initialization Maxime Coquelin
2020-11-06 15:56 ` David Marchand
2020-11-09  5:09 ` Jiang, YuX
2020-11-09 18:38   ` Ferruh Yigit
2020-11-09 16:31 ` Maxime Coquelin
2020-11-09 18:37 ` Ferruh Yigit
2020-11-09 18:39   ` Maxime Coquelin
2020-11-09 18:40   ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit

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).