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 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 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 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) {
195 DRV_LOG(DEBUG, "interface %s is non-ethernet device",
199 memcpy(eth_addr.addr_bytes, req.ifr_hwaddr.sa_data,
200 RTE_DIM(eth_addr.addr_bytes));
201 va_start(ap, is_netvsc);
202 ret = func(&iface[i], ð_addr, ap);
211 if_freenameindex(iface);
216 * Determine if a network interface has a route.
219 * Network device name.
221 * Address family: AF_INET for IPv4 or AF_INET6 for IPv6.
224 * 1 when interface has a route, negative errno value in case of error and
228 vdev_netvsc_has_route(const struct if_nameindex *iface,
229 const unsigned char family)
232 * The implementation can be simpler by getifaddrs() function usage but
233 * it works for IPv6 only starting from glibc 2.3.3.
240 struct nlmsghdr *retmsg = (struct nlmsghdr *)buf;
241 struct sockaddr_nl sa;
243 struct nlmsghdr nlhdr;
244 struct ifaddrmsg addrmsg;
247 if (!iface || (family != AF_INET && family != AF_INET6)) {
248 DRV_LOG(ERR, "%s", rte_strerror(EINVAL));
251 sock = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
253 DRV_LOG(ERR, "cannot open socket: %s", rte_strerror(errno));
256 memset(&sa, 0, sizeof(sa));
257 sa.nl_family = AF_NETLINK;
258 sa.nl_groups = RTMGRP_LINK | RTMGRP_IPV4_IFADDR;
259 res = bind(sock, (struct sockaddr *)&sa, sizeof(sa));
262 DRV_LOG(ERR, "cannot bind socket: %s", rte_strerror(errno));
265 memset(&msg, 0, sizeof(msg));
266 msg.nlhdr.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifaddrmsg));
267 msg.nlhdr.nlmsg_flags = NLM_F_REQUEST | NLM_F_DUMP;
268 msg.nlhdr.nlmsg_type = RTM_GETADDR;
269 msg.nlhdr.nlmsg_pid = getpid();
270 msg.addrmsg.ifa_family = family;
271 msg.addrmsg.ifa_index = iface->if_index;
272 res = send(sock, &msg, msg.nlhdr.nlmsg_len, 0);
275 DRV_LOG(ERR, "cannot send socket message: %s",
276 rte_strerror(errno));
279 memset(buf, 0, sizeof(buf));
280 len = recv(sock, buf, sizeof(buf), 0);
283 DRV_LOG(ERR, "cannot receive socket message: %s",
284 rte_strerror(errno));
287 while (NLMSG_OK(retmsg, (unsigned int)len)) {
288 struct ifaddrmsg *retaddr =
289 (struct ifaddrmsg *)NLMSG_DATA(retmsg);
291 if (retaddr->ifa_family == family &&
292 retaddr->ifa_index == iface->if_index) {
293 struct rtattr *retrta = IFA_RTA(retaddr);
294 int attlen = IFA_PAYLOAD(retmsg);
296 while (RTA_OK(retrta, attlen)) {
297 if (retrta->rta_type == IFA_ADDRESS) {
299 DRV_LOG(DEBUG, "interface %s has IP",
303 retrta = RTA_NEXT(retrta, attlen);
306 retmsg = NLMSG_NEXT(retmsg, len);
314 * Retrieve network interface data from sysfs symbolic link.
317 * Output data buffer.
319 * Output buffer size.
323 * Symbolic link path relative to netdevice sysfs entry.
326 * 0 on success, a negative error code otherwise.
329 vdev_netvsc_sysfs_readlink(char *buf, size_t size, const char *if_name,
332 struct vdev_netvsc_ctx *ctx;
333 char in[RTE_MAX(sizeof(ctx->yield), 256u)];
336 ret = snprintf(in, sizeof(in) - 1, "/sys/class/net/%s/%s",
338 if (ret == -1 || (size_t)ret >= sizeof(in))
340 ret = readlink(in, buf, size);
343 if ((size_t)ret >= size - 1)
350 * Probe a network interface to associate with vdev_netvsc context.
352 * This function determines if the network device matches the properties of
353 * the NetVSC interface associated with the vdev_netvsc context and
354 * communicates its bus address to the fail-safe PMD instance if so.
356 * It is normally used with vdev_netvsc_foreach_iface().
359 * Pointer to netdevice description structure (name and index).
360 * @param[in] eth_addr
361 * MAC address associated with @p iface.
363 * Variable arguments list comprising:
365 * - struct vdev_netvsc_ctx *ctx:
366 * Context to associate network interface with.
369 * A nonzero value when interface matches, 0 otherwise or in case of
373 vdev_netvsc_device_probe(const struct if_nameindex *iface,
374 const struct ether_addr *eth_addr,
377 struct vdev_netvsc_ctx *ctx = va_arg(ap, struct vdev_netvsc_ctx *);
378 char buf[RTE_MAX(sizeof(ctx->yield), 256u)];
383 /* Skip non-matching or unwanted NetVSC interfaces. */
384 if (ctx->if_index == iface->if_index) {
385 if (!strcmp(ctx->if_name, iface->if_name))
388 "NetVSC interface \"%s\" (index %u) renamed \"%s\"",
389 ctx->if_name, ctx->if_index, iface->if_name);
390 strlcpy(ctx->if_name, iface->if_name, sizeof(ctx->if_name));
393 if (!is_same_ether_addr(eth_addr, &ctx->if_addr))
395 /* Look for associated PCI device. */
396 ret = vdev_netvsc_sysfs_readlink(buf, sizeof(buf), iface->if_name,
400 addr = strrchr(buf, '/');
401 addr = addr ? addr + 1 : buf;
402 if (strcmp(addr, "pci"))
404 ret = vdev_netvsc_sysfs_readlink(buf, sizeof(buf), iface->if_name,
408 addr = strrchr(buf, '/');
409 addr = addr ? addr + 1 : buf;
413 /* Send PCI device argument to fail-safe PMD instance. */
414 if (strcmp(addr, ctx->yield))
415 DRV_LOG(DEBUG, "associating PCI device \"%s\" with NetVSC"
416 " interface \"%s\" (index %u)", addr, ctx->if_name,
418 memmove(buf, addr, len + 1);
421 ret = write(ctx->pipe[1], addr, len + 1);
424 if (errno == EINTR || errno == EAGAIN)
426 DRV_LOG(WARNING, "cannot associate PCI device name \"%s\" with"
427 " interface \"%s\": %s", addr, ctx->if_name,
428 rte_strerror(errno));
431 if ((size_t)ret != len + 1) {
433 * Attempt to override previous partial write, no need to
434 * recover if that fails.
436 ret = write(ctx->pipe[1], "\n", 1);
441 memcpy(ctx->yield, addr, len + 1);
446 * Alarm callback that regularly probes system network interfaces.
448 * This callback runs at a frequency determined by VDEV_NETVSC_PROBE_MS as
449 * long as an vdev_netvsc context instance exists.
455 vdev_netvsc_alarm(__rte_unused void *arg)
457 struct vdev_netvsc_ctx *ctx;
460 LIST_FOREACH(ctx, &vdev_netvsc_ctx_list, entry) {
461 ret = vdev_netvsc_foreach_iface(vdev_netvsc_device_probe, 0,
466 if (!vdev_netvsc_ctx_count)
468 ret = rte_eal_alarm_set(VDEV_NETVSC_PROBE_MS * 1000,
469 vdev_netvsc_alarm, NULL);
471 DRV_LOG(ERR, "unable to reschedule alarm callback: %s",
477 * Probe a NetVSC interface to generate a vdev_netvsc context from.
479 * This function instantiates vdev_netvsc contexts either for all NetVSC
480 * devices found on the system or only a subset provided as device
483 * It is normally used with vdev_netvsc_foreach_iface().
486 * Pointer to netdevice description structure (name and index).
487 * @param[in] eth_addr
488 * MAC address associated with @p iface.
490 * Variable arguments list comprising:
492 * - const char *name:
493 * Name associated with current driver instance.
495 * - struct rte_kvargs *kvargs:
496 * Device arguments provided to current driver instance.
499 * Accept specified interface even if not detected as NetVSC.
501 * - unsigned int specified:
502 * Number of specific netdevices provided as device arguments.
504 * - unsigned int *matched:
505 * The number of specified netdevices matched by this function.
508 * A nonzero value when interface matches, 0 otherwise or in case of
512 vdev_netvsc_netvsc_probe(const struct if_nameindex *iface,
513 const struct ether_addr *eth_addr,
516 const char *name = va_arg(ap, const char *);
517 struct rte_kvargs *kvargs = va_arg(ap, struct rte_kvargs *);
518 unsigned int specified = va_arg(ap, unsigned int);
519 unsigned int *matched = va_arg(ap, unsigned int *);
521 struct vdev_netvsc_ctx *ctx;
524 /* Probe all interfaces when none are specified. */
526 for (i = 0; i != kvargs->count; ++i) {
527 const struct rte_kvargs_pair *pair = &kvargs->pairs[i];
529 if (!strcmp(pair->key, VDEV_NETVSC_ARG_IFACE)) {
530 if (!strcmp(pair->value, iface->if_name))
532 } else if (!strcmp(pair->key, VDEV_NETVSC_ARG_MAC)) {
533 struct ether_addr tmp;
535 if (sscanf(pair->value,
536 "%" SCNx8 ":%" SCNx8 ":%" SCNx8 ":"
537 "%" SCNx8 ":%" SCNx8 ":%" SCNx8,
543 &tmp.addr_bytes[5]) != 6) {
545 "invalid MAC address format"
550 if (is_same_ether_addr(eth_addr, &tmp))
554 if (i == kvargs->count)
558 /* Weed out interfaces already handled. */
559 LIST_FOREACH(ctx, &vdev_netvsc_ctx_list, entry)
560 if (ctx->if_index == iface->if_index)
566 "interface \"%s\" (index %u) is already handled,"
568 iface->if_name, iface->if_index);
571 /* Routed NetVSC should not be probed. */
572 if (vdev_netvsc_has_route(iface, AF_INET) ||
573 vdev_netvsc_has_route(iface, AF_INET6)) {
576 DRV_LOG(WARNING, "probably using routed NetVSC interface \"%s\""
577 " (index %u)", iface->if_name, iface->if_index);
579 /* Create interface context. */
580 ctx = calloc(1, sizeof(*ctx));
583 DRV_LOG(ERR, "cannot allocate context for interface \"%s\": %s",
584 iface->if_name, rte_strerror(errno));
587 ctx->id = vdev_netvsc_ctx_count;
588 strlcpy(ctx->if_name, iface->if_name, sizeof(ctx->if_name));
589 ctx->if_index = iface->if_index;
590 ctx->if_addr = *eth_addr;
593 ctx->yield[0] = '\0';
594 if (pipe(ctx->pipe) == -1) {
597 "cannot allocate control pipe for interface \"%s\": %s",
598 ctx->if_name, rte_strerror(errno));
601 for (i = 0; i != RTE_DIM(ctx->pipe); ++i) {
602 int flf = fcntl(ctx->pipe[i], F_GETFL);
605 fcntl(ctx->pipe[i], F_SETFL, flf | O_NONBLOCK) != -1)
608 DRV_LOG(ERR, "cannot toggle non-blocking flag on control file"
609 " descriptor #%u (%d): %s", i, ctx->pipe[i],
610 rte_strerror(errno));
613 /* Generate virtual device name and arguments. */
615 ret = snprintf(ctx->name, sizeof(ctx->name), "%s_id%u",
617 if (ret == -1 || (size_t)ret >= sizeof(ctx->name))
619 ret = snprintf(ctx->devname, sizeof(ctx->devname), "net_failsafe_vsc%u",
621 if (ret == -1 || (size_t)ret >= sizeof(ctx->devname))
623 ret = snprintf(ctx->devargs, sizeof(ctx->devargs),
624 "fd(%d),dev(net_tap_vsc%u,remote=%s)",
625 ctx->pipe[0], ctx->id, ctx->if_name);
626 if (ret == -1 || (size_t)ret >= sizeof(ctx->devargs))
630 DRV_LOG(ERR, "generated virtual device name or argument list"
631 " too long for interface \"%s\"", ctx->if_name);
634 /* Request virtual device generation. */
635 DRV_LOG(DEBUG, "generating virtual device \"%s\" with arguments \"%s\"",
636 ctx->devname, ctx->devargs);
637 vdev_netvsc_foreach_iface(vdev_netvsc_device_probe, 0, ctx);
638 ret = rte_eal_hotplug_add("vdev", ctx->devname, ctx->devargs);
641 LIST_INSERT_HEAD(&vdev_netvsc_ctx_list, ctx, entry);
642 ++vdev_netvsc_ctx_count;
643 DRV_LOG(DEBUG, "added NetVSC interface \"%s\" to context list",
648 vdev_netvsc_ctx_destroy(ctx);
653 * Probe NetVSC interfaces.
655 * This function probes system netdevices according to the specified device
656 * arguments and starts a periodic alarm callback to notify the resulting
657 * fail-safe PMD instances of their sub-devices whereabouts.
660 * Virtual device context for driver instance.
663 * Always 0, even in case of errors.
666 vdev_netvsc_vdev_probe(struct rte_vdev_device *dev)
668 static const char *const vdev_netvsc_arg[] = {
669 VDEV_NETVSC_ARG_IFACE,
671 VDEV_NETVSC_ARG_FORCE,
672 VDEV_NETVSC_ARG_IGNORE,
675 const char *name = rte_vdev_device_name(dev);
676 const char *args = rte_vdev_device_args(dev);
677 struct rte_kvargs *kvargs = rte_kvargs_parse(args ? args : "",
679 unsigned int specified = 0;
680 unsigned int matched = 0;
686 DRV_LOG(DEBUG, "invoked as \"%s\", using arguments \"%s\"", name, args);
688 DRV_LOG(ERR, "cannot parse arguments list");
691 for (i = 0; i != kvargs->count; ++i) {
692 const struct rte_kvargs_pair *pair = &kvargs->pairs[i];
694 if (!strcmp(pair->key, VDEV_NETVSC_ARG_FORCE))
695 force = !!atoi(pair->value);
696 else if (!strcmp(pair->key, VDEV_NETVSC_ARG_IGNORE))
697 ignore = !!atoi(pair->value);
698 else if (!strcmp(pair->key, VDEV_NETVSC_ARG_IFACE) ||
699 !strcmp(pair->key, VDEV_NETVSC_ARG_MAC))
704 rte_kvargs_free(kvargs);
708 DRV_LOG(ERR, "More than one way used to specify the netvsc"
712 rte_eal_alarm_cancel(vdev_netvsc_alarm, NULL);
713 /* Gather interfaces. */
714 ret = vdev_netvsc_foreach_iface(vdev_netvsc_netvsc_probe, 1, name,
715 kvargs, specified, &matched);
718 if (specified && matched < specified) {
720 DRV_LOG(ERR, "Cannot find the specified netvsc device");
723 /* Try to force probing on non-netvsc specified device. */
724 if (vdev_netvsc_foreach_iface(vdev_netvsc_netvsc_probe, 0, name,
725 kvargs, specified, &matched) < 0)
727 if (matched < specified) {
728 DRV_LOG(ERR, "Cannot find the specified device");
731 DRV_LOG(WARNING, "non-netvsc device was probed as netvsc");
733 ret = rte_eal_alarm_set(VDEV_NETVSC_PROBE_MS * 1000,
734 vdev_netvsc_alarm, NULL);
736 DRV_LOG(ERR, "unable to schedule alarm callback: %s",
742 rte_kvargs_free(kvargs);
743 ++vdev_netvsc_ctx_inst;
748 * Remove driver instance.
750 * The alarm callback and underlying vdev_netvsc context instances are only
751 * destroyed after the last PMD instance is removed.
754 * Virtual device context for driver instance.
760 vdev_netvsc_vdev_remove(__rte_unused struct rte_vdev_device *dev)
762 if (--vdev_netvsc_ctx_inst)
764 rte_eal_alarm_cancel(vdev_netvsc_alarm, NULL);
765 while (!LIST_EMPTY(&vdev_netvsc_ctx_list)) {
766 struct vdev_netvsc_ctx *ctx = LIST_FIRST(&vdev_netvsc_ctx_list);
768 LIST_REMOVE(ctx, entry);
769 --vdev_netvsc_ctx_count;
770 vdev_netvsc_ctx_destroy(ctx);
775 /** Virtual device descriptor. */
776 static struct rte_vdev_driver vdev_netvsc_vdev = {
777 .probe = vdev_netvsc_vdev_probe,
778 .remove = vdev_netvsc_vdev_remove,
781 RTE_PMD_REGISTER_VDEV(VDEV_NETVSC_DRIVER, vdev_netvsc_vdev);
782 RTE_PMD_REGISTER_ALIAS(VDEV_NETVSC_DRIVER, eth_vdev_netvsc);
783 RTE_PMD_REGISTER_PARAM_STRING(net_vdev_netvsc,
784 VDEV_NETVSC_ARG_IFACE "=<string> "
785 VDEV_NETVSC_ARG_MAC "=<string> "
786 VDEV_NETVSC_ARG_FORCE "=<int> "
787 VDEV_NETVSC_ARG_IGNORE "=<int>");
789 /** Initialize driver log type. */
790 RTE_INIT(vdev_netvsc_init_log)
792 vdev_netvsc_logtype = rte_log_register("pmd.vdev_netvsc");
793 if (vdev_netvsc_logtype >= 0)
794 rte_log_set_level(vdev_netvsc_logtype, RTE_LOG_NOTICE);
797 /** Compare function for vdev find device operation. */
799 vdev_netvsc_cmp_rte_device(const struct rte_device *dev1,
800 __rte_unused const void *_dev2)
802 return strncmp(dev1->devargs->name, VDEV_NETVSC_DRIVER_NAME,
803 VDEV_NETVSC_DRIVER_NAME_LEN);
807 * A callback called by vdev bus scan function to ensure this driver probing
808 * automatically in Hyper-V VM system unless it already exists in the
812 vdev_netvsc_scan_callback(__rte_unused void *arg)
814 struct rte_vdev_device *dev;
815 struct rte_devargs *devargs;
816 struct rte_bus *vbus = rte_bus_find_by_name("vdev");
818 RTE_EAL_DEVARGS_FOREACH("vdev", devargs)
819 if (!strncmp(devargs->name, VDEV_NETVSC_DRIVER_NAME,
820 VDEV_NETVSC_DRIVER_NAME_LEN))
822 dev = (struct rte_vdev_device *)vbus->find_device(NULL,
823 vdev_netvsc_cmp_rte_device, VDEV_NETVSC_DRIVER_NAME);
826 if (rte_devargs_add(RTE_DEVTYPE_VIRTUAL, VDEV_NETVSC_DRIVER_NAME))
827 DRV_LOG(ERR, "unable to add netvsc devargs.");
830 /** Initialize the custom scan. */
831 RTE_INIT(vdev_netvsc_custom_scan_add)
833 if (rte_hypervisor_get() == RTE_HYPERVISOR_HYPERV)
834 rte_vdev_add_custom_scan(vdev_netvsc_scan_callback, NULL);