Hello,

On Fri, Feb 24, 2023 at 2:55 AM Han Ding <[email protected]> wrote:
> >On 2/23/23 10:35, Han Ding wrote:
> >>
> >> When use ovs-vsctl to delete vhostuserclient port while qemu destroy 
> >> virtio,
> >> there is a deadlock between OVS main thread and the vhost-events thread.
> >>
> >> openvswitch is 2.14 and dpdk is 20.11
> >
> >FWIW, 2.14 supposed to be used with 19.11.

Indeed.


>
> Thanks for reply.
>
> The code flow path of openvswitch 3.0.1 and dpdk 21.11, dpdk 22.11 is same
> for destroying vhostuserclient device. So, I think  there is a same bug in 
> new version.

Please double check the dpdk versions you are using, then have a look
at my comment below.


>
>
> >>
> >> Main thread:
> >> ofport_remove
> >>   -> netdev_unref
> >>       -> netdev_dpdk_vhost_destruct
> >>            -> rte_vhost_driver_unregister (If fdentry is busy, circle 
> >> again until the fdentry is not busy)
> >>                -> fdset_try_del  (fdentry is busy now, return -1. Goto 
> >> again)
> >>
>
>
>
> >> vhost-nets thread:
> >> fdset_event_dispatch (set fdentry to busy. When destroy_device fuction 
> >> return set the fdentry to no busy)
> >>    -> vhost_user_read_cb
> >>      -> vhost_user_msg_handler
> >>          -> vhost_user_get_vring_base
> >>              ->destroy_device
> >>                 -> ovsrcu_synchronize (Wait for other threads to quiesce)
>
>
>
> >> The  vhost-nets thread wait for main thread to quiesce, but the main 
> >> thread now is waiting for fdentry to no busy
> >> and circle all the time.
>
>
> >>
> >> Whether the ovsrcu_synchronize  is necessary in destrory_device
> >
> >Yes, we have to wait for all threads to stop using this device.
> >
> >> or the rte_vhost_driver_unregister is correct in fdset_try_del ?
> >
> >CC: David and Maxime.

This could be a different issue, but there was a change for this area
of the vhost library in v21.11:
451dc0fad83d ("vhost: fix crash on port deletion")

I don't see it backported to 19.11 stable release, but it got to
v20.11.4 (used in 2.15 and 2.16 ovs branches).

I would suggest backporting it to your 19.11 dpdk and retest with ovs 2.14.


-- 
David Marchand

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to