From patchwork Wed Nov 10 11:45:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Awan, Arsalan" X-Patchwork-Id: 104109 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0EAA9A034F; Wed, 10 Nov 2021 12:46:00 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A049C4068B; Wed, 10 Nov 2021 12:45:59 +0100 (CET) Received: from esa1.mentor.iphmx.com (esa1.mentor.iphmx.com [68.232.129.153]) by mails.dpdk.org (Postfix) with ESMTP id D7F3C40683 for ; Wed, 10 Nov 2021 12:45:57 +0100 (CET) IronPort-SDR: qB+KIIQVMJ5Nbc2lzk0lVYa3cK+vCQzGHHY7zEPqIqvCvoOrPCVYYxNX8hj1FntLBhQbHMHqVj gyW9x2yR9BLfttRPissrazxi3c/tVDItAgj73CY372NiII35X4rUnEjavjGU8IBkWpDJNoQ9Tg X5D8fjAHOy8fOGqtzlfmnMx4A6H7RPv9HFPYQDlMg7z/9NMwLVatlA1JDH5MBZE1MLm5k/KINU 33QWpa7f/NaKpZGlGvx7B8Sg7++pxomeGTPGOy+6IGKCGWKq/kMwy333QBVgULK8H0UWRxGlNh eWvapM/zB25lNCWgGUZrbQ93 X-IronPort-AV: E=Sophos;i="5.87,223,1631606400"; d="scan'208";a="70769551" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa1.mentor.iphmx.com with ESMTP; 10 Nov 2021 03:45:57 -0800 IronPort-SDR: tcy/6CaI29QFICWnmB05pKfxZqtSjHkdXsVqvt44AlXNcM3C7M9tzIbO6IN53ld14UCeWWgVGX 8FfE48UXfeOCkegQxnspV4+XcPT8uZ0rhtUgClENIPS0jyfWZyt3yUk72Xqn5l/lcjyP7L6dbz +wySNHOglL0XOlgLdcgwfMtKXyB6AiYrpxLDRtpt0/vHoUv5Eq2xD87oxwRZH4m/YvegDZp8GS t3s6Xb809KzVMX1SsUxK0lPmsUX9h1QHh71tGqnNFVxnLyiFC2oAhVQpQeQZdshVU/PpxyPpzD G4o= From: "Arsalan H. Awan" To: CC: , , , , "Arsalan H. Awan" Date: Wed, 10 Nov 2021 16:45:19 +0500 Message-ID: <20211110114519.8216-1-Arsalan_Awan@mentor.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) To SVR-IES-MBX-03.mgc.mentorg.com (139.181.222.3) Subject: [dpdk-dev] [PATCH] net/axgbe: fix PCI ID to distinguish v1000 vs e3000 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" The RV PCI Root Complex Device is not visible to DPDK on the PCI bus via pci_search_device on some OSs including Ubuntu and Yocto. This makes it impossible to determine which machine DPDK/axgbe is running on. As a result, DPDK/axgbe does not work on v1000. Let's use the Raven Internal PCIe GPP Bridge ID that DPDK can see on the PCI bus that exists on the v1000 to differentiate between RV AXGBE and SNOWY AXGBE, and set the registers accordingly. This fixes DPDK not working on v1000 platform. Signed-off-by: Arsalan H. Awan Signed-off-by: Arsalan H. Awan --- drivers/net/axgbe/axgbe_ethdev.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/axgbe/axgbe_ethdev.c b/drivers/net/axgbe/axgbe_ethdev.c index 7d40c18a86..7b1b46990f 100644 --- a/drivers/net/axgbe/axgbe_ethdev.c +++ b/drivers/net/axgbe/axgbe_ethdev.c @@ -170,7 +170,7 @@ static const struct axgbe_xstats axgbe_xstats_strings[] = { /* The set of PCI devices this driver supports */ #define AMD_PCI_VENDOR_ID 0x1022 -#define AMD_PCI_RV_ROOT_COMPLEX_ID 0x15d0 +#define AMD_PCI_RV_INTERNAL_PCIE_GPP_BRIDGE_ID 0x15db #define AMD_PCI_AXGBE_DEVICE_V2A 0x1458 #define AMD_PCI_AXGBE_DEVICE_V2B 0x1459 @@ -2178,9 +2178,9 @@ eth_axgbe_dev_init(struct rte_eth_dev *eth_dev) pdata->pci_dev = pci_dev; /* - * Use root complex device ID to differentiate RV AXGBE vs SNOWY AXGBE + * Use Raven Internal PCIe GPP Bridge device ID to differentiate RV AXGBE vs SNOWY AXGBE */ - if (pci_search_device(AMD_PCI_RV_ROOT_COMPLEX_ID)) { + if (pci_search_device(AMD_PCI_RV_INTERNAL_PCIE_GPP_BRIDGE_ID)) { pdata->xpcs_window_def_reg = PCS_V2_RV_WINDOW_DEF; pdata->xpcs_window_sel_reg = PCS_V2_RV_WINDOW_SELECT; } else {