@@ -500,8 +500,8 @@ static void vhost_net_busy_poll_try_queue(struct vhost_net *net,
{
if (!vhost_vq_avail_empty(vq)) {
vhost_poll_queue(&vq->poll);
- } else if (unlikely(vhost_enable_notify(&net->dev, vq))) {
- vhost_disable_notify(&net->dev, vq);
+ } else if (unlikely(vhost_enable_notify(vq))) {
+ vhost_disable_notify(vq);
vhost_poll_queue(&vq->poll);
}
}
@@ -524,7 +524,7 @@ static void vhost_net_busy_poll(struct vhost_net *net,
if (!mutex_trylock(&vq->mutex))
return;
- vhost_disable_notify(&net->dev, vq);
+ vhost_disable_notify(vq);
sock = rvq->private_data;
busyloop_timeout = poll_rx ? rvq->busyloop_timeout:
@@ -552,7 +552,7 @@ static void vhost_net_busy_poll(struct vhost_net *net,
if (poll_rx || sock_has_rx_data(sock))
vhost_net_busy_poll_try_queue(net, vq);
else if (!poll_rx) /* On tx here, sock has no rx data. */
- vhost_enable_notify(&net->dev, rvq);
+ vhost_enable_notify(rvq);
mutex_unlock(&vq->mutex);
}
@@ -788,9 +788,8 @@ static void handle_tx_copy(struct vhost_net *net, struct socket *sock)
if (head == vq->num) {
if (unlikely(busyloop_intr)) {
vhost_poll_queue(&vq->poll);
- } else if (unlikely(vhost_enable_notify(&net->dev,
- vq))) {
- vhost_disable_notify(&net->dev, vq);
+ } else if (unlikely(vhost_enable_notify(vq))) {
+ vhost_disable_notify(vq);
continue;
}
break;
@@ -880,8 +879,8 @@ static void handle_tx_zerocopy(struct vhost_net *net, struct socket *sock)
if (head == vq->num) {
if (unlikely(busyloop_intr)) {
vhost_poll_queue(&vq->poll);
- } else if (unlikely(vhost_enable_notify(&net->dev, vq))) {
- vhost_disable_notify(&net->dev, vq);
+ } else if (unlikely(vhost_enable_notify(vq))) {
+ vhost_disable_notify(vq);
continue;
}
break;
@@ -960,7 +959,7 @@ static void handle_tx(struct vhost_net *net)
if (!vq_meta_prefetch(vq))
goto out;
- vhost_disable_notify(&net->dev, vq);
+ vhost_disable_notify(vq);
vhost_net_disable_vq(net, vq);
if (vhost_sock_zcopy(sock))
@@ -1129,7 +1128,7 @@ static void handle_rx(struct vhost_net *net)
if (!vq_meta_prefetch(vq))
goto out;
- vhost_disable_notify(&net->dev, vq);
+ vhost_disable_notify(vq);
vhost_net_disable_vq(net, vq);
vhost_hlen = nvq->vhost_hlen;
@@ -1156,10 +1155,10 @@ static void handle_rx(struct vhost_net *net)
if (!headcount) {
if (unlikely(busyloop_intr)) {
vhost_poll_queue(&vq->poll);
- } else if (unlikely(vhost_enable_notify(&net->dev, vq))) {
+ } else if (unlikely(vhost_enable_notify(vq))) {
/* They have slipped one in as we were
* doing that: check again. */
- vhost_disable_notify(&net->dev, vq);
+ vhost_disable_notify(vq);
continue;
}
/* Nothing new? Wait for eventfd to tell us
@@ -458,7 +458,7 @@ vhost_scsi_do_evt_work(struct vhost_scsi *vs, struct vhost_scsi_evt *evt)
}
again:
- vhost_disable_notify(&vs->dev, vq);
+ vhost_disable_notify(vq);
head = vhost_get_vq_desc(vq, vq->iov,
ARRAY_SIZE(vq->iov), &out, &in,
NULL, NULL);
@@ -467,7 +467,7 @@ vhost_scsi_do_evt_work(struct vhost_scsi *vs, struct vhost_scsi_evt *evt)
return;
}
if (head == vq->num) {
- if (vhost_enable_notify(&vs->dev, vq))
+ if (vhost_enable_notify(vq))
goto again;
vs->vs_events_missed = true;
return;
@@ -828,8 +828,8 @@ vhost_scsi_get_desc(struct vhost_scsi *vs, struct vhost_virtqueue *vq,
/* Nothing new? Wait for eventfd to tell us they refilled. */
if (vc->head == vq->num) {
- if (unlikely(vhost_enable_notify(&vs->dev, vq))) {
- vhost_disable_notify(&vs->dev, vq);
+ if (unlikely(vhost_enable_notify(vq))) {
+ vhost_disable_notify(vq);
ret = -EAGAIN;
}
goto done;
@@ -936,7 +936,7 @@ vhost_scsi_handle_vq(struct vhost_scsi *vs, struct vhost_virtqueue *vq)
memset(&vc, 0, sizeof(vc));
vc.rsp_size = sizeof(struct virtio_scsi_cmd_resp);
- vhost_disable_notify(&vs->dev, vq);
+ vhost_disable_notify(vq);
do {
ret = vhost_scsi_get_desc(vs, vq, &vc);
@@ -1189,7 +1189,7 @@ vhost_scsi_ctl_handle_vq(struct vhost_scsi *vs, struct vhost_virtqueue *vq)
memset(&vc, 0, sizeof(vc));
- vhost_disable_notify(&vs->dev, vq);
+ vhost_disable_notify(vq);
do {
ret = vhost_scsi_get_desc(vs, vq, &vc);
@@ -50,7 +50,7 @@ static void handle_vq(struct vhost_test *n)
return;
}
- vhost_disable_notify(&n->dev, vq);
+ vhost_disable_notify(vq);
for (;;) {
head = vhost_get_vq_desc(vq, vq->iov,
@@ -62,8 +62,8 @@ static void handle_vq(struct vhost_test *n)
break;
/* Nothing new? Wait for eventfd to tell us they refilled. */
if (head == vq->num) {
- if (unlikely(vhost_enable_notify(&n->dev, vq))) {
- vhost_disable_notify(&n->dev, vq);
+ if (unlikely(vhost_enable_notify(vq))) {
+ vhost_disable_notify(vq);
continue;
}
break;
@@ -2964,7 +2964,7 @@ bool vhost_vq_avail_empty(struct vhost_virtqueue *vq)
EXPORT_SYMBOL_GPL(vhost_vq_avail_empty);
/* OK, now we need to know about added descriptors. */
-bool vhost_enable_notify(struct vhost_dev *dev, struct vhost_virtqueue *vq)
+bool vhost_enable_notify(struct vhost_virtqueue *vq)
{
__virtio16 avail_idx;
int r;
@@ -3002,7 +3002,7 @@ bool vhost_enable_notify(struct vhost_dev *dev, struct vhost_virtqueue *vq)
EXPORT_SYMBOL_GPL(vhost_enable_notify);
/* We don't need to be notified again. */
-void vhost_disable_notify(struct vhost_dev *dev, struct vhost_virtqueue *vq)
+void vhost_disable_notify(struct vhost_virtqueue *vq)
{
int r;
@@ -246,9 +246,9 @@ void vhost_add_used_and_signal(struct vhost_dev *, struct vhost_virtqueue *,
void vhost_add_used_and_signal_n(struct vhost_dev *, struct vhost_virtqueue *,
struct vring_used_elem *heads, unsigned count);
void vhost_signal(struct vhost_dev *, struct vhost_virtqueue *);
-void vhost_disable_notify(struct vhost_dev *, struct vhost_virtqueue *);
+void vhost_disable_notify(struct vhost_virtqueue *vq);
bool vhost_vq_avail_empty(struct vhost_virtqueue *vq);
-bool vhost_enable_notify(struct vhost_dev *, struct vhost_virtqueue *);
+bool vhost_enable_notify(struct vhost_virtqueue *vq);
int vhost_log_write(struct vhost_virtqueue *vq, struct vhost_log *log,
unsigned int log_num, u64 len,
@@ -96,7 +96,7 @@ vhost_transport_do_send_pkt(struct vhost_vsock *vsock,
goto out;
/* Avoid further vmexits, we're already processing the virtqueue */
- vhost_disable_notify(&vsock->dev, vq);
+ vhost_disable_notify(vq);
do {
struct virtio_vsock_pkt *pkt;
@@ -109,7 +109,7 @@ vhost_transport_do_send_pkt(struct vhost_vsock *vsock,
spin_lock_bh(&vsock->send_pkt_list_lock);
if (list_empty(&vsock->send_pkt_list)) {
spin_unlock_bh(&vsock->send_pkt_list_lock);
- vhost_enable_notify(&vsock->dev, vq);
+ vhost_enable_notify(vq);
break;
}
@@ -135,8 +135,8 @@ vhost_transport_do_send_pkt(struct vhost_vsock *vsock,
/* We cannot finish yet if more buffers snuck in while
* re-enabling notify.
*/
- if (unlikely(vhost_enable_notify(&vsock->dev, vq))) {
- vhost_disable_notify(&vsock->dev, vq);
+ if (unlikely(vhost_enable_notify(vq))) {
+ vhost_disable_notify(vq);
continue;
}
break;
@@ -369,7 +369,7 @@ static void vhost_vsock_handle_tx_kick(struct vhost_work *work)
if (!vq->private_data)
goto out;
- vhost_disable_notify(&vsock->dev, vq);
+ vhost_disable_notify(vq);
do {
u32 len;
@@ -387,8 +387,8 @@ static void vhost_vsock_handle_tx_kick(struct vhost_work *work)
break;
if (head == vq->num) {
- if (unlikely(vhost_enable_notify(&vsock->dev, vq))) {
- vhost_disable_notify(&vsock->dev, vq);
+ if (unlikely(vhost_enable_notify(vq))) {
+ vhost_disable_notify(vq);
continue;
}
break;
Its dev parameter is not even used, so remove it. Signed-off-by: Jason Wang <jasowang@redhat.com> --- drivers/vhost/net.c | 25 ++++++++++++------------- drivers/vhost/scsi.c | 12 ++++++------ drivers/vhost/test.c | 6 +++--- drivers/vhost/vhost.c | 4 ++-- drivers/vhost/vhost.h | 4 ++-- drivers/vhost/vsock.c | 14 +++++++------- 6 files changed, 32 insertions(+), 33 deletions(-)