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
vhost: replace SMP with thread fence for control path
[dpdk.git]
/
lib
/
librte_vhost
/
vhost_user.c
diff --git
a/lib/librte_vhost/vhost_user.c
b/lib/librte_vhost/vhost_user.c
index
3898c93
..
6e94a9b
100644
(file)
--- a/
lib/librte_vhost/vhost_user.c
+++ b/
lib/librte_vhost/vhost_user.c
@@
-1690,7
+1690,7
@@
vhost_check_queue_inflights_split(struct virtio_net *dev,
if (inflight_split->used_idx != used->idx) {
inflight_split->desc[last_io].inflight = 0;
if (inflight_split->used_idx != used->idx) {
inflight_split->desc[last_io].inflight = 0;
- rte_
smp_mb(
);
+ rte_
atomic_thread_fence(__ATOMIC_SEQ_CST
);
inflight_split->used_idx = used->idx;
}
inflight_split->used_idx = used->idx;
}
@@
-1858,8
+1858,12
@@
vhost_user_set_vring_kick(struct virtio_net **pdev, struct VhostUserMsg *msg,
/* Interpret ring addresses only when ring is started. */
dev = translate_ring_addresses(dev, file.index);
/* Interpret ring addresses only when ring is started. */
dev = translate_ring_addresses(dev, file.index);
- if (!dev)
+ if (!dev) {
+ if (file.fd != VIRTIO_INVALID_EVENTFD)
+ close(file.fd);
+
return RTE_VHOST_MSG_RESULT_ERR;
return RTE_VHOST_MSG_RESULT_ERR;
+ }
*pdev = dev;
*pdev = dev;
@@
-2086,7
+2090,7
@@
vhost_user_set_log_base(struct virtio_net **pdev, struct VhostUserMsg *msg,
VHOST_LOG_CONFIG(ERR,
"invalid log base msg size: %"PRId32" != %d\n",
msg->size, (int)sizeof(VhostUserLog));
VHOST_LOG_CONFIG(ERR,
"invalid log base msg size: %"PRId32" != %d\n",
msg->size, (int)sizeof(VhostUserLog));
-
return RTE_VHOST_MSG_RESULT_ERR
;
+
goto close_msg_fds
;
}
size = msg->payload.log.mmap_size;
}
size = msg->payload.log.mmap_size;
@@
-2097,7
+2101,7
@@
vhost_user_set_log_base(struct virtio_net **pdev, struct VhostUserMsg *msg,
VHOST_LOG_CONFIG(ERR,
"log offset %#"PRIx64" and log size %#"PRIx64" overflow\n",
off, size);
VHOST_LOG_CONFIG(ERR,
"log offset %#"PRIx64" and log size %#"PRIx64" overflow\n",
off, size);
-
return RTE_VHOST_MSG_RESULT_ERR
;
+
goto close_msg_fds
;
}
VHOST_LOG_CONFIG(INFO,
}
VHOST_LOG_CONFIG(INFO,
@@
-2134,6
+2138,10
@@
vhost_user_set_log_base(struct virtio_net **pdev, struct VhostUserMsg *msg,
msg->fd_num = 0;
return RTE_VHOST_MSG_RESULT_REPLY;
msg->fd_num = 0;
return RTE_VHOST_MSG_RESULT_REPLY;
+
+close_msg_fds:
+ close_msg_fds(msg);
+ return RTE_VHOST_MSG_RESULT_ERR;
}
static int vhost_user_set_log_fd(struct virtio_net **pdev __rte_unused,
}
static int vhost_user_set_log_fd(struct virtio_net **pdev __rte_unused,