* This device only supports one TX queue,
* and we're running multi-threaded...
*/
- if (PREDICT_FALSE(xd->lockp != 0))
+ if (PREDICT_FALSE(xd->dev_type != VNET_DPDK_DEV_VHOST_USER &&
+ xd->lockp != 0))
{
queue_id = queue_id % xd->tx_q_used;
while (__sync_lock_test_and_set (xd->lockp[queue_id], 1))
else if (xd->dev_type == VNET_DPDK_DEV_VHOST_USER)
{
u32 offset = 0;
+ if (xd->need_txlock) {
+ queue_id = 0;
+ while (__sync_lock_test_and_set (xd->lockp[queue_id], 1));
+ }
#if RTE_VERSION >= RTE_VERSION_NUM(2, 2, 0, 0)
- if (PREDICT_TRUE(xd->lockp == NULL)) {
+ else {
dpdk_device_and_queue_t * dq;
vec_foreach (dq, dm->devices_by_cpu[vm->cpu_index])
{
}
assert (dq);
offset = dq->queue_id * VIRTIO_QNUM;
- } else {
- offset = queue_id * VIRTIO_QNUM;
}
#endif
if (PREDICT_TRUE(tx_head > tx_tail))
n_retry = (rv == DPDK_TX_RING_SIZE - tx_tail) ? 1 : 0;
}
+
+ if (xd->need_txlock)
+ *xd->lockp[queue_id] = 0;
}
#if RTE_LIBRTE_KNI
else if (xd->dev_type == VNET_DPDK_DEV_KNI)
rv = 0;
}
- if (PREDICT_FALSE(xd->lockp != 0))
+ if (PREDICT_FALSE(xd->dev_type != VNET_DPDK_DEV_VHOST_USER &&
+ xd->lockp != 0))
*xd->lockp[queue_id] = 0;
if (PREDICT_FALSE(rv < 0))