All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Menon, Ranjit" <ranjit.menon@intel.com>
To: Tal Shnaiderman <talshn@nvidia.com>,
	Narcisa Ana Maria Vasile <navasile@linux.microsoft.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	NBU-Contact-Thomas Monjalon <thomas@monjalon.net>,
	"pallavi.kadam@intel.com" <pallavi.kadam@intel.com>,
	"dmitry.kozliuk@gmail.com" <dmitry.kozliuk@gmail.com>,
	"harini.ramakrishnan@microsoft.com"
	<harini.ramakrishnan@microsoft.com>
Subject: Re: [dpdk-dev] [PATCH] bus/pci: support segment value as address domain on Windows
Date: Thu, 10 Sep 2020 10:21:50 -0700	[thread overview]
Message-ID: <0897c65e-a90c-e02e-e1f4-44a28993615f@intel.com> (raw)
In-Reply-To: <BY5PR12MB4323E9BFD579BD644F03B66CA4270@BY5PR12MB4323.namprd12.prod.outlook.com>


On 9/10/2020 12:30 AM, Tal Shnaiderman wrote:
>> Subject: Re: [PATCH] bus/pci: support segment value as address domain on
>> Windows
>>
>> On Tue, Aug 25, 2020 at 02:43:16PM +0300, Tal Shnaiderman wrote:
>>> Set the domain value for rte_pci_addr probing on Windows to the value
>>> of the PCI segment returned by SPDRP_BUSNUMBER.
>>>
>>> Signed-off-by: Tal Shnaiderman <talshn@nvidia.com>
>>> ---
>>>   drivers/bus/pci/windows/pci.c | 4 ++--
>>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/bus/pci/windows/pci.c
>>> b/drivers/bus/pci/windows/pci.c index 489aa7902a..a40acec609 100644
>>> --- a/drivers/bus/pci/windows/pci.c
>>> +++ b/drivers/bus/pci/windows/pci.c
>>> @@ -195,8 +195,8 @@ get_device_pci_address(HDEVINFO dev_info,
>>>   		return -1;
>>>   	}
>>>
>>> -	addr->domain = 0;
>>> -	addr->bus = bus_num;
>>> +	addr->domain = bus_num >> 8;
>>> +	addr->bus = bus_num & 0xff;
>>>   	addr->devid = dev_and_func >> 16;
>>>   	addr->function = dev_and_func & 0xffff;
>>>   	return 0;
>>> --
>> Is this needed to avoid collision of devices with the same B:D:F?
> Right, it can happen in virtualization setups when several virtual functions can have the same BDF, e.g.:
>
> PS  > Get-NetAdapterHardwareInfo
>
> Name                           Segment Bus Device Function Slot NumaNode PcieLinkSpeed
> ----                           ------- --- ------ -------- ---- -------- -------------
> Ethernet                                   0   0     10       0                      Unknown
> Ethernet 4                       58601   0      2        0             0       Unknown
> Ethernet 5                       52956   0      2        0             0       Unknown
>
> DPDK currently can detect either Ethernet 4 or ethernet 5 if only BDF is checked.
> Unix uses the Domain value, the equivalent value for Windows is Segment.

Thanks for the explanation, Tal.

I had always been curious how Windows stores the PCIe segment (domain) 
number.

On VMs hosted on Hyper-V, the VF segment numbers are always in the high 
16-bit values.

Is this documented somewhere, or did you find this by experimentation?


ranjit m.


  reply	other threads:[~2020-09-10 17:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-25 11:43 [dpdk-dev] [PATCH] bus/pci: support segment value as address domain on Windows Tal Shnaiderman
2020-09-09 23:21 ` Narcisa Ana Maria Vasile
2020-09-10  7:30   ` Tal Shnaiderman
2020-09-10 17:21     ` Menon, Ranjit [this message]
2020-09-13 14:50       ` Tal Shnaiderman
2020-09-10 17:57     ` Dmitry Kozlyuk
2020-09-13 14:54       ` Tal Shnaiderman
2020-09-16 18:32 ` Ranjit Menon
2020-10-14  9:01   ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0897c65e-a90c-e02e-e1f4-44a28993615f@intel.com \
    --to=ranjit.menon@intel.com \
    --cc=dev@dpdk.org \
    --cc=dmitry.kozliuk@gmail.com \
    --cc=harini.ramakrishnan@microsoft.com \
    --cc=navasile@linux.microsoft.com \
    --cc=pallavi.kadam@intel.com \
    --cc=talshn@nvidia.com \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.