[dpdk-dev] [RFC v1 1/1] vfio: set vf token and gain vf device access

Varghese, Vipin vipin.varghese at intel.com
Wed Apr 1 05:14:41 CEST 2020


Snipped
> diff --git a/lib/librte_eal/linux/eal/eal_vfio.c
> b/lib/librte_eal/linux/eal/eal_vfio.c
> index 01b5ef3..e2fdd35 100644
> --- a/lib/librte_eal/linux/eal/eal_vfio.c
> +++ b/lib/librte_eal/linux/eal/eal_vfio.c

DPDK supports freebsd where `/dev/pci` can be probed like Linux `/sys/bus/pci`. Will you be adding the functions in `lib/librte_eal/freebsd/eal/` folder or implement as `NOT supported`?

What about window ` lib/librte_eal/windows/eal/`?

snipped
> +	snprintf(linkname, sizeof(linkname),
> +			 "%s/%s/physfn", sysfs_base, dev_addr);

Would you like to check the pointer sysfs_base or dev_addr?

>  int
>  rte_vfio_setup_device(const char *sysfs_base, const char *dev_addr,
>  		int *vfio_dev_fd, struct vfio_device_info *device_info) @@ -

Snipped

> +		ret = is_vf_token_required(sysfs_base, dev_addr);

The return value from the above function is 0 or -1. 

> +		/* if negative, something failed */
> +		if (ret < 0)
> +			return -1;
> +
> +		if (ret == 0) {

Will it be ok to skip this check?

> +			/* vf_token required to open device file descriptor */
> +			rte_uuid_unparse(uuid_token,
> +					 vf_token, sizeof(vf_token));
> +			snprintf(dev, sizeof(dev),
> +				 "%s vf_token=%s", dev_addr, vf_token);
> +		}

snipped

general comment `can we use EAL LOG for info, warn, error`?


More information about the dev mailing list