From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-f171.google.com (mail-pg1-f171.google.com [209.85.215.171]) by dpdk.org (Postfix) with ESMTP id 92966239 for ; Wed, 13 Mar 2019 16:19:03 +0100 (CET) Received: by mail-pg1-f171.google.com with SMTP id u9so1746853pgo.7 for ; Wed, 13 Mar 2019 08:19:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=79ASHhtowW6RpqVT0qdxBZiZqnKpSFBdYVwsbs2tOxE=; b=ecn2TA6N4/SyCAzvRbpxiO7zYoSQVCY93dUTm58qLhowWEflGdqFnaTKyaEsLL7SKi mm18oKqZtzf2TDjeO2WgvvF2wXfdQ+xVRCmdXAkqFFstP0SzcO23xm/F6Xb85S+faPpG 4VvPWvJbMk4OWH/S+3fzhoXHvL5zgXjC1rjMdahHHowio1yMPTi+qwkoBYVGi0fwvaqL hEBHMuXQ3XiDIhk8ZdjjuL0JbFQX4Ld8W777kDWgDSY3Pn5JkMxbOX8O4NKlJAYDgmzs 9i63nzMGi0WUlFIYrjCsosq7c6/6j+ytmeXtfATBEOgK10mi89umL9MQPZYs3ahxt0Cy 5blA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=79ASHhtowW6RpqVT0qdxBZiZqnKpSFBdYVwsbs2tOxE=; b=s8pNbgZTzslpMBgOnYcXzVlsBMMhQ+R9qO648Xw6b41D44s1/hbTrAg8/ITv7OVE/V bRi0iN8crxSNugJTwBslaqSetA81sGQE+6mpikYJwqBO54M10Sqr7yqhTSDVzcbHLUD6 4OxwYPird5vagTq1fXQ5aE2OpijzzyPip4kgT1N+yIV1R4yJwu6Us/HE8P8YW1WFlIYi B/MItLuEtaMEHUEdvaD/9uLgmS8lK4+jc6+gJzbvohMugRdUqWDqC8Yf42TitznOrT4j lL9m1PFaNB5q1mvJxIyMAqriXdim9eWSRqApdnP/3xlinH19u+3pySXXtexEzRVEOPxw zUBA== X-Gm-Message-State: APjAAAV3Uxr6G255reLYAnPUvp2L0hOXVpHt9wTrSmeRbuabvslM4sW1 HaY7x8QAqF02XBSQ8WA07/zuo6utXOMIdQ== X-Google-Smtp-Source: APXvYqwW2L65cywn8evFHjn4EgfdeOUC2GmLm67Ziproya1cldmpYjhGwNN9eccA1c2527wcEIvfPQ== X-Received: by 2002:a65:510c:: with SMTP id f12mr41326666pgq.40.1552490341595; Wed, 13 Mar 2019 08:19:01 -0700 (PDT) Received: from shemminger-XPS-13-9360.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id a20sm27353019pfj.5.2019.03.13.08.19.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Mar 2019 08:19:00 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org, vpp-dev@lists.fd.io Cc: Stephen Hemminger Date: Wed, 13 Mar 2019 08:18:58 -0700 Message-Id: <20190313151858.2175-1-stephen@networkplumber.org> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [RFC] net/vdev_netvsc: check for required related drivers X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Mar 2019 15:19:04 -0000 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. Signed-off-by: Stephen Hemminger --- 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