From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id B81BFA04DB;
	Wed, 14 Oct 2020 21:30:31 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id EF5E41DA4C;
	Wed, 14 Oct 2020 21:30:29 +0200 (CEST)
Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])
 by dpdk.org (Postfix) with ESMTP id 617E41DA44
 for <dev@dpdk.org>; Wed, 14 Oct 2020 21:30:28 +0200 (CEST)
Received: from Internal Mail-Server by MTLPINE1 (envelope-from
 talshn@nvidia.com) with SMTP; 14 Oct 2020 22:30:24 +0300
Received: from nvidia.com (l-wincomp04-vm.mtl.labs.mlnx [10.237.1.5])
 by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 09EJUOqn003532;
 Wed, 14 Oct 2020 22:30:24 +0300
From: Tal Shnaiderman <talshn@nvidia.com>
To: dev@dpdk.org
Cc: thomas@monjalon.net, pallavi.kadam@intel.com, dmitry.kozliuk@gmail.com,
 ranjit.menon@intel.com, navasile@linux.microsoft.com,
 dmitrym@microsoft.com, stable@dpdk.org
Date: Wed, 14 Oct 2020 22:30:01 +0300
Message-Id: <20201014193001.13820-1-talshn@nvidia.com>
X-Mailer: git-send-email 2.16.1.windows.4
Subject: [dpdk-dev] [PATCH] bus/pci: clear undefined bits in Windows segment
	parsing
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

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@dpdk.org

Signed-off-by: Tal Shnaiderman <talshn@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;
-- 
2.16.1.windows.4