From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id C943DA04E7; Wed, 11 Nov 2020 01:04:37 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2EB5F2B93; Wed, 11 Nov 2020 01:04:36 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by dpdk.org (Postfix) with ESMTP id 1410AF90 for ; Wed, 11 Nov 2020 01:04:34 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1059) id 5727220C27FA; Tue, 10 Nov 2020 16:04:32 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 5727220C27FA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1605053072; bh=bslNvdr2ILMiWAbLx5C8GS2dhWqQBm5ETmeDDNaQTZw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=nA/01w5b4lr3ZRFRuS2/KJEJGe+a92nfCVzVhKtAeRIyDE5z435GE7bpIhXPWQIRB xKTqqtta6YSJ7KX28XY7lYcWDFeqDxVaKQ1Rdu0nnaxYz+js0oAKZ9jprktk9VJL2i cwWYOGZ4GTPVS+4Jx7GVCvCHamMmH5s1tShMC8Fo= Date: Tue, 10 Nov 2020 16:04:32 -0800 From: Narcisa Ana Maria Vasile To: Ophir Munk Cc: dev@dpdk.org, Raslan Darawsheh , Matan Azrad , Tal Shnaiderman , Thomas Monjalon Message-ID: <20201111000432.GC9449@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <20201027232335.31427-1-ophirmu@nvidia.com> <20201027232335.31427-60-ophirmu@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201027232335.31427-60-ophirmu@nvidia.com> User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [dpdk-dev] [PATCH v1 59/72] net/mlx5/windows: support VF PCI address X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Tue, Oct 27, 2020 at 11:23:22PM +0000, Ophir Munk wrote: > From: Tal Shnaiderman > > 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 > --- > 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