[dpdk-dev] [PATCH v1 59/72] net/mlx5/windows: support VF PCI address
Narcisa Ana Maria Vasile
navasile at linux.microsoft.com
Wed Nov 11 01:04:32 CET 2020
On Tue, Oct 27, 2020 at 11:23:22PM +0000, Ophir Munk wrote:
> From: Tal Shnaiderman <talshn at nvidia.com>
>
> Support VF BDF scanning by checking both the BDF and raw BDF provided by
> DevX. In Linux a PCI address is formatted as: domain, bus, device,
> function (DBDF). This is right for both a PF and a VF. In Windows a PF
> also has a DBDF format, but the domain is always 0, while a VF has a
> special "domain" called "Virtual PCI Bus, Serial" (for example: "Virtual
> PCI Bus Slot 2 Serial 2") or segment. The full VF format under Windows
> is called raw DBF. Windows special domain must be considered and DevX
> must be called to support it.
>
> Signed-off-by: Tal Shnaiderman <talshn at nvidia.com>
> ---
> drivers/net/mlx5/windows/mlx5_os.c | 67 ++++++++++++++++++++++++++++++++++++--
> 1 file changed, 64 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/mlx5/windows/mlx5_os.c b/drivers/net/mlx5/windows/mlx5_os.c
> index f9b469f..4374b05 100644
> --- a/drivers/net/mlx5/windows/mlx5_os.c
> +++ b/drivers/net/mlx5/windows/mlx5_os.c
> @@ -901,6 +901,68 @@ mlx5_os_set_allmulti(struct rte_eth_dev *dev, int enable)
> }
> + * @return
> + * 1 on Device match, 0 on mismatch, rte_errno code on failure.
> + */
> +static int
> +mlx5_match_devx_devices_to_addr(struct devx_device_bdf *devx_bdf,
> + struct rte_pci_addr *addr)
> +{
> + err = mlx5_glue->query_device(devx_bdf, &mlx5_dev);
> + if (err) {
> + DRV_LOG(ERR, "query_device failed");
> + rte_errno = err;
> + return 0;
Return rte_errno.
> + }
> + if (mlx5_match_devx_bdf_to_addr(&mlx5_dev.raw_bdf, addr))
> + return 1;
> + return 0;
> +}
> +
> --
> 2.8.4
More information about the dev
mailing list