aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/vhost/net.c
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2012-12-06 07:03:34 -0500
committerMichael S. Tsirkin <mst@redhat.com>2012-12-06 10:09:18 -0500
commit935cdee7ee159569b0aaa10bd9244660f6672b08 (patch)
tree366e06bee572c2578fcce51926a8ae25e04ce66d /drivers/vhost/net.c
parent4a7d6455b07845d92e025da222f11de519f90def (diff)
vhost: avoid backend flush on vring ops
vring changes already do a flush internally where appropriate, so we do not need a second flush. It's currently not very expensive but a follow-up patch makes flush more heavy-weight, so remove the extra flush here to avoid regressing performance if call or kick fds are changed on data path. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'drivers/vhost/net.c')
-rw-r--r--drivers/vhost/net.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
index ff6c91995c96..1802ab662082 100644
--- a/drivers/vhost/net.c
+++ b/drivers/vhost/net.c
@@ -942,8 +942,11 @@ static long vhost_net_ioctl(struct file *f, unsigned int ioctl,
942 return vhost_net_reset_owner(n); 942 return vhost_net_reset_owner(n);
943 default: 943 default:
944 mutex_lock(&n->dev.mutex); 944 mutex_lock(&n->dev.mutex);
945 r = vhost_dev_ioctl(&n->dev, ioctl, arg); 945 r = vhost_dev_ioctl(&n->dev, ioctl, argp);
946 vhost_net_flush(n); 946 if (r == -ENOIOCTLCMD)
947 r = vhost_vring_ioctl(&n->dev, ioctl, argp);
948 else
949 vhost_net_flush(n);
947 mutex_unlock(&n->dev.mutex); 950 mutex_unlock(&n->dev.mutex);
948 return r; 951 return r;
949 } 952 }