1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright 2017 6WIND S.A.
3 * Copyright 2017 Mellanox Technologies, Ltd
9 #include <linux/sockios.h>
10 #include <linux/netlink.h>
11 #include <linux/rtnetlink.h>
13 #include <net/if_arp.h>
14 #include <netinet/ip.h>
21 #include <sys/ioctl.h>
22 #include <sys/queue.h>
23 #include <sys/socket.h>
26 #include <rte_alarm.h>
28 #include <rte_bus_vdev.h>
29 #include <rte_common.h>
30 #include <rte_config.h>
32 #include <rte_errno.h>
33 #include <rte_ethdev.h>
34 #include <rte_ether.h>
35 #include <rte_hypervisor.h>
36 #include <rte_kvargs.h>
38 #include <rte_string_fns.h>
40 #define VDEV_NETVSC_DRIVER net_vdev_netvsc
41 #define VDEV_NETVSC_DRIVER_NAME RTE_STR(VDEV_NETVSC_DRIVER)
42 #define VDEV_NETVSC_DRIVER_NAME_LEN 15
43 #define VDEV_NETVSC_ARG_IFACE "iface"
44 #define VDEV_NETVSC_ARG_MAC "mac"
45 #define VDEV_NETVSC_ARG_FORCE "force"
46 #define VDEV_NETVSC_ARG_IGNORE "ignore"
47 #define VDEV_NETVSC_PROBE_MS 1000
49 #define NETVSC_CLASS_ID "{f8615163-df3e-46c5-913f-f2d2f965ed0e}"
50 #define NETVSC_MAX_ROUTE_LINE_SIZE 300
52 #define DRV_LOG(level, ...) \
53 rte_log(RTE_LOG_ ## level, \
54 vdev_netvsc_logtype, \
55 RTE_FMT(VDEV_NETVSC_DRIVER_NAME ": " \
56 RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
57 RTE_FMT_TAIL(__VA_ARGS__,)))
59 /** Driver-specific log messages type. */
60 static int vdev_netvsc_logtype;
62 /** Context structure for a vdev_netvsc instance. */
63 struct vdev_netvsc_ctx {
64 LIST_ENTRY(vdev_netvsc_ctx) entry; /**< Next entry in list. */
65 unsigned int id; /**< Unique ID. */
66 char name[64]; /**< Unique name. */
67 char devname[64]; /**< Fail-safe instance name. */
68 char devargs[256]; /**< Fail-safe device arguments. */
69 char if_name[IF_NAMESIZE]; /**< NetVSC netdevice name. */
70 unsigned int if_index; /**< NetVSC netdevice index. */
71 struct rte_ether_addr if_addr; /**< NetVSC MAC address. */
72 int pipe[2]; /**< Fail-safe communication pipe. */
73 char yield[256]; /**< PCI sub-device arguments. */
76 /** Context list is common to all driver instances. */
77 static LIST_HEAD(, vdev_netvsc_ctx) vdev_netvsc_ctx_list =
78 LIST_HEAD_INITIALIZER(vdev_netvsc_ctx_list);
80 /** Number of entries in context list. */
81 static unsigned int vdev_netvsc_ctx_count;
83 /** Number of driver instances relying on context list. */
84 static unsigned int vdev_netvsc_ctx_inst;
87 * Destroy a vdev_netvsc context instance.
93 vdev_netvsc_ctx_destroy(struct vdev_netvsc_ctx *ctx)
95 if (ctx->pipe[0] != -1)
97 if (ctx->pipe[1] != -1)
103 * Determine if a network interface is NetVSC.
106 * Pointer to netdevice description structure (name and index).
109 * A nonzero value when interface is detected as NetVSC. In case of error,
110 * rte_errno is updated and 0 returned.
113 vdev_netvsc_iface_is_netvsc(const struct if_nameindex *iface)
115 static const char temp[] = "/sys/class/net/%s/device/class_id";
116 char path[sizeof(temp) + IF_NAMESIZE];
121 ret = snprintf(path, sizeof(path), temp, iface->if_name);
122 if (ret == -1 || (size_t)ret >= sizeof(path)) {
126 f = fopen(path, "r");
131 ret = fscanf(f, NETVSC_CLASS_ID "%n", &len);
134 ret = len == (int)strlen(NETVSC_CLASS_ID);
140 * Iterate over system network interfaces.
142 * This function runs a given callback function for each netdevice found on
146 * Callback function pointer. List traversal is aborted when this function
147 * returns a nonzero value.
149 * Indicates the device type to iterate - netvsc or non-netvsc.
151 * Variable parameter list passed as @p va_list to @p func.
154 * 0 when the entire list is traversed successfully, a negative error code
155 * in case or failure, or the nonzero value returned by @p func when list
156 * traversal is aborted.
159 vdev_netvsc_foreach_iface(int (*func)(const struct if_nameindex *iface,
160 const struct rte_ether_addr *eth_addr,
161 va_list ap), int is_netvsc, ...)
163 struct if_nameindex *iface = if_nameindex();
164 int s = socket(PF_INET, SOCK_DGRAM, IPPROTO_IP);
170 DRV_LOG(ERR, "cannot retrieve system network interfaces");
175 DRV_LOG(ERR, "cannot open socket: %s", rte_strerror(errno));
178 for (i = 0; iface[i].if_name; ++i) {
181 struct rte_ether_addr eth_addr;
184 is_netvsc_ret = vdev_netvsc_iface_is_netvsc(&iface[i]) ? 1 : 0;
185 if (is_netvsc ^ is_netvsc_ret)
187 strlcpy(req.ifr_name, iface[i].if_name, sizeof(req.ifr_name));
188 if (ioctl(s, SIOCGIFHWADDR, &req) == -1) {
189 DRV_LOG(WARNING, "cannot retrieve information about"
190 " interface \"%s\": %s",
191 req.ifr_name, rte_strerror(errno));
194 if (req.ifr_hwaddr.sa_family != ARPHRD_ETHER)
196 memcpy(eth_addr.addr_bytes, req.ifr_hwaddr.sa_data,
197 RTE_DIM(eth_addr.addr_bytes));
198 va_start(ap, is_netvsc);
199 ret = func(&iface[i], ð_addr, ap);
208 if_freenameindex(iface);
213 * Determine if a network interface has a route.
216 * Network device name.
218 * Address family: AF_INET for IPv4 or AF_INET6 for IPv6.
221 * 1 when interface has a route, negative errno value in case of error and
225 vdev_netvsc_has_route(const struct if_nameindex *iface,
226 const unsigned char family)
229 * The implementation can be simpler by getifaddrs() function usage but
230 * it works for IPv6 only starting from glibc 2.3.3.
237 struct nlmsghdr *retmsg = (struct nlmsghdr *)buf;
238 struct sockaddr_nl sa;
240 struct nlmsghdr nlhdr;
241 struct ifaddrmsg addrmsg;
244 if (!iface || (family != AF_INET && family != AF_INET6)) {
245 DRV_LOG(ERR, "%s", rte_strerror(EINVAL));
248 sock = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
250 DRV_LOG(ERR, "cannot open socket: %s", rte_strerror(errno));
253 memset(&sa, 0, sizeof(sa));
254 sa.nl_family = AF_NETLINK;
255 sa.nl_groups = RTMGRP_LINK | RTMGRP_IPV4_IFADDR;
256 res = bind(sock, (struct sockaddr *)&sa, sizeof(sa));
259 DRV_LOG(ERR, "cannot bind socket: %s", rte_strerror(errno));
262 memset(&msg, 0, sizeof(msg));
263 msg.nlhdr.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifaddrmsg));
264 msg.nlhdr.nlmsg_flags = NLM_F_REQUEST | NLM_F_DUMP;
265 msg.nlhdr.nlmsg_type = RTM_GETADDR;
266 msg.nlhdr.nlmsg_pid = getpid();
267 msg.addrmsg.ifa_family = family;
268 msg.addrmsg.ifa_index = iface->if_index;
269 res = send(sock, &msg, msg.nlhdr.nlmsg_len, 0);
272 DRV_LOG(ERR, "cannot send socket message: %s",
273 rte_strerror(errno));
276 memset(buf, 0, sizeof(buf));
277 len = recv(sock, buf, sizeof(buf), 0);
280 DRV_LOG(ERR, "cannot receive socket message: %s",
281 rte_strerror(errno));
284 while (NLMSG_OK(retmsg, (unsigned int)len)) {
285 struct ifaddrmsg *retaddr =
286 (struct ifaddrmsg *)NLMSG_DATA(retmsg);
288 if (retaddr->ifa_family == family &&
289 retaddr->ifa_index == iface->if_index) {
290 struct rtattr *retrta = IFA_RTA(retaddr);
291 int attlen = IFA_PAYLOAD(retmsg);
293 while (RTA_OK(retrta, attlen)) {
294 if (retrta->rta_type == IFA_ADDRESS) {
296 DRV_LOG(DEBUG, "interface %s has IP",
300 retrta = RTA_NEXT(retrta, attlen);
303 retmsg = NLMSG_NEXT(retmsg, len);
311 * Retrieve network interface data from sysfs symbolic link.
314 * Output data buffer.
316 * Output buffer size.
320 * Symbolic link path relative to netdevice sysfs entry.
323 * 0 on success, a negative error code otherwise.
326 vdev_netvsc_sysfs_readlink(char *buf, size_t size, const char *if_name,
329 struct vdev_netvsc_ctx *ctx;
330 char in[RTE_MAX(sizeof(ctx->yield), 256u)];
333 ret = snprintf(in, sizeof(in), "/sys/class/net/%s/%s",
335 if (ret == -1 || (size_t)ret >= sizeof(in))
337 ret = readlink(in, buf, size);
340 if ((size_t)ret >= size - 1)
347 * Probe a network interface to associate with vdev_netvsc context.
349 * This function determines if the network device matches the properties of
350 * the NetVSC interface associated with the vdev_netvsc context and
351 * communicates its bus address to the fail-safe PMD instance if so.
353 * It is normally used with vdev_netvsc_foreach_iface().
356 * Pointer to netdevice description structure (name and index).
357 * @param[in] eth_addr
358 * MAC address associated with @p iface.
360 * Variable arguments list comprising:
362 * - struct vdev_netvsc_ctx *ctx:
363 * Context to associate network interface with.
366 * A nonzero value when interface matches, 0 otherwise or in case of
370 vdev_netvsc_device_probe(const struct if_nameindex *iface,
371 const struct rte_ether_addr *eth_addr,
374 struct vdev_netvsc_ctx *ctx = va_arg(ap, struct vdev_netvsc_ctx *);
375 char buf[RTE_MAX(sizeof(ctx->yield), 256u)];
380 /* Skip non-matching or unwanted NetVSC interfaces. */
381 if (ctx->if_index == iface->if_index) {
382 if (!strcmp(ctx->if_name, iface->if_name))
385 "NetVSC interface \"%s\" (index %u) renamed \"%s\"",
386 ctx->if_name, ctx->if_index, iface->if_name);
387 strlcpy(ctx->if_name, iface->if_name, sizeof(ctx->if_name));
390 if (!rte_is_same_ether_addr(eth_addr, &ctx->if_addr))
392 /* Look for associated PCI device. */
393 ret = vdev_netvsc_sysfs_readlink(buf, sizeof(buf), iface->if_name,
397 addr = strrchr(buf, '/');
398 addr = addr ? addr + 1 : buf;
399 if (strcmp(addr, "pci"))
401 ret = vdev_netvsc_sysfs_readlink(buf, sizeof(buf), iface->if_name,
405 addr = strrchr(buf, '/');
406 addr = addr ? addr + 1 : buf;
410 /* Send PCI device argument to fail-safe PMD instance. */
411 if (strcmp(addr, ctx->yield))
412 DRV_LOG(DEBUG, "associating PCI device \"%s\" with NetVSC"
413 " interface \"%s\" (index %u)", addr, ctx->if_name,
415 memmove(buf, addr, len + 1);
418 ret = write(ctx->pipe[1], addr, len + 1);
421 if (errno == EINTR || errno == EAGAIN)
423 DRV_LOG(WARNING, "cannot associate PCI device name \"%s\" with"
424 " interface \"%s\": %s", addr, ctx->if_name,
425 rte_strerror(errno));
428 if ((size_t)ret != len + 1) {
430 * Attempt to override previous partial write, no need to
431 * recover if that fails.
433 ret = write(ctx->pipe[1], "\n", 1);
438 memcpy(ctx->yield, addr, len + 1);
443 * Alarm callback that regularly probes system network interfaces.
445 * This callback runs at a frequency determined by VDEV_NETVSC_PROBE_MS as
446 * long as an vdev_netvsc context instance exists.
452 vdev_netvsc_alarm(__rte_unused void *arg)
454 struct vdev_netvsc_ctx *ctx;
457 LIST_FOREACH(ctx, &vdev_netvsc_ctx_list, entry) {
458 ret = vdev_netvsc_foreach_iface(vdev_netvsc_device_probe, 0,
463 if (!vdev_netvsc_ctx_count)
465 ret = rte_eal_alarm_set(VDEV_NETVSC_PROBE_MS * 1000,
466 vdev_netvsc_alarm, NULL);
468 DRV_LOG(ERR, "unable to reschedule alarm callback: %s",
474 * Probe a NetVSC interface to generate a vdev_netvsc context from.
476 * This function instantiates vdev_netvsc contexts either for all NetVSC
477 * devices found on the system or only a subset provided as device
480 * It is normally used with vdev_netvsc_foreach_iface().
483 * Pointer to netdevice description structure (name and index).
484 * @param[in] eth_addr
485 * MAC address associated with @p iface.
487 * Variable arguments list comprising:
489 * - const char *name:
490 * Name associated with current driver instance.
492 * - struct rte_kvargs *kvargs:
493 * Device arguments provided to current driver instance.
496 * Accept specified interface even if not detected as NetVSC.
498 * - unsigned int specified:
499 * Number of specific netdevices provided as device arguments.
501 * - unsigned int *matched:
502 * The number of specified netdevices matched by this function.
505 * A nonzero value when interface matches, 0 otherwise or in case of
509 vdev_netvsc_netvsc_probe(const struct if_nameindex *iface,
510 const struct rte_ether_addr *eth_addr,
513 const char *name = va_arg(ap, const char *);
514 struct rte_kvargs *kvargs = va_arg(ap, struct rte_kvargs *);
515 unsigned int specified = va_arg(ap, unsigned int);
516 unsigned int *matched = va_arg(ap, unsigned int *);
518 struct vdev_netvsc_ctx *ctx;
521 /* Probe all interfaces when none are specified. */
523 for (i = 0; i != kvargs->count; ++i) {
524 const struct rte_kvargs_pair *pair = &kvargs->pairs[i];
526 if (!strcmp(pair->key, VDEV_NETVSC_ARG_IFACE)) {
527 if (!strcmp(pair->value, iface->if_name))
529 } else if (!strcmp(pair->key, VDEV_NETVSC_ARG_MAC)) {
530 struct rte_ether_addr tmp;
532 if (sscanf(pair->value,
533 "%" SCNx8 ":%" SCNx8 ":%" SCNx8 ":"
534 "%" SCNx8 ":%" SCNx8 ":%" SCNx8,
540 &tmp.addr_bytes[5]) != 6) {
542 "invalid MAC address format"
547 if (rte_is_same_ether_addr(eth_addr, &tmp))
551 if (i == kvargs->count)
555 /* Weed out interfaces already handled. */
556 LIST_FOREACH(ctx, &vdev_netvsc_ctx_list, entry)
557 if (ctx->if_index == iface->if_index)
563 "interface \"%s\" (index %u) is already handled,"
565 iface->if_name, iface->if_index);
568 /* Routed NetVSC should not be probed. */
569 if (vdev_netvsc_has_route(iface, AF_INET) ||
570 vdev_netvsc_has_route(iface, AF_INET6)) {
573 DRV_LOG(WARNING, "probably using routed NetVSC interface \"%s\""
574 " (index %u)", iface->if_name, iface->if_index);
576 /* Create interface context. */
577 ctx = calloc(1, sizeof(*ctx));
580 DRV_LOG(ERR, "cannot allocate context for interface \"%s\": %s",
581 iface->if_name, rte_strerror(errno));
584 ctx->id = vdev_netvsc_ctx_count;
585 strlcpy(ctx->if_name, iface->if_name, sizeof(ctx->if_name));
586 ctx->if_index = iface->if_index;
587 ctx->if_addr = *eth_addr;
590 ctx->yield[0] = '\0';
591 if (pipe(ctx->pipe) == -1) {
594 "cannot allocate control pipe for interface \"%s\": %s",
595 ctx->if_name, rte_strerror(errno));
598 for (i = 0; i != RTE_DIM(ctx->pipe); ++i) {
599 int flf = fcntl(ctx->pipe[i], F_GETFL);
602 fcntl(ctx->pipe[i], F_SETFL, flf | O_NONBLOCK) != -1)
605 DRV_LOG(ERR, "cannot toggle non-blocking flag on control file"
606 " descriptor #%u (%d): %s", i, ctx->pipe[i],
607 rte_strerror(errno));
610 /* Generate virtual device name and arguments. */
612 ret = snprintf(ctx->name, sizeof(ctx->name), "%s_id%u",
614 if (ret == -1 || (size_t)ret >= sizeof(ctx->name))
616 ret = snprintf(ctx->devname, sizeof(ctx->devname), "net_failsafe_vsc%u",
618 if (ret == -1 || (size_t)ret >= sizeof(ctx->devname))
620 ret = snprintf(ctx->devargs, sizeof(ctx->devargs),
621 "fd(%d),dev(net_tap_vsc%u,remote=%s)",
622 ctx->pipe[0], ctx->id, ctx->if_name);
623 if (ret == -1 || (size_t)ret >= sizeof(ctx->devargs))
627 DRV_LOG(ERR, "generated virtual device name or argument list"
628 " too long for interface \"%s\"", ctx->if_name);
631 /* Request virtual device generation. */
632 DRV_LOG(DEBUG, "generating virtual device \"%s\" with arguments \"%s\"",
633 ctx->devname, ctx->devargs);
634 vdev_netvsc_foreach_iface(vdev_netvsc_device_probe, 0, ctx);
635 ret = rte_eal_hotplug_add("vdev", ctx->devname, ctx->devargs);
638 LIST_INSERT_HEAD(&vdev_netvsc_ctx_list, ctx, entry);
639 ++vdev_netvsc_ctx_count;
640 DRV_LOG(DEBUG, "added NetVSC interface \"%s\" to context list",
645 vdev_netvsc_ctx_destroy(ctx);
650 * Probe NetVSC interfaces.
652 * This function probes system netdevices according to the specified device
653 * arguments and starts a periodic alarm callback to notify the resulting
654 * fail-safe PMD instances of their sub-devices whereabouts.
657 * Virtual device context for driver instance.
660 * Always 0, even in case of errors.
663 vdev_netvsc_vdev_probe(struct rte_vdev_device *dev)
665 static const char *const vdev_netvsc_arg[] = {
666 VDEV_NETVSC_ARG_IFACE,
668 VDEV_NETVSC_ARG_FORCE,
669 VDEV_NETVSC_ARG_IGNORE,
672 const char *name = rte_vdev_device_name(dev);
673 const char *args = rte_vdev_device_args(dev);
674 struct rte_kvargs *kvargs = rte_kvargs_parse(args ? args : "",
676 unsigned int specified = 0;
677 unsigned int matched = 0;
683 DRV_LOG(DEBUG, "invoked as \"%s\", using arguments \"%s\"", name, args);
685 DRV_LOG(ERR, "cannot parse arguments list");
688 for (i = 0; i != kvargs->count; ++i) {
689 const struct rte_kvargs_pair *pair = &kvargs->pairs[i];
691 if (!strcmp(pair->key, VDEV_NETVSC_ARG_FORCE))
692 force = !!atoi(pair->value);
693 else if (!strcmp(pair->key, VDEV_NETVSC_ARG_IGNORE))
694 ignore = !!atoi(pair->value);
695 else if (!strcmp(pair->key, VDEV_NETVSC_ARG_IFACE) ||
696 !strcmp(pair->key, VDEV_NETVSC_ARG_MAC))
701 rte_kvargs_free(kvargs);
705 DRV_LOG(ERR, "More than one way used to specify the netvsc"
709 rte_eal_alarm_cancel(vdev_netvsc_alarm, NULL);
710 /* Gather interfaces. */
711 ret = vdev_netvsc_foreach_iface(vdev_netvsc_netvsc_probe, 1, name,
712 kvargs, specified, &matched);
715 if (specified && matched < specified) {
717 DRV_LOG(ERR, "Cannot find the specified netvsc device");
720 /* Try to force probing on non-netvsc specified device. */
721 if (vdev_netvsc_foreach_iface(vdev_netvsc_netvsc_probe, 0, name,
722 kvargs, specified, &matched) < 0)
724 if (matched < specified) {
725 DRV_LOG(ERR, "Cannot find the specified device");
728 DRV_LOG(WARNING, "non-netvsc device was probed as netvsc");
730 ret = rte_eal_alarm_set(VDEV_NETVSC_PROBE_MS * 1000,
731 vdev_netvsc_alarm, NULL);
733 DRV_LOG(ERR, "unable to schedule alarm callback: %s",
739 rte_kvargs_free(kvargs);
740 ++vdev_netvsc_ctx_inst;
745 * Remove driver instance.
747 * The alarm callback and underlying vdev_netvsc context instances are only
748 * destroyed after the last PMD instance is removed.
751 * Virtual device context for driver instance.
757 vdev_netvsc_vdev_remove(__rte_unused struct rte_vdev_device *dev)
759 if (--vdev_netvsc_ctx_inst)
761 rte_eal_alarm_cancel(vdev_netvsc_alarm, NULL);
762 while (!LIST_EMPTY(&vdev_netvsc_ctx_list)) {
763 struct vdev_netvsc_ctx *ctx = LIST_FIRST(&vdev_netvsc_ctx_list);
765 LIST_REMOVE(ctx, entry);
766 --vdev_netvsc_ctx_count;
767 vdev_netvsc_ctx_destroy(ctx);
772 /** Virtual device descriptor. */
773 static struct rte_vdev_driver vdev_netvsc_vdev = {
774 .probe = vdev_netvsc_vdev_probe,
775 .remove = vdev_netvsc_vdev_remove,
778 RTE_PMD_REGISTER_VDEV(VDEV_NETVSC_DRIVER, vdev_netvsc_vdev);
779 RTE_PMD_REGISTER_ALIAS(VDEV_NETVSC_DRIVER, eth_vdev_netvsc);
780 RTE_PMD_REGISTER_PARAM_STRING(net_vdev_netvsc,
781 VDEV_NETVSC_ARG_IFACE "=<string> "
782 VDEV_NETVSC_ARG_MAC "=<string> "
783 VDEV_NETVSC_ARG_FORCE "=<int> "
784 VDEV_NETVSC_ARG_IGNORE "=<int>");
786 /** Initialize driver log type. */
787 RTE_INIT(vdev_netvsc_init_log)
789 vdev_netvsc_logtype = rte_log_register("pmd.net.vdev_netvsc");
790 if (vdev_netvsc_logtype >= 0)
791 rte_log_set_level(vdev_netvsc_logtype, RTE_LOG_NOTICE);
794 /** Compare function for vdev find device operation. */
796 vdev_netvsc_cmp_rte_device(const struct rte_device *dev1,
797 __rte_unused const void *_dev2)
799 return strncmp(dev1->devargs->name, VDEV_NETVSC_DRIVER_NAME,
800 VDEV_NETVSC_DRIVER_NAME_LEN);
804 * A callback called by vdev bus scan function to ensure this driver probing
805 * automatically in Hyper-V VM system unless it already exists in the
809 vdev_netvsc_scan_callback(__rte_unused void *arg)
811 struct rte_device *dev;
812 struct rte_devargs *devargs;
813 struct rte_bus *vbus = rte_bus_find_by_name("vdev");
815 RTE_EAL_DEVARGS_FOREACH("vdev", devargs)
816 if (!strncmp(devargs->name, VDEV_NETVSC_DRIVER_NAME,
817 VDEV_NETVSC_DRIVER_NAME_LEN))
820 dev = vbus->find_device(NULL, vdev_netvsc_cmp_rte_device,
821 VDEV_NETVSC_DRIVER_NAME);
824 if (rte_devargs_add(RTE_DEVTYPE_VIRTUAL, VDEV_NETVSC_DRIVER_NAME))
825 DRV_LOG(ERR, "unable to add netvsc devargs.");
828 /** Initialize the custom scan. */
829 RTE_INIT(vdev_netvsc_custom_scan_add)
831 if (rte_hypervisor_get() == RTE_HYPERVISOR_HYPERV)
832 rte_vdev_add_custom_scan(vdev_netvsc_scan_callback, NULL);