DPDK patches and discussions
 help / color / mirror / Atom feed
From: Matan Azrad <matan@mellanox.com>
To: Stephen Hemminger <stephen@networkplumber.org>,
	"dev@dpdk.org" <dev@dpdk.org>,
	"vpp-dev@lists.fd.io" <vpp-dev@lists.fd.io>
Subject: Re: [dpdk-dev] [RFC] net/vdev_netvsc: check for required related drivers
Date: Thu, 14 Mar 2019 11:26:05 +0000	[thread overview]
Message-ID: <AM0PR0502MB4019853953C16E6027B87818D24B0@AM0PR0502MB4019.eurprd05.prod.outlook.com> (raw)
Message-ID: <20190314112605.fEm_kueNv61lH04nYu5Ocs8JeckUipZvVxiTIr2BOEg@z> (raw)
In-Reply-To: <20190313151858.2175-1-stephen@networkplumber.org>

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 <stephen@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


  reply	other threads:[~2019-03-14 11:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-13 15:18 Stephen Hemminger
2019-03-14 11:26 ` Matan Azrad [this message]
2019-03-14 11:26   ` Matan Azrad
2019-03-14 15:52   ` Stephen Hemminger
2019-03-14 15:52     ` Stephen Hemminger
2019-03-17  6:53     ` Matan Azrad
2019-03-17  6:53       ` Matan Azrad
2019-03-18 15:05       ` Stephen Hemminger
2019-03-18 15:05         ` Stephen Hemminger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AM0PR0502MB4019853953C16E6027B87818D24B0@AM0PR0502MB4019.eurprd05.prod.outlook.com \
    --to=matan@mellanox.com \
    --cc=dev@dpdk.org \
    --cc=stephen@networkplumber.org \
    --cc=vpp-dev@lists.fd.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).