From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0088.outbound.protection.outlook.com [104.47.38.88]) by dpdk.org (Postfix) with ESMTP id C9C3A91E3 for ; Tue, 20 Sep 2016 14:43:16 +0200 (CEST) Received: from BLUPR0301CA0034.namprd03.prod.outlook.com (10.162.113.172) by DM5PR03MB2443.namprd03.prod.outlook.com (10.168.233.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.629.8; Tue, 20 Sep 2016 12:43:15 +0000 Received: from BL2FFO11FD057.protection.gbl (2a01:111:f400:7c09::122) by BLUPR0301CA0034.outlook.office365.com (2a01:111:e400:5259::44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.629.8 via Frontend Transport; Tue, 20 Sep 2016 12:43:14 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com;nxp.com; dkim=none (message not signed) header.d=none; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BL2FFO11FD057.mail.protection.outlook.com (10.173.161.125) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.629.5 via Frontend Transport; Tue, 20 Sep 2016 12:43:14 +0000 Received: from Tophie.ap.freescale.net ([10.232.14.87]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id u8KCexsq006559; Tue, 20 Sep 2016 05:43:11 -0700 From: Shreyansh Jain To: CC: , David Marchand , , Thomas Monjalon , Shreyansh Jain Date: Tue, 20 Sep 2016 18:11:36 +0530 Message-ID: <1474375296-26078-25-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1474375296-26078-1-git-send-email-shreyansh.jain@nxp.com> References: <1466510566-9240-1-git-send-email-shreyansh.jain@nxp.com> <1474375296-26078-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131188489947411148; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(7846002)(92566002)(47776003)(2906002)(5003940100001)(33646002)(87936001)(105606002)(229853001)(2950100001)(104016004)(5660300001)(85426001)(4326007)(2351001)(106466001)(68736007)(626004)(50226002)(305945005)(81156014)(97736004)(50986999)(76176999)(81166006)(11100500001)(19580405001)(8666005)(189998001)(86362001)(575784001)(8676002)(586003)(110136003)(77096005)(48376002)(19580395003)(8936002)(36756003)(356003)(50466002)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR03MB2443; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD057; 1:NAIWxXed+owectXLkiBd5hVmCaEurO33Y8rphUzvMbp/Drbc/E6yoXY/TyJY6sNCn7O0cJzVXcWHk0Zdc0M+zubj2h48DUTHHUMOxNujt/6K6vFNm9auACaBX4x3XASjnVWYNOVCCRcGgFnb5wCYwI32d293NVWnxnO0fZ+EQxOEn/XTe+wyCwhSw0MTMaXk2pJHlukDEzgB/OCAQ7czZO+1l4UJr/K4RMIar/F/z78SmXtIjUMzNjLevX5aY7C+3CMiCD5LGjPUk3XAkLPDAzV014o7Qv6T8EJH4jr3iPKw3tnDgZ/lXTb/0N457m1BO5ceiJ5FoieQ7+FMXMoaw3Srlk+i/5M4oCdIJOx7K0cpnKjQsvErc8ohKE5m2Hb/KXKglbOVVXFub7ZjsorphhK4NrJ1H0IHHpnXGSULV8x9L+UN6RVLUlxd6n/LXCQVMPu1ZmKNFawXwX5hdRQSjsUcUUz8wIF+Yf3VmbowqQPhURzomDIiBw05M5iZ+GCCsnxA8aF6JcIe4WtIsksQy4dlJiZyXwVUecSit1fM0SQhavJDsGe8+pAh/tdfomwRoj79Silf50OPxq/A6AIqH217fZXOAHGRlyUJlJnwxs9T0YY7Aj55+TVu65NW9EzF2/gYYu/pHhI0r/dT/+g45xLjX4GFw1B+eMo0DX2mNbojduIYXcrx5uWMQ944LnSAPJpI/7hL5tGAQZomaYy0+sKsfx9UegZCHoVKqYFA3mA= MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 324ff99c-e1a4-4ea5-116a-08d3e153b064 X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2443; 2:55riNm1vFO0bTs3fIqE/UfSLIQFl0q6RL0sIPOTfpbalGFOEb+cKpVhVibM+mc5GiYDUcXCi7OKBXxrSpyd4omLIwneEUPnpozHFjvT4onM5cQy5e5DZR7ggGTgo2dpiObZKWj6fQJFjoNNZbXgLuunJgZ6o9SADz0sQdVDK00I31HKcVXybcMLsArWebVe6; 3:K1vbhIkoYuoIQp3m7/Yb1kN3RDP2/BaUolADIiMa1fouejMu+Uj+4IFwXZfYJN+sSU0lLptpWxUqoQd61ag8nCM5PNws8F3N6XWQ9J0sevgatBzadBCLtseTsv+OogdptbESPH6BThut9FBlUdSv0I1ZODs0NfAdhQAMeCp5CqF8gvtGTlstS30yw6PYHyWlTJyFD82g8zHA51NQa1Pu0GLhVOWIDhAwF4uUOSlFaao=; 25:/XYBGJPxqDvFKSIXIjAziEkg6kY5yVoCRdwVHkQIhi4V0UY3O15vi1TIxLJYuXer9NE7k5ELws5uwrrOSkwAwlaAfL8k7xq1d4en0Uobsw0EwUl2qkg2ibTnqhNWDoumwyeN8JNN0UZAjD1LJB92Si5XQRa/DrpOEBTvOmvHPiMYVIspDX3df1sNWIKvEaco2N8g6S+HOf+Vl54qlhedChvxrvi1z0KHzqEWLiEtqocoLJP8i5v0X6X5iJ+O3JIazA/ywWOf/hdX///Tk5SaouTsL7gfTh3YjCCd2i/AExc0cxsVHX0xCmI2Am3xK+lji4fj64pNqRVRrmphdW0qpyMCPBSKe9BJ60hYsNarQvJtT+TqlUIJi57TzHV43evbWaY6fYYSm5ogspTXID/nCX9RaNgXKeLdBNmb/GrqTBA= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM5PR03MB2443; X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2443; 31:/oGt0nb8T8QwE7WLiS44Fy1YHl/boTSaYmxgdHbzdZd8t+70m02Vqa+ItzsU6CRLQjFq67GIbCBWG9gMqZBBdjh7eqbaSLWixhn8lWUucMEpJVWYwSEA+qppG7Lylk6oGH+rKp7RifSaZD3xCowmfYfjvjZNwxcI0I386dZZ5q41zmasFYYiqois6ul0HY9itymAJMhwUggZIISqg20644Q6xA1/mthUMAtDLrVuRXY=; 4:R7dHoUETm1my189n0eq/VN7Vq7Gm4Zwl9P8fgzesYdWtfaN6s8aQP3jN+y/FTDsdr0M3gZCVGJY0LRL0EfHv91DcrJGf/f2QPPp1KWcgVQIMA0O74l/QrCKwzszARVOESP0PbmdPsscuKjZezpE1FkLz8YP7oPusHc2TO/2sX497536Wd3m58g7moNwQekHh6pjzYQpSSEBRh/P5jY0qz/Brf1982bOezI426Ti9OgIlnYIY7jAkGRTUOoKQNN15M30PzV6koG+zYm69s4QyihadCLtU0/TmqGYR0DxloRo3U1Qr2mmQZ5La//Mqs3nZoL2tTiK1A4O/S9zG8/8wkqUOs8mCCx8yO+rUa+xyZam/exvuoFizgNPtUZkZ6UPFST/YCFGPXTFXjhYxJHXIfB3iDajFfEJLaQZeLQOiGnqii/zdDC/wfqwZ6He0ZvL9Nj8ct/PEWkuSlNJlA2mo/KkSC7KnHrkzzXRQHZzsfMRlTawWNrQyiSVp3BQGX0GhUwyBRxjdkqMgWozJ3CqrBRrtwBJBjtvUv9nG4P0+5AM= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(13018025)(13024025)(13017025)(13015025)(13023025)(8121501046)(5005006)(3002001)(10201501046)(6055026); SRVR:DM5PR03MB2443; BCL:0; PCL:0; RULEID:(400006); SRVR:DM5PR03MB2443; X-Forefront-PRVS: 0071BFA85B X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR03MB2443; 23:YmJio13JvoXtd17fLKcbKqsOng6SInqH3FdB/MqRo?= =?us-ascii?Q?K/exPA04fS1aOKzV3GP7lmvic++CK6eHycsrRJ6sK1mhhH4gfSkwnyF6jfrl?= =?us-ascii?Q?oEqgH27Nkyf+9MbXvpHiJVzAHRmQ7BZ2zygjUyV8DgGT/B4wkioFk+FVoUdh?= =?us-ascii?Q?W10OUOWNySmtae76SN4jqyBbTgTxYNq78qCXLorpFyj9+ZZPTJkmYeKpwQg1?= =?us-ascii?Q?Q5N5pqvujRpRfbQeuDMGk64LLt5ENu5SlP2r9UxcFz+kXcZwDuIT5od4O+Bg?= =?us-ascii?Q?HC4/Y//5hOjHmCsUHDA78hs8+n2lc9tK6AVqDdcrI/nDOcLixfXCGJeY/29i?= =?us-ascii?Q?JdfHzvbr+HNTYEWwWHdZEiL8266PmJui2AYrCAGxm8BNrrIDOm3//h4Qia1F?= =?us-ascii?Q?NRe9HLw61ePRvjGFBo0kUxnSq34AqXhGw7ylI9Jrme2yutLkJDpm4M9S5Ltv?= =?us-ascii?Q?bkDWrS+A6fYR0DOEL/lwsQ7l4SnATrn2Pb5HUSb49119jV7ZKrpSzQiRMuXv?= =?us-ascii?Q?GnU4UKSJ/rYUehE2nnMjEOzCWiQfUJCI+WLVjAxnZfhrZhI4vAONrSqtMkk3?= =?us-ascii?Q?utt2dvZF7kA3hHeiQwgHDeupG8yc4Ayr4FOQkkgMssVUv5JQg9QS60wkD8Fd?= =?us-ascii?Q?kL3WD84qg2q4Mg5E+eiXaf53+LNnHipI29le3rKTpyV8nGgP/0tLBGa6jaBI?= =?us-ascii?Q?VWWB0+ULexkmxJmyFbteicOnQSITLJDlwYA4g305QavBBr4jyCDK6F6CnBqL?= =?us-ascii?Q?9y2A3+GHJjisvVHyFZLJzKdvHxiSF5dyAqHqBU2QGRXq3xwck1dMHSXNkisq?= =?us-ascii?Q?1wc3RvhW9OSUF3MuA+LAONYkcHJ6PEafVgM7pqJSKwTjMvUy/DnI18Itz+u6?= =?us-ascii?Q?IU0fMkMr7y+e3jn7jb5wwH19qrXqd5jGbDWvoUkka/WO5FfPmLXBy47iG1HZ?= =?us-ascii?Q?x1++7b9eGKoGD9B7NhiSOZBQ3D4ge+8twdQC2KswrCka4oJ95uftRuQos1ji?= =?us-ascii?Q?nAYAv8TwmAj775+3If8Vi/wEz3mirlHINNd4dyCpnuy1+X5wUFBmsW2E/6Kx?= =?us-ascii?Q?ZMghLRiaDDTYC4QUxvJzex3eRNxGU92i2s1v6DWlQwvnafNq0b3DsuQBz8Gz?= =?us-ascii?Q?IUXg39HJ5o8SbfGAfvhCoHTwriBjP3XTk1eRg1kbUuiPJK1l9cB+mqWTuaIV?= =?us-ascii?Q?H7+GzyrmqgsaBeVYKixSCUpzsXlad991peG?= X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2443; 6:4bG5cK801T6b6s3cKRiw3o3l3Q/0l/Acyex3BXkb3oMFb713t4cCzejTFttqta8i54w5p8qLdRW7MH9aKllxx7JjNGlErhWvtzMAj/uPKmJ7FGjBvtmoTAqI3kob0BTJES/BPJNM/zTQ7tqRj542JoSkNv6yfQp/d4pGSlDBr/rJD/usXLfNBUMjeyq8D+7WDB6m4l9VGXg7zPj8kiYCVbXIjkQa5N0tMPy+YFl4C3dy7C6H4zNSUKqRhwo9Ed+axPaZu5vascsI3r2YUQaEH37uLA+F3nrIp9l77qmr+GY=; 5:OZ243Ty6r/WsSVK5tTNS5VZky1wh58xkXQRA0E4lyzXD39wdFiUT2OMmeQ2zXMxfI37Qb5NSnMQkzyXxEe6dzifDNQFir91b1rfyU35uJcfuRP6buHoZJ5Ba3VLPi1OarKiEuixDQfCl6rR92blWf719HCPzvSpIHj9ITd0ARXk=; 24:rBxHDTuuS9iHsWmE1JsknX0Quf6sWz8Xw/bsWsTyaxHVsE2/LAj5mubbJz/ccUHHO9ZywmKQHnQeMtaNNkh8s0OfzLhBOvWbD/gtI8jCzU0=; 7:A4alCiIzNKqURZ2vxq8q8yKROiU7nRGVlTvaMkXkyf2I5Jj2PwxAfIn9a/I2AIBTuy/pVCK3v2EDhn0xaNjSaWPA+t36AZr7vCAjORHvIMShedrXP4xlBMIdC4JoDiyreLNld9pVvCIATsCQdK96LxmxjGh1PdfaW5ZO4FMYhaPOOb6ttpBW6sNW+QCeEpHbuQtB+KjFk51GjXL4okj4hPkAemJfgJHFa8wg813pq8H7mg1H1jlEqelAcHXMrWl2JZzdDMq2ovUEo1SPxzQE+tQ9/RqC1Osjub/3x3asZ53Luhn2Rw95R10xwmWe1pVq SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Sep 2016 12:43:14.5539 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR03MB2443 Subject: [dpdk-dev] [PATCH v11 24/24] eal/pci: create RTE device list and fallback on its members X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Sep 2016 12:43:17 -0000 From: Jan Viktorin Now that rte_device is available, drivers can start using its members (numa, name) as well as link themselves into another rte_device list. As of now no one is using this list, but can be used for moving over all devices (pdev/vdev/Xdev) and perform bulk actions (like cleanup). Signed-off-by: Jan Viktorin [Shreyansh: Reword commit log for extra rte_device list] Signed-off-by: Shreyansh Jain --- app/test/virtual_pmd.c | 4 ++-- drivers/net/fm10k/fm10k_ethdev.c | 6 +++--- drivers/net/i40e/i40e_ethdev.c | 6 ++++-- drivers/net/mlx5/mlx5.c | 2 +- drivers/net/virtio/virtio_pci.c | 5 +++-- lib/librte_eal/bsdapp/eal/eal_pci.c | 2 +- lib/librte_eal/common/eal_common_pci.c | 11 ++++++----- lib/librte_eal/common/include/rte_pci.h | 3 +-- lib/librte_eal/linuxapp/eal/eal_pci.c | 7 +++++-- lib/librte_ether/rte_ethdev.c | 2 +- 10 files changed, 27 insertions(+), 21 deletions(-) diff --git a/app/test/virtual_pmd.c b/app/test/virtual_pmd.c index 56eeb99..4831113 100644 --- a/app/test/virtual_pmd.c +++ b/app/test/virtual_pmd.c @@ -585,7 +585,7 @@ virtual_ethdev_create(const char *name, struct ether_addr *mac_addr, if (eth_dev == NULL) goto err; - pci_dev->numa_node = socket_id; + pci_dev->device.numa_node = socket_id; pci_drv->driver.name = virtual_ethdev_driver_name; pci_drv->id_table = id_table; @@ -626,7 +626,7 @@ virtual_ethdev_create(const char *name, struct ether_addr *mac_addr, eth_dev->dev_ops = &dev_private->dev_ops; eth_dev->pci_dev = pci_dev; - eth_dev->pci_dev->driver = ð_drv->pci_drv; + eth_dev->pci_dev->device.driver = ð_drv->pci_drv.driver; eth_dev->rx_pkt_burst = virtual_ethdev_rx_burst_success; eth_dev->tx_pkt_burst = virtual_ethdev_tx_burst_success; diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c index 71d35f7..ed666c1 100644 --- a/drivers/net/fm10k/fm10k_ethdev.c +++ b/drivers/net/fm10k/fm10k_ethdev.c @@ -675,7 +675,7 @@ fm10k_dev_tx_init(struct rte_eth_dev *dev) /* Enable use of FTAG bit in TX descriptor, PFVTCTL * register is read-only for VF. */ - if (fm10k_check_ftag(dev->pci_dev->devargs)) { + if (fm10k_check_ftag(dev->pci_dev->device.devargs)) { if (hw->mac.type == fm10k_mac_pf) { FM10K_WRITE_REG(hw, FM10K_PFVTCTL(i), FM10K_PFVTCTL_FTAG_DESC_ENABLE); @@ -2731,7 +2731,7 @@ fm10k_set_tx_function(struct rte_eth_dev *dev) int use_sse = 1; uint16_t tx_ftag_en = 0; - if (fm10k_check_ftag(dev->pci_dev->devargs)) + if (fm10k_check_ftag(dev->pci_dev->device.devargs)) tx_ftag_en = 1; for (i = 0; i < dev->data->nb_tx_queues; i++) { @@ -2762,7 +2762,7 @@ fm10k_set_rx_function(struct rte_eth_dev *dev) uint16_t i, rx_using_sse; uint16_t rx_ftag_en = 0; - if (fm10k_check_ftag(dev->pci_dev->devargs)) + if (fm10k_check_ftag(dev->pci_dev->device.devargs)) rx_ftag_en = 1; /* In order to allow Vector Rx there are a few configuration diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 5564e82..cfea11f 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -905,8 +905,10 @@ config_floating_veb(struct rte_eth_dev *dev) memset(pf->floating_veb_list, 0, sizeof(pf->floating_veb_list)); if (hw->aq.fw_maj_ver >= FLOATING_VEB_SUPPORTED_FW_MAJ) { - pf->floating_veb = is_floating_veb_supported(pci_dev->devargs); - config_vf_floating_veb(pci_dev->devargs, pf->floating_veb, + pf->floating_veb = + is_floating_veb_supported(pci_dev->device.devargs); + config_vf_floating_veb(pci_dev->device.devargs, + pf->floating_veb, pf->floating_veb_list); } else { pf->floating_veb = false; diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index 16f9891..a0b7e15 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -511,7 +511,7 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev) priv->mtu = ETHER_MTU; priv->mps = mps; /* Enable MPW by default if supported. */ priv->cqe_comp = 1; /* Enable compression by default. */ - err = mlx5_args(priv, pci_dev->devargs); + err = mlx5_args(priv, pci_dev->device.devargs); if (err) { ERROR("failed to process device arguments: %s", strerror(err)); diff --git a/drivers/net/virtio/virtio_pci.c b/drivers/net/virtio/virtio_pci.c index f1a7ca7..9b47165 100644 --- a/drivers/net/virtio/virtio_pci.c +++ b/drivers/net/virtio/virtio_pci.c @@ -745,8 +745,9 @@ vtpci_init(struct rte_pci_device *dev, struct virtio_hw *hw, PMD_INIT_LOG(INFO, "trying with legacy virtio pci."); if (legacy_virtio_resource_init(dev, hw, dev_flags) < 0) { if (dev->kdrv == RTE_KDRV_UNKNOWN && - (!dev->devargs || - dev->devargs->type != RTE_DEVTYPE_WHITELISTED_PCI)) { + (!dev->device.devargs || + dev->device.devargs->type != + RTE_DEVTYPE_WHITELISTED_PCI)) { PMD_INIT_LOG(INFO, "skip kernel managed virtio device."); return 1; diff --git a/lib/librte_eal/bsdapp/eal/eal_pci.c b/lib/librte_eal/bsdapp/eal/eal_pci.c index 1d91c78..8b3ed88 100644 --- a/lib/librte_eal/bsdapp/eal/eal_pci.c +++ b/lib/librte_eal/bsdapp/eal/eal_pci.c @@ -287,7 +287,7 @@ pci_scan_one(int dev_pci_fd, struct pci_conf *conf) dev->max_vfs = 0; /* FreeBSD has no NUMA support (yet) */ - dev->numa_node = 0; + dev->device.numa_node = 0; /* FreeBSD has only one pass through driver */ dev->kdrv = RTE_KDRV_NIC_UIO; diff --git a/lib/librte_eal/common/eal_common_pci.c b/lib/librte_eal/common/eal_common_pci.c index 0b032d6..609c424 100644 --- a/lib/librte_eal/common/eal_common_pci.c +++ b/lib/librte_eal/common/eal_common_pci.c @@ -185,11 +185,12 @@ rte_eal_pci_probe_one_driver(struct rte_pci_driver *dr, struct rte_pci_device *d RTE_LOG(INFO, EAL, "PCI device "PCI_PRI_FMT" on NUMA socket %i\n", loc->domain, loc->bus, loc->devid, loc->function, - dev->numa_node); + dev->device.numa_node); /* no initialization when blacklisted, return without error */ - if (dev->devargs != NULL && - dev->devargs->type == RTE_DEVTYPE_BLACKLISTED_PCI) { + if (dev->device.devargs != NULL && + dev->device.devargs->type == + RTE_DEVTYPE_BLACKLISTED_PCI) { RTE_LOG(INFO, EAL, " Device is blacklisted, not initializing\n"); return 1; } @@ -252,7 +253,7 @@ rte_eal_pci_detach_dev(struct rte_pci_driver *dr, RTE_LOG(DEBUG, EAL, "PCI device "PCI_PRI_FMT" on NUMA socket %i\n", loc->domain, loc->bus, loc->devid, - loc->function, dev->numa_node); + loc->function, dev->device.numa_node); RTE_LOG(DEBUG, EAL, " remove driver: %x:%x %s\n", dev->id.vendor_id, dev->id.device_id, dr->driver.name); @@ -418,7 +419,7 @@ rte_eal_pci_probe(void) /* set devargs in PCI structure */ devargs = pci_devargs_lookup(dev); if (devargs != NULL) - dev->devargs = devargs; + dev->device.devargs = devargs; /* probe all or only whitelisted devices */ if (probe_all) diff --git a/lib/librte_eal/common/include/rte_pci.h b/lib/librte_eal/common/include/rte_pci.h index f0a9ea2..3a8e8c8 100644 --- a/lib/librte_eal/common/include/rte_pci.h +++ b/lib/librte_eal/common/include/rte_pci.h @@ -149,6 +149,7 @@ enum rte_kernel_driver { */ struct rte_pci_device { TAILQ_ENTRY(rte_pci_device) next; /**< Next probed PCI device. */ + struct rte_device device; /**< Inherit core device */ struct rte_pci_addr addr; /**< PCI location. */ struct rte_pci_id id; /**< PCI ID. */ struct rte_mem_resource mem_resource[PCI_MAX_RESOURCE]; @@ -156,8 +157,6 @@ struct rte_pci_device { struct rte_intr_handle intr_handle; /**< Interrupt handle */ struct rte_pci_driver *driver; /**< Associated driver */ uint16_t max_vfs; /**< sriov enable if not zero */ - int numa_node; /**< NUMA node connection */ - struct rte_devargs *devargs; /**< Device user arguments */ enum rte_kernel_driver kdrv; /**< Kernel driver passthrough */ }; diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c b/lib/librte_eal/linuxapp/eal/eal_pci.c index 62da4d4..876ba38 100644 --- a/lib/librte_eal/linuxapp/eal/eal_pci.c +++ b/lib/librte_eal/linuxapp/eal/eal_pci.c @@ -350,13 +350,13 @@ pci_scan_one(const char *dirname, uint16_t domain, uint8_t bus, dirname); if (access(filename, R_OK) != 0) { /* if no NUMA support, set default to 0 */ - dev->numa_node = 0; + dev->device.numa_node = 0; } else { if (eal_parse_sysfs_value(filename, &tmp) < 0) { free(dev); return -1; } - dev->numa_node = tmp; + dev->device.numa_node = tmp; } /* parse resources */ @@ -390,6 +390,7 @@ pci_scan_one(const char *dirname, uint16_t domain, uint8_t bus, /* device is valid, add in list (sorted) */ if (TAILQ_EMPTY(&pci_device_list)) { + rte_eal_device_insert(&dev->device); TAILQ_INSERT_TAIL(&pci_device_list, dev, next); } else { struct rte_pci_device *dev2; @@ -402,6 +403,7 @@ pci_scan_one(const char *dirname, uint16_t domain, uint8_t bus, if (ret < 0) { TAILQ_INSERT_BEFORE(dev2, dev, next); + rte_eal_device_insert(&dev->device); } else { /* already registered */ dev2->kdrv = dev->kdrv; dev2->max_vfs = dev->max_vfs; @@ -411,6 +413,7 @@ pci_scan_one(const char *dirname, uint16_t domain, uint8_t bus, } return 0; } + rte_eal_device_insert(&dev->device); TAILQ_INSERT_TAIL(&pci_device_list, dev, next); } diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index a88a05d..c517e88 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -3209,7 +3209,7 @@ rte_eth_copy_pci_info(struct rte_eth_dev *eth_dev, struct rte_pci_device *pci_de eth_dev->data->dev_flags |= RTE_ETH_DEV_DETACHABLE; eth_dev->data->kdrv = pci_dev->kdrv; - eth_dev->data->numa_node = pci_dev->numa_node; + eth_dev->data->numa_node = pci_dev->device.numa_node; eth_dev->data->drv_name = pci_dev->driver->driver.name; } -- 2.7.4