[dpdk-dev] [PATCH] net/vdev_netvsc: fix automatic probing

Stephen Hemminger stephen at networkplumber.org
Mon May 21 18:52:14 CEST 2018


On Mon, 21 May 2018 16:23:30 +0000
Matan Azrad <matan at mellanox.com> wrote:

> 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: 56252de779a6 ("net/vdev_netvsc: add automatic probing")
> Cc: stable at dpdk.org
> 
> Signed-off-by: Matan Azrad <matan at mellanox.com>
> ---
>  drivers/net/vdev_netvsc/vdev_netvsc.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/vdev_netvsc/vdev_netvsc.c b/drivers/net/vdev_netvsc/vdev_netvsc.c
> index de2bd14..48717f2 100644
> --- a/drivers/net/vdev_netvsc/vdev_netvsc.c
> +++ b/drivers/net/vdev_netvsc/vdev_netvsc.c
> @@ -39,6 +39,7 @@
>  
>  #define VDEV_NETVSC_DRIVER net_vdev_netvsc
>  #define VDEV_NETVSC_DRIVER_NAME RTE_STR(VDEV_NETVSC_DRIVER)
> +#define VDEV_NETVSC_DRIVER_NAME_LEN 15

Looks correct, why did you not just use IFNAMSIZ which is commonly used
across much of the network code?


More information about the dev mailing list