* [dpdk-dev] [PATCH] vhost: initialize postcopy ufd properly
@ 2018-10-24 9:39 Tiwei Bie
2018-10-24 10:20 ` Maxime Coquelin
2018-10-24 10:51 ` Maxime Coquelin
0 siblings, 2 replies; 3+ messages in thread
From: Tiwei Bie @ 2018-10-24 9:39 UTC (permalink / raw)
To: maxime.coquelin, zhihong.wang, dev
Currently, postcopy_ufd is initialized to 0 implicitly, so fd 0
could be closed unexpectedly by vhost_backend_cleanup(). Fix this
issue by initializing postcopy_ufd to -1 explicitly.
Fixes: 9eefef3b5970 ("vhost: introduce postcopy advise message")
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
---
lib/librte_vhost/vhost.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c
index 047ee535c..70ac6bc9c 100644
--- a/lib/librte_vhost/vhost.c
+++ b/lib/librte_vhost/vhost.c
@@ -344,6 +344,7 @@ vhost_new_device(void)
dev->flags = VIRTIO_DEV_BUILTIN_VIRTIO_NET;
dev->slave_req_fd = -1;
dev->vdpa_dev_id = -1;
+ dev->postcopy_ufd = -1;
rte_spinlock_init(&dev->slave_req_lock);
return i;
--
2.19.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] [PATCH] vhost: initialize postcopy ufd properly
2018-10-24 9:39 [dpdk-dev] [PATCH] vhost: initialize postcopy ufd properly Tiwei Bie
@ 2018-10-24 10:20 ` Maxime Coquelin
2018-10-24 10:51 ` Maxime Coquelin
1 sibling, 0 replies; 3+ messages in thread
From: Maxime Coquelin @ 2018-10-24 10:20 UTC (permalink / raw)
To: Tiwei Bie, zhihong.wang, dev
On 10/24/18 11:39 AM, Tiwei Bie wrote:
> Currently, postcopy_ufd is initialized to 0 implicitly, so fd 0
> could be closed unexpectedly by vhost_backend_cleanup(). Fix this
> issue by initializing postcopy_ufd to -1 explicitly.
>
> Fixes: 9eefef3b5970 ("vhost: introduce postcopy advise message")
>
> Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
> ---
> lib/librte_vhost/vhost.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c
> index 047ee535c..70ac6bc9c 100644
> --- a/lib/librte_vhost/vhost.c
> +++ b/lib/librte_vhost/vhost.c
> @@ -344,6 +344,7 @@ vhost_new_device(void)
> dev->flags = VIRTIO_DEV_BUILTIN_VIRTIO_NET;
> dev->slave_req_fd = -1;
> dev->vdpa_dev_id = -1;
> + dev->postcopy_ufd = -1;
> rte_spinlock_init(&dev->slave_req_lock);
>
> return i;
>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Thanks!
Maxime
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] [PATCH] vhost: initialize postcopy ufd properly
2018-10-24 9:39 [dpdk-dev] [PATCH] vhost: initialize postcopy ufd properly Tiwei Bie
2018-10-24 10:20 ` Maxime Coquelin
@ 2018-10-24 10:51 ` Maxime Coquelin
1 sibling, 0 replies; 3+ messages in thread
From: Maxime Coquelin @ 2018-10-24 10:51 UTC (permalink / raw)
To: Tiwei Bie, zhihong.wang, dev
On 10/24/18 11:39 AM, Tiwei Bie wrote:
> Currently, postcopy_ufd is initialized to 0 implicitly, so fd 0
> could be closed unexpectedly by vhost_backend_cleanup(). Fix this
> issue by initializing postcopy_ufd to -1 explicitly.
>
> Fixes: 9eefef3b5970 ("vhost: introduce postcopy advise message")
>
> Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
> ---
> lib/librte_vhost/vhost.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c
> index 047ee535c..70ac6bc9c 100644
> --- a/lib/librte_vhost/vhost.c
> +++ b/lib/librte_vhost/vhost.c
> @@ -344,6 +344,7 @@ vhost_new_device(void)
> dev->flags = VIRTIO_DEV_BUILTIN_VIRTIO_NET;
> dev->slave_req_fd = -1;
> dev->vdpa_dev_id = -1;
> + dev->postcopy_ufd = -1;
> rte_spinlock_init(&dev->slave_req_lock);
>
> return i;
>
Applied to dpdk-next-virtio/master.
Thanks,
Maxime
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-10-24 10:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-24 9:39 [dpdk-dev] [PATCH] vhost: initialize postcopy ufd properly Tiwei Bie
2018-10-24 10:20 ` Maxime Coquelin
2018-10-24 10:51 ` Maxime Coquelin
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).