# Re: \[PATCH 1/6\] vhost: get rid of vhost\_poll\_flush() wrapper

- From: Andrey Ryabinin \<hidden\>
- Date: 2021-11-19 10:28:42 
- List: netdev
- Page: https://ratatoskr.run/netdev/2021/11/1579813
- Thread: https://ratatoskr.run/kvm/2021/11/1572407/t.md

```text


On 11/16/21 5:41 PM, Stefano Garzarella wrote:
> On Mon, Nov 15, 2021 at 06:29:58PM +0300, Andrey Ryabinin wrote:

>> void vhost_work_queue(struct vhost_dev *dev, struct vhost_work *work)
>> {
>>     if (!dev->worker)
>> @@ -663,7 +655,7 @@ void vhost_dev_stop(struct vhost_dev *dev)
>>     for (i = 0; i < dev->nvqs; ++i) {
>>         if (dev->vqs[i]->kick && dev->vqs[i]->handle_kick) {
>>             vhost_poll_stop(&dev->vqs[i]->poll);
>> -            vhost_poll_flush(&dev->vqs[i]->poll);
>> +            vhost_work_dev_flush(dev->vqs[i]->poll.dev);
> 
> Not related to this patch, but while looking at vhost-vsock I'm wondering if we can do the same here in vhost_dev_stop(), I mean move vhost_work_dev_flush() outside the loop and and call it once. (In another patch eventually)
> 

Yeah, seems reasonable. I can't see any reason why would subsequent vhost_poll_stop() require the vhost_work_dev_flush() in between.
```
