Code Review
/
odp4vpp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
review
|
tree
raw
|
patch
| inline |
side by side
(parent:
3b566bb
)
Avoid crash in vhost-user driver when running multithreaded
author
Damjan Marion
<
[email protected]
>
Tue, 12 Jan 2016 17:34:24 +0000
(18:34 +0100)
committer
Damjan Marion
<
[email protected]
>
Tue, 12 Jan 2016 17:38:11 +0000
(18:38 +0100)
Change-Id: Ib54575453fd26ba1a7256e9d583c8f8532613ebc
Signed-off-by: Carsten Koester <
[email protected]
>
Signed-off-by: Damjan Marion <
[email protected]
>
vnet/vnet/devices/virtio/vhost-user.c
patch
|
blob
|
history
diff --git
a/vnet/vnet/devices/virtio/vhost-user.c
b/vnet/vnet/devices/virtio/vhost-user.c
index
20a4c02
..
8dca33b
100644
(file)
--- a/
vnet/vnet/devices/virtio/vhost-user.c
+++ b/
vnet/vnet/devices/virtio/vhost-user.c
@@
-771,6
+771,9
@@
static u32 vhost_user_if_input ( vlib_main_t * vm,
if (PREDICT_FALSE(!txvq->desc))
return 0;
+ if (PREDICT_FALSE(!txvq->avail))
+ return 0;
+
/* do we have pending intterupts ? */
if ((txvq->n_since_last_int) && (txvq->int_deadline < now))
vhost_user_send_call(vm, txvq);
@@
-1037,6
+1040,9
@@
vhost_user_intfc_tx (vlib_main_t * vm,
if (PREDICT_FALSE(!rxvq->desc))
goto done2;
+ if (PREDICT_FALSE(!rxvq->avail))
+ goto done2;
+
if (PREDICT_FALSE(vui->lockp != 0))
{
while (__sync_lock_test_and_set (vui->lockp, 1))