Hi

From: Stephen Hemminger
> The vdev_netvsc virtual driver that is used to do initialization on Hyper-
> V/Azure won't work without failsafe and tap device.
> If the related devices aren't present, it causes confusing errors later in
> initialization when it crafts devargs and attempts to send them to a device
> driver that isn't there.
> 
> Unfortunately, this is common with VPP where the TAP and FAILSAFE PMD's
> are both optional.  The suggestion here is to detect this in the startup phase
> earlier.
> 
> Alternative would be to use RTE_BUILD_BUG_ON(!defined(...)) but that
> would break people doing normal VPP build.
> 

The failsafe and tap devices are created by the vdev_netvsc PMD, so it is not 
expected to find them in the scan time.
If the VM doesn't want vdev_netvsc driver to run, it have 2 options:
1. assign IP to the netvsc netdevs. 
2. run --vdev="vdev_netvsc0,ignore=1" - see documentation for more info.

> Signed-off-by: Stephen Hemminger <step...@networkplumber.org>
> ---
>  drivers/net/vdev_netvsc/vdev_netvsc.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/drivers/net/vdev_netvsc/vdev_netvsc.c
> b/drivers/net/vdev_netvsc/vdev_netvsc.c
> index 801f54c96e01..9c262358b5ee 100644
> --- a/drivers/net/vdev_netvsc/vdev_netvsc.c
> +++ b/drivers/net/vdev_netvsc/vdev_netvsc.c
> @@ -812,6 +812,20 @@ vdev_netvsc_scan_callback(__rte_unused void
> *arg)
>       struct rte_devargs *devargs;
>       struct rte_bus *vbus = rte_bus_find_by_name("vdev");
> 
> +     dev = vbus->find_device(NULL, vdev_netvsc_cmp_rte_device,
> +                             "net_failsafe");
> +     if (!dev) {
> +             DRV_LOG(ERR, "failsafe network device not present");
> +             return;
> +     }
> +
> +     dev = vbus->find_device(NULL, vdev_netvsc_cmp_rte_device,
> +                             "net_tap");
> +     if (!dev) {
> +             DRV_LOG(ERR, "tap network device driver not present");
> +             return;
> +     }
> +
>       RTE_EAL_DEVARGS_FOREACH("vdev", devargs)
>               if (!strncmp(devargs->name, VDEV_NETVSC_DRIVER_NAME,
>                            VDEV_NETVSC_DRIVER_NAME_LEN))
> --
> 2.17.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#12534): https://lists.fd.io/g/vpp-dev/message/12534
Mute This Topic: https://lists.fd.io/mt/30427409/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to