DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] vchost: Notify application of ownership change
@ 2015-08-07 17:20 Jan Kiszka
  2015-08-08  0:25 ` Ouyang, Changchun
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Jan Kiszka @ 2015-08-07 17:20 UTC (permalink / raw)
  To: dev

On VHOST_*_RESET_OWNER, we reinitialize the device but without telling
the application. That will cause crashes when it continues to invoke
vhost services on the device. Fix it by calling the destruction hook if
the device is still in use.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---

This is the surprisingly simple answer to my questions in
http://thread.gmane.org/gmane.comp.networking.dpdk.devel/22661.

 lib/librte_vhost/virtio-net.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/librte_vhost/virtio-net.c b/lib/librte_vhost/virtio-net.c
index b520ec5..3c5b5b2 100644
--- a/lib/librte_vhost/virtio-net.c
+++ b/lib/librte_vhost/virtio-net.c
@@ -402,6 +402,9 @@ reset_owner(struct vhost_device_ctx ctx)

 	ll_dev = get_config_ll_entry(ctx);

+	if ((ll_dev->dev.flags & VIRTIO_DEV_RUNNING))
+		notify_ops->destroy_device(&ll_dev->dev);
+
 	cleanup_device(&ll_dev->dev);
 	init_device(&ll_dev->dev);

-- 
2.1.4

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

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

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-07 17:20 [dpdk-dev] [PATCH] vchost: Notify application of ownership change Jan Kiszka
2015-08-08  0:25 ` Ouyang, Changchun
2015-08-08  6:43   ` Jan Kiszka
2015-08-10  1:20     ` Ouyang, Changchun
2015-08-10  8:07       ` Jan Kiszka
2015-08-12  3:34 ` Xie, Huawei
2015-08-12  5:35   ` Jan Kiszka
2015-10-24 17:16   ` Thomas Monjalon
2015-10-26  5:54     ` Tetsuya Mukawa
2015-10-26  6:30       ` Yuanhan Liu
2015-10-26  8:33         ` Tetsuya Mukawa
2016-03-17 14:42 ` Thomas Monjalon
2016-03-17 14:53   ` Jan Kiszka

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