1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2010-2016 Intel Corporation
9 #include <linux/major.h>
11 #include <sys/sysmacros.h>
12 #include <sys/socket.h>
14 #include <rte_malloc.h>
15 #include <rte_kvargs.h>
16 #include <ethdev_vdev.h>
17 #include <rte_bus_vdev.h>
18 #include <rte_alarm.h>
19 #include <rte_cycles.h>
21 #include "virtio_ethdev.h"
22 #include "virtio_logs.h"
24 #include "virtqueue.h"
25 #include "virtio_rxtx.h"
26 #include "virtio_user/virtio_user_dev.h"
27 #include "virtio_user/vhost.h"
29 #define virtio_user_get_dev(hwp) container_of(hwp, struct virtio_user_dev, hw)
32 virtio_user_read_dev_config(struct virtio_hw *hw, size_t offset,
33 void *dst, int length)
36 struct virtio_user_dev *dev = virtio_user_get_dev(hw);
38 if (offset == offsetof(struct virtio_net_config, mac) &&
39 length == RTE_ETHER_ADDR_LEN) {
40 for (i = 0; i < RTE_ETHER_ADDR_LEN; ++i)
41 ((uint8_t *)dst)[i] = dev->mac_addr[i];
45 if (offset == offsetof(struct virtio_net_config, status)) {
46 virtio_user_dev_update_link_state(dev);
48 *(uint16_t *)dst = dev->net_status;
51 if (offset == offsetof(struct virtio_net_config, max_virtqueue_pairs))
52 *(uint16_t *)dst = dev->max_queue_pairs;
56 virtio_user_write_dev_config(struct virtio_hw *hw, size_t offset,
57 const void *src, int length)
60 struct virtio_user_dev *dev = virtio_user_get_dev(hw);
62 if ((offset == offsetof(struct virtio_net_config, mac)) &&
63 (length == RTE_ETHER_ADDR_LEN)) {
64 for (i = 0; i < RTE_ETHER_ADDR_LEN; ++i)
65 dev->mac_addr[i] = ((const uint8_t *)src)[i];
66 virtio_user_dev_set_mac(dev);
67 virtio_user_dev_get_mac(dev);
69 PMD_DRV_LOG(ERR, "not supported offset=%zu, len=%d",
75 virtio_user_reset(struct virtio_hw *hw)
77 struct virtio_user_dev *dev = virtio_user_get_dev(hw);
79 if (dev->status & VIRTIO_CONFIG_STATUS_DRIVER_OK)
80 virtio_user_stop_device(dev);
84 virtio_user_set_status(struct virtio_hw *hw, uint8_t status)
86 struct virtio_user_dev *dev = virtio_user_get_dev(hw);
87 uint8_t old_status = dev->status;
89 if (status & VIRTIO_CONFIG_STATUS_FEATURES_OK &&
90 ~old_status & VIRTIO_CONFIG_STATUS_FEATURES_OK)
91 virtio_user_dev_set_features(dev);
92 if (status & VIRTIO_CONFIG_STATUS_DRIVER_OK)
93 virtio_user_start_device(dev);
94 else if (status == VIRTIO_CONFIG_STATUS_RESET)
95 virtio_user_reset(hw);
97 virtio_user_dev_set_status(dev, status);
101 virtio_user_get_status(struct virtio_hw *hw)
103 struct virtio_user_dev *dev = virtio_user_get_dev(hw);
105 virtio_user_dev_update_status(dev);
111 virtio_user_get_features(struct virtio_hw *hw)
113 struct virtio_user_dev *dev = virtio_user_get_dev(hw);
115 /* unmask feature bits defined in vhost user protocol */
116 return (dev->device_features | dev->frontend_features) &
117 VIRTIO_PMD_SUPPORTED_GUEST_FEATURES;
121 virtio_user_set_features(struct virtio_hw *hw, uint64_t features)
123 struct virtio_user_dev *dev = virtio_user_get_dev(hw);
125 dev->features = features & (dev->device_features | dev->frontend_features);
129 virtio_user_features_ok(struct virtio_hw *hw __rte_unused)
135 virtio_user_get_isr(struct virtio_hw *hw __rte_unused)
137 /* rxq interrupts and config interrupt are separated in virtio-user,
138 * here we only report config change.
140 return VIRTIO_ISR_CONFIG;
144 virtio_user_set_config_irq(struct virtio_hw *hw __rte_unused,
145 uint16_t vec __rte_unused)
151 virtio_user_set_queue_irq(struct virtio_hw *hw __rte_unused,
152 struct virtqueue *vq __rte_unused,
155 /* pretend we have done that */
159 /* This function is to get the queue size, aka, number of descs, of a specified
160 * queue. Different with the VHOST_USER_GET_QUEUE_NUM, which is used to get the
161 * max supported queues.
164 virtio_user_get_queue_num(struct virtio_hw *hw, uint16_t queue_id __rte_unused)
166 struct virtio_user_dev *dev = virtio_user_get_dev(hw);
168 /* Currently, each queue has same queue size */
169 return dev->queue_size;
173 virtio_user_setup_queue_packed(struct virtqueue *vq,
174 struct virtio_user_dev *dev)
176 uint16_t queue_idx = vq->vq_queue_index;
177 struct vring_packed *vring;
183 vring = &dev->packed_vrings[queue_idx];
184 desc_addr = (uintptr_t)vq->vq_ring_virt_mem;
185 avail_addr = desc_addr + vq->vq_nentries *
186 sizeof(struct vring_packed_desc);
187 used_addr = RTE_ALIGN_CEIL(avail_addr +
188 sizeof(struct vring_packed_desc_event),
190 vring->num = vq->vq_nentries;
191 vring->desc = (void *)(uintptr_t)desc_addr;
192 vring->driver = (void *)(uintptr_t)avail_addr;
193 vring->device = (void *)(uintptr_t)used_addr;
194 dev->packed_queues[queue_idx].avail_wrap_counter = true;
195 dev->packed_queues[queue_idx].used_wrap_counter = true;
197 for (i = 0; i < vring->num; i++)
198 vring->desc[i].flags = 0;
202 virtio_user_setup_queue_split(struct virtqueue *vq, struct virtio_user_dev *dev)
204 uint16_t queue_idx = vq->vq_queue_index;
205 uint64_t desc_addr, avail_addr, used_addr;
207 desc_addr = (uintptr_t)vq->vq_ring_virt_mem;
208 avail_addr = desc_addr + vq->vq_nentries * sizeof(struct vring_desc);
209 used_addr = RTE_ALIGN_CEIL(avail_addr + offsetof(struct vring_avail,
210 ring[vq->vq_nentries]),
213 dev->vrings[queue_idx].num = vq->vq_nentries;
214 dev->vrings[queue_idx].desc = (void *)(uintptr_t)desc_addr;
215 dev->vrings[queue_idx].avail = (void *)(uintptr_t)avail_addr;
216 dev->vrings[queue_idx].used = (void *)(uintptr_t)used_addr;
220 virtio_user_setup_queue(struct virtio_hw *hw, struct virtqueue *vq)
222 struct virtio_user_dev *dev = virtio_user_get_dev(hw);
224 if (virtio_with_packed_queue(hw))
225 virtio_user_setup_queue_packed(vq, dev);
227 virtio_user_setup_queue_split(vq, dev);
233 virtio_user_del_queue(struct virtio_hw *hw, struct virtqueue *vq)
235 /* For legacy devices, write 0 to VIRTIO_PCI_QUEUE_PFN port, QEMU
236 * correspondingly stops the ioeventfds, and reset the status of
238 * For modern devices, set queue desc, avail, used in PCI bar to 0,
239 * not see any more behavior in QEMU.
241 * Here we just care about what information to deliver to vhost-user
242 * or vhost-kernel. So we just close ioeventfd for now.
244 struct virtio_user_dev *dev = virtio_user_get_dev(hw);
246 close(dev->callfds[vq->vq_queue_index]);
247 close(dev->kickfds[vq->vq_queue_index]);
251 virtio_user_notify_queue(struct virtio_hw *hw, struct virtqueue *vq)
254 struct virtio_user_dev *dev = virtio_user_get_dev(hw);
256 if (hw->cvq && (virtnet_cq_to_vq(hw->cvq) == vq)) {
257 if (virtio_with_packed_queue(vq->hw))
258 virtio_user_handle_cq_packed(dev, vq->vq_queue_index);
260 virtio_user_handle_cq(dev, vq->vq_queue_index);
264 if (write(dev->kickfds[vq->vq_queue_index], &buf, sizeof(buf)) < 0)
265 PMD_DRV_LOG(ERR, "failed to kick backend: %s",
270 virtio_user_dev_close(struct virtio_hw *hw)
272 struct virtio_user_dev *dev = virtio_user_get_dev(hw);
274 virtio_user_dev_uninit(dev);
279 const struct virtio_ops virtio_user_ops = {
280 .read_dev_cfg = virtio_user_read_dev_config,
281 .write_dev_cfg = virtio_user_write_dev_config,
282 .get_status = virtio_user_get_status,
283 .set_status = virtio_user_set_status,
284 .get_features = virtio_user_get_features,
285 .set_features = virtio_user_set_features,
286 .features_ok = virtio_user_features_ok,
287 .get_isr = virtio_user_get_isr,
288 .set_config_irq = virtio_user_set_config_irq,
289 .set_queue_irq = virtio_user_set_queue_irq,
290 .get_queue_num = virtio_user_get_queue_num,
291 .setup_queue = virtio_user_setup_queue,
292 .del_queue = virtio_user_del_queue,
293 .notify_queue = virtio_user_notify_queue,
294 .dev_close = virtio_user_dev_close,
297 static const char *valid_args[] = {
298 #define VIRTIO_USER_ARG_QUEUES_NUM "queues"
299 VIRTIO_USER_ARG_QUEUES_NUM,
300 #define VIRTIO_USER_ARG_CQ_NUM "cq"
301 VIRTIO_USER_ARG_CQ_NUM,
302 #define VIRTIO_USER_ARG_MAC "mac"
304 #define VIRTIO_USER_ARG_PATH "path"
305 VIRTIO_USER_ARG_PATH,
306 #define VIRTIO_USER_ARG_QUEUE_SIZE "queue_size"
307 VIRTIO_USER_ARG_QUEUE_SIZE,
308 #define VIRTIO_USER_ARG_INTERFACE_NAME "iface"
309 VIRTIO_USER_ARG_INTERFACE_NAME,
310 #define VIRTIO_USER_ARG_SERVER_MODE "server"
311 VIRTIO_USER_ARG_SERVER_MODE,
312 #define VIRTIO_USER_ARG_MRG_RXBUF "mrg_rxbuf"
313 VIRTIO_USER_ARG_MRG_RXBUF,
314 #define VIRTIO_USER_ARG_IN_ORDER "in_order"
315 VIRTIO_USER_ARG_IN_ORDER,
316 #define VIRTIO_USER_ARG_PACKED_VQ "packed_vq"
317 VIRTIO_USER_ARG_PACKED_VQ,
318 #define VIRTIO_USER_ARG_SPEED "speed"
319 VIRTIO_USER_ARG_SPEED,
320 #define VIRTIO_USER_ARG_VECTORIZED "vectorized"
321 VIRTIO_USER_ARG_VECTORIZED,
325 #define VIRTIO_USER_DEF_CQ_EN 0
326 #define VIRTIO_USER_DEF_Q_NUM 1
327 #define VIRTIO_USER_DEF_Q_SZ 256
328 #define VIRTIO_USER_DEF_SERVER_MODE 0
331 get_string_arg(const char *key __rte_unused,
332 const char *value, void *extra_args)
334 if (!value || !extra_args)
337 *(char **)extra_args = strdup(value);
339 if (!*(char **)extra_args)
346 get_integer_arg(const char *key __rte_unused,
347 const char *value, void *extra_args)
349 uint64_t integer = 0;
350 if (!value || !extra_args)
353 integer = strtoull(value, NULL, 0);
354 /* extra_args keeps default value, it should be replaced
355 * only in case of successful parsing of the 'value' arg
358 *(uint64_t *)extra_args = integer;
363 vdpa_dynamic_major_num(void)
372 fp = fopen("/proc/devices", "r");
374 PMD_INIT_LOG(ERR, "Cannot open /proc/devices: %s",
376 return UNNAMED_MAJOR;
379 while (getline(&line, &size, fp) > 0) {
380 char *stripped = line + strspn(line, " ");
381 if ((sscanf(stripped, "%u %10s", &num, name) == 2) &&
382 (strncmp(name, "vhost-vdpa", 10) == 0)) {
389 return found ? num : UNNAMED_MAJOR;
392 static enum virtio_user_backend_type
393 virtio_user_backend_type(const char *path)
397 if (stat(path, &sb) == -1) {
399 return VIRTIO_USER_BACKEND_VHOST_USER;
401 PMD_INIT_LOG(ERR, "Stat fails: %s (%s)", path,
403 return VIRTIO_USER_BACKEND_UNKNOWN;
406 if (S_ISSOCK(sb.st_mode)) {
407 return VIRTIO_USER_BACKEND_VHOST_USER;
408 } else if (S_ISCHR(sb.st_mode)) {
409 if (major(sb.st_rdev) == MISC_MAJOR)
410 return VIRTIO_USER_BACKEND_VHOST_KERNEL;
411 if (major(sb.st_rdev) == vdpa_dynamic_major_num())
412 return VIRTIO_USER_BACKEND_VHOST_VDPA;
414 return VIRTIO_USER_BACKEND_UNKNOWN;
417 static struct rte_eth_dev *
418 virtio_user_eth_dev_alloc(struct rte_vdev_device *vdev)
420 struct rte_eth_dev *eth_dev;
421 struct rte_eth_dev_data *data;
422 struct virtio_hw *hw;
423 struct virtio_user_dev *dev;
425 eth_dev = rte_eth_vdev_allocate(vdev, sizeof(*dev));
427 PMD_INIT_LOG(ERR, "cannot alloc rte_eth_dev");
431 data = eth_dev->data;
432 dev = eth_dev->data->dev_private;
435 hw->port_id = data->port_id;
436 VIRTIO_OPS(hw) = &virtio_user_ops;
441 hw->use_inorder_rx = 0;
442 hw->use_inorder_tx = 0;
448 virtio_user_eth_dev_free(struct rte_eth_dev *eth_dev)
450 rte_eth_dev_release_port(eth_dev);
453 /* Dev initialization routine. Invoked once for each virtio vdev at
454 * EAL init time, see rte_bus_probe().
455 * Returns 0 on success.
458 virtio_user_pmd_probe(struct rte_vdev_device *vdev)
460 struct rte_kvargs *kvlist = NULL;
461 struct rte_eth_dev *eth_dev;
462 struct virtio_hw *hw;
463 struct virtio_user_dev *dev;
464 enum virtio_user_backend_type backend_type = VIRTIO_USER_BACKEND_UNKNOWN;
465 uint64_t queues = VIRTIO_USER_DEF_Q_NUM;
466 uint64_t cq = VIRTIO_USER_DEF_CQ_EN;
467 uint64_t queue_size = VIRTIO_USER_DEF_Q_SZ;
468 uint64_t server_mode = VIRTIO_USER_DEF_SERVER_MODE;
469 uint64_t mrg_rxbuf = 1;
470 uint64_t in_order = 1;
471 uint64_t packed_vq = 0;
472 uint64_t vectorized = 0;
475 char *mac_addr = NULL;
478 RTE_BUILD_BUG_ON(offsetof(struct virtio_user_dev, hw) != 0);
480 if (rte_eal_process_type() == RTE_PROC_SECONDARY) {
481 const char *name = rte_vdev_device_name(vdev);
482 eth_dev = rte_eth_dev_attach_secondary(name);
484 PMD_INIT_LOG(ERR, "Failed to probe %s", name);
488 dev = eth_dev->data->dev_private;
490 VIRTIO_OPS(hw) = &virtio_user_ops;
492 if (eth_virtio_dev_init(eth_dev) < 0) {
493 PMD_INIT_LOG(ERR, "eth_virtio_dev_init fails");
494 rte_eth_dev_release_port(eth_dev);
498 eth_dev->dev_ops = &virtio_user_secondary_eth_dev_ops;
499 eth_dev->device = &vdev->device;
500 rte_eth_dev_probing_finish(eth_dev);
504 kvlist = rte_kvargs_parse(rte_vdev_device_args(vdev), valid_args);
506 PMD_INIT_LOG(ERR, "error when parsing param");
510 if (rte_kvargs_count(kvlist, VIRTIO_USER_ARG_PATH) == 1) {
511 if (rte_kvargs_process(kvlist, VIRTIO_USER_ARG_PATH,
512 &get_string_arg, &path) < 0) {
513 PMD_INIT_LOG(ERR, "error to parse %s",
514 VIRTIO_USER_ARG_PATH);
518 PMD_INIT_LOG(ERR, "arg %s is mandatory for virtio_user",
519 VIRTIO_USER_ARG_PATH);
523 backend_type = virtio_user_backend_type(path);
524 if (backend_type == VIRTIO_USER_BACKEND_UNKNOWN) {
526 "unable to determine backend type for path %s",
530 PMD_INIT_LOG(INFO, "Backend type detected: %s",
531 virtio_user_backend_strings[backend_type]);
533 if (rte_kvargs_count(kvlist, VIRTIO_USER_ARG_INTERFACE_NAME) == 1) {
534 if (backend_type != VIRTIO_USER_BACKEND_VHOST_KERNEL) {
536 "arg %s applies only to vhost-kernel backend",
537 VIRTIO_USER_ARG_INTERFACE_NAME);
541 if (rte_kvargs_process(kvlist, VIRTIO_USER_ARG_INTERFACE_NAME,
542 &get_string_arg, &ifname) < 0) {
543 PMD_INIT_LOG(ERR, "error to parse %s",
544 VIRTIO_USER_ARG_INTERFACE_NAME);
549 if (rte_kvargs_count(kvlist, VIRTIO_USER_ARG_MAC) == 1) {
550 if (rte_kvargs_process(kvlist, VIRTIO_USER_ARG_MAC,
551 &get_string_arg, &mac_addr) < 0) {
552 PMD_INIT_LOG(ERR, "error to parse %s",
553 VIRTIO_USER_ARG_MAC);
558 if (rte_kvargs_count(kvlist, VIRTIO_USER_ARG_QUEUE_SIZE) == 1) {
559 if (rte_kvargs_process(kvlist, VIRTIO_USER_ARG_QUEUE_SIZE,
560 &get_integer_arg, &queue_size) < 0) {
561 PMD_INIT_LOG(ERR, "error to parse %s",
562 VIRTIO_USER_ARG_QUEUE_SIZE);
567 if (rte_kvargs_count(kvlist, VIRTIO_USER_ARG_QUEUES_NUM) == 1) {
568 if (rte_kvargs_process(kvlist, VIRTIO_USER_ARG_QUEUES_NUM,
569 &get_integer_arg, &queues) < 0) {
570 PMD_INIT_LOG(ERR, "error to parse %s",
571 VIRTIO_USER_ARG_QUEUES_NUM);
576 if (rte_kvargs_count(kvlist, VIRTIO_USER_ARG_SERVER_MODE) == 1) {
577 if (rte_kvargs_process(kvlist, VIRTIO_USER_ARG_SERVER_MODE,
578 &get_integer_arg, &server_mode) < 0) {
579 PMD_INIT_LOG(ERR, "error to parse %s",
580 VIRTIO_USER_ARG_SERVER_MODE);
585 if (rte_kvargs_count(kvlist, VIRTIO_USER_ARG_CQ_NUM) == 1) {
586 if (rte_kvargs_process(kvlist, VIRTIO_USER_ARG_CQ_NUM,
587 &get_integer_arg, &cq) < 0) {
588 PMD_INIT_LOG(ERR, "error to parse %s",
589 VIRTIO_USER_ARG_CQ_NUM);
592 } else if (queues > 1) {
596 if (rte_kvargs_count(kvlist, VIRTIO_USER_ARG_PACKED_VQ) == 1) {
597 if (rte_kvargs_process(kvlist, VIRTIO_USER_ARG_PACKED_VQ,
598 &get_integer_arg, &packed_vq) < 0) {
599 PMD_INIT_LOG(ERR, "error to parse %s",
600 VIRTIO_USER_ARG_PACKED_VQ);
605 if (rte_kvargs_count(kvlist, VIRTIO_USER_ARG_VECTORIZED) == 1) {
606 if (rte_kvargs_process(kvlist, VIRTIO_USER_ARG_VECTORIZED,
607 &get_integer_arg, &vectorized) < 0) {
608 PMD_INIT_LOG(ERR, "error to parse %s",
609 VIRTIO_USER_ARG_VECTORIZED);
614 if (queues > 1 && cq == 0) {
615 PMD_INIT_LOG(ERR, "multi-q requires ctrl-q");
619 if (queues > VIRTIO_MAX_VIRTQUEUE_PAIRS) {
620 PMD_INIT_LOG(ERR, "arg %s %" PRIu64 " exceeds the limit %u",
621 VIRTIO_USER_ARG_QUEUES_NUM, queues,
622 VIRTIO_MAX_VIRTQUEUE_PAIRS);
626 if (rte_kvargs_count(kvlist, VIRTIO_USER_ARG_MRG_RXBUF) == 1) {
627 if (rte_kvargs_process(kvlist, VIRTIO_USER_ARG_MRG_RXBUF,
628 &get_integer_arg, &mrg_rxbuf) < 0) {
629 PMD_INIT_LOG(ERR, "error to parse %s",
630 VIRTIO_USER_ARG_MRG_RXBUF);
635 if (rte_kvargs_count(kvlist, VIRTIO_USER_ARG_IN_ORDER) == 1) {
636 if (rte_kvargs_process(kvlist, VIRTIO_USER_ARG_IN_ORDER,
637 &get_integer_arg, &in_order) < 0) {
638 PMD_INIT_LOG(ERR, "error to parse %s",
639 VIRTIO_USER_ARG_IN_ORDER);
644 eth_dev = virtio_user_eth_dev_alloc(vdev);
646 PMD_INIT_LOG(ERR, "virtio_user fails to alloc device");
650 dev = eth_dev->data->dev_private;
652 if (virtio_user_dev_init(dev, path, queues, cq,
653 queue_size, mac_addr, &ifname, server_mode,
654 mrg_rxbuf, in_order, packed_vq, backend_type) < 0) {
655 PMD_INIT_LOG(ERR, "virtio_user_dev_init fails");
656 virtio_user_eth_dev_free(eth_dev);
661 * Virtio-user requires using virtual addresses for the descriptors
662 * buffers, whatever other devices require
666 /* previously called by pci probing for physical dev */
667 if (eth_virtio_dev_init(eth_dev) < 0) {
668 PMD_INIT_LOG(ERR, "eth_virtio_dev_init fails");
669 virtio_user_dev_uninit(dev);
670 virtio_user_eth_dev_free(eth_dev);
676 #if defined(CC_AVX512_SUPPORT) || defined(RTE_ARCH_ARM)
681 "building environment do not support packed ring vectorized");
688 rte_eth_dev_probing_finish(eth_dev);
693 rte_kvargs_free(kvlist);
704 virtio_user_pmd_remove(struct rte_vdev_device *vdev)
707 struct rte_eth_dev *eth_dev;
712 name = rte_vdev_device_name(vdev);
713 PMD_DRV_LOG(INFO, "Un-Initializing %s", name);
714 eth_dev = rte_eth_dev_allocated(name);
715 /* Port has already been released by close. */
719 if (rte_eal_process_type() != RTE_PROC_PRIMARY)
720 return rte_eth_dev_release_port(eth_dev);
722 /* make sure the device is stopped, queues freed */
723 return rte_eth_dev_close(eth_dev->data->port_id);
726 static int virtio_user_pmd_dma_map(struct rte_vdev_device *vdev, void *addr,
727 uint64_t iova, size_t len)
730 struct rte_eth_dev *eth_dev;
731 struct virtio_user_dev *dev;
736 name = rte_vdev_device_name(vdev);
737 eth_dev = rte_eth_dev_allocated(name);
738 /* Port has already been released by close. */
742 dev = eth_dev->data->dev_private;
744 if (dev->ops->dma_map)
745 return dev->ops->dma_map(dev, addr, iova, len);
750 static int virtio_user_pmd_dma_unmap(struct rte_vdev_device *vdev, void *addr,
751 uint64_t iova, size_t len)
754 struct rte_eth_dev *eth_dev;
755 struct virtio_user_dev *dev;
760 name = rte_vdev_device_name(vdev);
761 eth_dev = rte_eth_dev_allocated(name);
762 /* Port has already been released by close. */
766 dev = eth_dev->data->dev_private;
768 if (dev->ops->dma_unmap)
769 return dev->ops->dma_unmap(dev, addr, iova, len);
774 static struct rte_vdev_driver virtio_user_driver = {
775 .probe = virtio_user_pmd_probe,
776 .remove = virtio_user_pmd_remove,
777 .dma_map = virtio_user_pmd_dma_map,
778 .dma_unmap = virtio_user_pmd_dma_unmap,
781 RTE_PMD_REGISTER_VDEV(net_virtio_user, virtio_user_driver);
782 RTE_PMD_REGISTER_ALIAS(net_virtio_user, virtio_user);
783 RTE_PMD_REGISTER_PARAM_STRING(net_virtio_user,