lkml.org 
[lkml]   [2021]   [Nov]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 5/6] vhost_net: remove NOP vhost_net_flush() in vhost_net_release()
Date
The second vhost_net_flush() call in vhost_net_release() doesn't do
anything. vhost_dev_cleanup() stops dev->worker and NULLifies it.
vhost_net_reset_vq(n) NULLifies n->vqs[i].ubufs

So vhost_net_flush() after vhost_dev_cleanup()&vhost_net_reset_vq() doesn't
do anything, it simply doesn't pass NULL checks.

Hence remove it for simplicity.

Signed-off-by: Andrey Ryabinin <arbn@yandex-team.com>
---
drivers/vhost/net.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
index b1feb5e0571e..97a209d6a527 100644
--- a/drivers/vhost/net.c
+++ b/drivers/vhost/net.c
@@ -1406,9 +1406,7 @@ static int vhost_net_release(struct inode *inode, struct file *f)
sockfd_put(rx_sock);
/* Make sure no callbacks are outstanding */
synchronize_rcu();
- /* We do an extra flush before freeing memory,
- * since jobs can re-queue themselves. */
- vhost_net_flush(n);
+
kfree(n->vqs[VHOST_NET_VQ_RX].rxq.queue);
kfree(n->vqs[VHOST_NET_VQ_TX].xdp);
kfree(n->dev.vqs);
--
2.32.0
\
 
 \ /
  Last update: 2021-11-15 16:33    [W:0.251 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site