[dpdk-dev] [PATCH] bus/pci: clear undefined bits in Windows segment parsing

Ranjit Menon ranjit.menon at intel.com
Wed Oct 14 22:44:45 CEST 2020


On 10/14/2020 12:30 PM, Tal Shnaiderman wrote:
> When reading bus and segment values using SPDRP_BUSNUMBER
> bits 24-31 are undefined.
>
> They are cleared to verify we read the segment number correctly.
>
> Fixes: c3adf8144a1 ("bus/pci: support segment value as address domain on Window")
> Cc: stable at dpdk.org
>
> Signed-off-by: Tal Shnaiderman <talshn at nvidia.com>
> ---
>   drivers/bus/pci/windows/pci.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/bus/pci/windows/pci.c b/drivers/bus/pci/windows/pci.c
> index 2cd010a09b..2b0a7a7c86 100644
> --- a/drivers/bus/pci/windows/pci.c
> +++ b/drivers/bus/pci/windows/pci.c
> @@ -195,7 +195,7 @@ get_device_pci_address(HDEVINFO dev_info,
>   		return -1;
>   	}
>   
> -	addr->domain = bus_num >> 8;
> +	addr->domain = (bus_num >> 8) & 0xffff;
>   	addr->bus = bus_num & 0xff;
>   	addr->devid = dev_and_func >> 16;
>   	addr->function = dev_and_func & 0xffff;

Acked-by: Ranjit Menon <ranjit.menon at intel.com>



More information about the dev mailing list