[dpdk-dev] [PATCH] bus/pci: support segment value as address domain on Windows

Tal Shnaiderman talshn at nvidia.com
Thu Sep 10 09:30:39 CEST 2020


> 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 at 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.


More information about the dev mailing list