DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] vhost-user deconnection bug
@ 2015-02-26 15:28 Benoît Canet
  0 siblings, 0 replies; only message in thread
From: Benoît Canet @ 2015-02-26 15:28 UTC (permalink / raw)
  To: huawei.xie


Hi Xie,

I connected a QEMU from git master with the vhost-user from git master
and noticed the following bug.

In the following code:

void                                                                            
user_destroy_device(struct vhost_device_ctx ctx)                                
{                                                                               
        struct virtio_net *dev = get_device(ctx);                               
                                                                                
        if (dev && (dev->flags & VIRTIO_DEV_RUNNING))                         
                notify_ops->destroy_device(dev);                                
                                                                                
        if (dev && dev->mem) {                                                  
                free_mem_region(dev);                                           
                free(dev->mem);                                                 
                dev->mem = NULL;                                                
        }                                                                       
}

The if (dev && (dev->flags & VIRTIO_DEV_RUNNING)) is evaluated false
and notify_ops->destroy_device(dev); is not called when QEMU terminate
and provocate the deconnexion.

As a consequence any piece of code busy polling or bursting on
the vhost-user device will segfault since it will not be notified
of the deconnexion.

By the way VIRTIO_DEV_RUNNING does not seem to be set anywhere.

Best regards

Benoît                      

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-02-26 15:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-26 15:28 [dpdk-dev] vhost-user deconnection bug Benoît Canet

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