Define variables for "is_linux", "is_freebsd" and "is_windows"
to make the code shorter for comparisons and more readable.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Acked-by: Luca Boccassi <bluca@debian.org>
The return value from bus->find_device is a rte_device
which is not safe to cast to a rte_vdev_device structure.
It doesn't really matter since only being checked for NULL
but static checkers might find a bug here.
Fixes: 56252de779 ("net/vdev_netvsc: add automatic probing")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Matan Azrad <matan@mellanox.com>
If vdev_netvsc is run with debug logging enabled, then the
log output will fill with:
net_vdev_netvsc: interface lo is non-ethernet device
Remove the message since it is not useful.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Matan Azrad <matan@mellanox.com>
Disabled vdev_netvsc build in FreeBSD because it is not supported.
Added changes to enable vdev_netvsc build if it is Linux OS and
disable in FreeBSD.
Fixes: 9fc43dbfd6 ("net/vdev_netvsc: add in meson build")
Signed-off-by: Agalya Babu RadhaKrishnan <agalyax.babu.radhakrishnan@intel.com>
Acked-by: Stephen Hemminger <sthemmin@microsoft.com>
The vdev_netvsc driver allows an automatic probe in Hyper-V VM systems
unless it was already specified by the EAL command line.
The detection of a specified NetVSC device is wrongly done by comparing
the vdev_netvsc driver name to all the vdev devices names, including
the suffix device index. Thus, if the user specifies the vdev_netvsc
device by adding an index to the device name, the comparison fails.
Consequently, the vdev_netvsc driver may automatically probe NetVSC
devices, despite the NetVSC device that was specified by the EAL command
line.
Compare the vdev_netvsc driver name to the devices names without the
index.
Fixes: 56252de779 ("net/vdev_netvsc: add automatic probing")
Cc: stable@dpdk.org
Signed-off-by: Matan Azrad <matan@mellanox.com>
Continue snprintf to strlcpy conversions started by commit
c022cb400e ("convert snprintf to strlcpy").
Cc: stable@dpdk.org
Signed-off-by: Andy Green <andy@warmcat.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
drivers/net/vdev_netvsc/vdev_netvsc.c:335:2:error:
passing argument 2 to restrict-qualified parameter aliases with argument 1
ret = readlink(buf, buf, size);
^~~
Fixes: e7dc5d7bec ("net/vdev_netvsc: implement core functionality")
Cc: stable@dpdk.org
Signed-off-by: Andy Green <andy@warmcat.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
There is an option to run a non-netvsc device as a netvsc device only
when the "force" parameter is set to 1 in the EAL command line.
Consequently, more than one device may be found to be matching the
"mac" parameter specifying the device.
Prefer netvsc devices to be scanned before any non-netvsc device, even
when the "force" parameter is set.
Cc: stable@dpdk.org
Signed-off-by: Matan Azrad <matan@mellanox.com>
There are now 2 ways to specify a netvsc device by the EAL command
line - either by the interface name or by the MAC address.
The user should not specify a netvsc device using more than 1 way,
Thus, if a device is specified in more than 1 way, the driver stops
to probe it.
Validate it in the driver initialization.
Cc: stable@dpdk.org
Signed-off-by: Matan Azrad <matan@mellanox.com>
If the netvsc driver starts in blacklist mode, it does not
automatically probe IP associated netvsc devices. Therefore, the only
way to probe them is to specify them by the EAL command line, using the
"force" parameter to skip the IP check in the driver.
>From now on, the user does not need to add the "force" parameter if he
specifies an IP associated netvsc device by the EAL command line, and the
responsibility of the IP check is now in the user's hands.
However, in the absence of any specification, the driver still skips IP
associated netvsc devices.
Cc: stable@dpdk.org
Signed-off-by: Matan Azrad <matan@mellanox.com>
Prior to this commit the vdev_netvsc PMD was creating tap and failsafe
devices with long names, such as "net_tap_net_vdev_netvsc0" or
"net_failsafe_net_vdev_netvsc0".
This commits creates tap and failsafe devices with short names such as
"net_tap_netvsc0" or "net_failsafe_netvsc0".
Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
The previous symbols were deprecated for two releases.
They are now marked as such and cannot be used anymore.
They are replaced by ones respecting the new namespace that are marked
experimental.
As a result, eth_dev attach and detach are slightly reworked to follow
the changes.
Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
This list should not be used by drivers.
Use the public API instead.
Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Aligning Mellanox SPDX copyrights to a single format.
In addition replace to SPDX licence files which were missed.
Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
NetVSC netdevices which are already routed should not be probed because
they are used for management purposes by the HyperV.
The corrupted code got the routed devices from the system file
/proc/net/route and wrongly parsed only the odd lines, so devices which
their routes were in even lines, were considered as unrouted devices
and were probed.
Use linux netlink lib to detect the routed NetVSC devices instead of
file parsing.
Fixes: 31182fadfb ("net/vdev_netvsc: skip routed netvsc probing")
Cc: stable@dpdk.org
Suggested-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Matan Azrad <matan@mellanox.com>
The vdev_netvsc driver does periodic detection of PCI devices matched
to the netvsc existed interfaces.
When it finds a match, the PCI address is written to the pipe of the
associated fail-safe PMD instance and a positive value is returned to
the periodic check which is wrongly considered as error.
Change the check to consider only a negative value as error.
Fixes: e7dc5d7bec ("net/vdev_netvsc: implement core functionality")
Signed-off-by: Matan Azrad <matan@mellanox.com>
Add checks during build to ensure that all symbols in the EXPERIMENTAL
version map section have __experimental tags on their definitions, and
enable the warnings needed to announce their use. Also add an
ALLOW_EXPERIMENTAL_APIS define to allow individual libraries and files
to declare the acceptability of experimental api usage
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Remove CFLAGS -std=c11 and -pedantic in order to guarantee
a successful vdev_netvsc compilation on old Linux distributions.
Otherwise old GCC compilers may complain as follows:
cc1: error: unrecognized command line option -std=c11
Fixes: 6086ab3bb3 ("net/vdev_netvsc: introduce Hyper-V platform driver")
Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
Using DPDK in Hyper-V VM systems requires vdev_netvsc driver to pair
the NetVSC netdev device with the same MAC address PCI device by
fail-safe PMD.
Add vdev_netvsc custom scan in vdev bus to allow automatic probing in
Hyper-V VM systems unless it was already specified by command line.
Add "ignore" parameter to disable this auto-detection.
Signed-off-by: Matan Azrad <matan@mellanox.com>
This parameter allows specifying any non-NetVSC interface or routed
NetVSC interfaces to use with tap sub-devices for development purposes.
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Signed-off-by: Matan Azrad <matan@mellanox.com>
NetVSC netdevices which are already routed should not be probed because
they are used for management purposes by the HyperV.
prevent routed netvsc devices probing.
Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
Signed-off-by: Matan Azrad <matan@mellanox.com>
As described in more details in the attached documentation (see patch
contents), this virtual device driver manages NetVSC interfaces in virtual
machines hosted by Hyper-V/Azure platforms.
This driver does not manage traffic nor Ethernet devices directly; it acts
as a thin configuration layer that automatically instantiates and controls
fail-safe PMD instances combining tap and PCI sub-devices, so that each
NetVSC interface is exposed as a single consolidated port to DPDK
applications.
PCI sub-devices being hot-pluggable (e.g. during VM migration),
applications automatically benefit from increased throughput when present
and automatic fallback on NetVSC otherwise without interruption thanks to
fail-safe's hot-plug handling.
Once initialized, the sole job of the vdev_netvsc driver is to regularly
scan for PCI devices to associate with NetVSC interfaces and feed their
addresses to corresponding fail-safe instances.
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Signed-off-by: Matan Azrad <matan@mellanox.com>
This patch lays the groundwork for this driver (draft documentation,
copyright notices, code base skeleton and build system hooks). While it can
be successfully compiled and invoked, it's an empty shell at this stage.
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Signed-off-by: Matan Azrad <matan@mellanox.com>