git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
mlx4: avoid init errors when kernel modules are not loaded
[dpdk.git]
/
lib
/
librte_vhost
/
virtio-net.c
diff --git
a/lib/librte_vhost/virtio-net.c
b/lib/librte_vhost/virtio-net.c
index
20567ff
..
4672e67
100644
(file)
--- a/
lib/librte_vhost/virtio-net.c
+++ b/
lib/librte_vhost/virtio-net.c
@@
-185,13
+185,13
@@
cleanup_device(struct virtio_net *dev)
}
/* Close any event notifiers opened by device. */
}
/* Close any event notifiers opened by device. */
- if (
dev->virtqueue[VIRTIO_RXQ]->callfd
)
+ if (
(int)dev->virtqueue[VIRTIO_RXQ]->callfd >= 0
)
close((int)dev->virtqueue[VIRTIO_RXQ]->callfd);
close((int)dev->virtqueue[VIRTIO_RXQ]->callfd);
- if (
dev->virtqueue[VIRTIO_RXQ]->kickfd
)
+ if (
(int)dev->virtqueue[VIRTIO_RXQ]->kickfd >= 0
)
close((int)dev->virtqueue[VIRTIO_RXQ]->kickfd);
close((int)dev->virtqueue[VIRTIO_RXQ]->kickfd);
- if (
dev->virtqueue[VIRTIO_TXQ]->callfd
)
+ if (
(int)dev->virtqueue[VIRTIO_TXQ]->callfd >= 0
)
close((int)dev->virtqueue[VIRTIO_TXQ]->callfd);
close((int)dev->virtqueue[VIRTIO_TXQ]->callfd);
- if (
dev->virtqueue[VIRTIO_TXQ]->kickfd
)
+ if (
(int)dev->virtqueue[VIRTIO_TXQ]->kickfd >= 0
)
close((int)dev->virtqueue[VIRTIO_TXQ]->kickfd);
}
close((int)dev->virtqueue[VIRTIO_TXQ]->kickfd);
}
@@
-595,10
+595,10
@@
set_vring_call(struct vhost_device_ctx ctx, struct vhost_vring_file *file)
/* file->index refers to the queue index. The txq is 1, rxq is 0. */
vq = dev->virtqueue[file->index];
/* file->index refers to the queue index. The txq is 1, rxq is 0. */
vq = dev->virtqueue[file->index];
- if ((int)vq->
kick
fd >= 0)
- close((int)vq->
kick
fd);
+ if ((int)vq->
call
fd >= 0)
+ close((int)vq->
call
fd);
- vq->
kick
fd = file->fd;
+ vq->
call
fd = file->fd;
return 0;
}
return 0;
}
@@
-621,10
+621,10
@@
set_vring_kick(struct vhost_device_ctx ctx, struct vhost_vring_file *file)
/* file->index refers to the queue index. The txq is 1, rxq is 0. */
vq = dev->virtqueue[file->index];
/* file->index refers to the queue index. The txq is 1, rxq is 0. */
vq = dev->virtqueue[file->index];
- if ((int)vq->
call
fd >= 0)
- close((int)vq->
call
fd);
+ if ((int)vq->
kick
fd >= 0)
+ close((int)vq->
kick
fd);
- vq->
call
fd = file->fd;
+ vq->
kick
fd = file->fd;
return 0;
}
return 0;
}