#include "virtio_logs.h"
#include "virtio_pci.h"
#include "virtqueue.h"
+#include "virtio_rxtx.h"
#include "virtio_user/virtio_user_dev.h"
#define virtio_user_get_dev(hw) \
for (i = 0; i < ETHER_ADDR_LEN; ++i)
dev->mac_addr[i] = ((const uint8_t *)src)[i];
else
- PMD_DRV_LOG(ERR, "not supported offset=%" PRIu64 ", len=%d\n",
+ PMD_DRV_LOG(ERR, "not supported offset=%zu, len=%d\n",
offset, length);
}
uint64_t buf = 1;
struct virtio_user_dev *dev = virtio_user_get_dev(hw);
+ if (hw->cvq && (hw->cvq->vq == vq)) {
+ virtio_user_handle_cq(dev, vq->vq_queue_index);
+ return;
+ }
+
if (write(dev->kickfds[vq->vq_queue_index], &buf, sizeof(buf)) < 0)
PMD_DRV_LOG(ERR, "failed to kick backend: %s\n",
strerror(errno));
if (rte_kvargs_count(kvlist, VIRTIO_USER_ARG_CQ_NUM) == 1)
rte_kvargs_process(kvlist, VIRTIO_USER_ARG_CQ_NUM,
&get_integer_arg, &cq);
+ else if (queues > 1)
+ cq = 1;
+
+ if (queues > 1 && cq == 0) {
+ PMD_INIT_LOG(ERR, "multi-q requires ctrl-q");
+ goto end;
+ }
eth_dev = virtio_user_eth_dev_alloc(name);
if (!eth_dev) {
}
static struct rte_driver virtio_user_driver = {
- .name = "virtio-user",
.type = PMD_VDEV,
.init = virtio_user_pmd_devinit,
.uninit = virtio_user_pmd_devuninit,
};
-PMD_REGISTER_DRIVER(virtio_user_driver);
+PMD_REGISTER_DRIVER(virtio_user_driver, virtio_user);