From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0065.outbound.protection.outlook.com [104.47.33.65]) by dpdk.org (Postfix) with ESMTP id 82E7E69F8 for ; Fri, 26 Aug 2016 15:58:37 +0200 (CEST) Received: from BN3PR0301CA0039.namprd03.prod.outlook.com (10.160.180.177) by BY2PR03MB1880.namprd03.prod.outlook.com (10.164.114.20) with Microsoft SMTP Server (TLS) id 15.1.497.12; Fri, 26 Aug 2016 13:58:32 +0000 Received: from BY2FFO11OLC001.protection.gbl (2a01:111:f400:7c0c::139) by BN3PR0301CA0039.outlook.office365.com (2a01:111:e400:4000::49) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.587.13 via Frontend Transport; Fri, 26 Aug 2016 13:58:31 +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 BY2FFO11OLC001.mail.protection.outlook.com (10.1.15.185) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.587.6 via Frontend Transport; Fri, 26 Aug 2016 13:58:31 +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 u7QDvHq2023630; Fri, 26 Aug 2016 06:58:28 -0700 From: Shreyansh Jain To: CC: , , , , Shreyansh Jain Date: Fri, 26 Aug 2016 19:27:03 +0530 Message-ID: <1472219823-29486-26-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1472219823-29486-1-git-send-email-shreyansh.jain@nxp.com> References: <1466510566-9240-1-git-send-email-shreyansh.jain@nxp.com> <1472219823-29486-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131166935115292647; (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)(1109001)(1110001)(339900001)(189002)(199003)(104016004)(77096005)(8936002)(4326007)(105606002)(229853001)(33646002)(2906002)(92566002)(11100500001)(50226002)(586003)(76176999)(5660300001)(68736007)(50986999)(97736004)(47776003)(8676002)(2950100001)(19580395003)(36756003)(189998001)(2351001)(86362001)(356003)(85426001)(48376002)(81156014)(106466001)(305945005)(110136002)(81166006)(19580405001)(5003940100001)(626004)(7846002)(8666005)(50466002)(87936001)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR03MB1880; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11OLC001; 1:Ktkc1Kc+adzH34+58SD7yxtpBIqK0BwSfgpNKUAQxNDEACSY09D3jmW2UqjeLlblUT2wqE83RP+d7RI4iVW1wVibPIm6Urw8V9PRcZcx8vLDQh9vcm6tiao2XnEo0vnv6a0PEWzK1+CFxXA30OPUizlmgEuDDPVvIX+sFhUxSWi54JR5PDhbQAw0SAaXl0ZJ1e3nuwO0aT92XfU/HS2rxiX9cdxbyxcd6LUSQ9u26wAl+oMkiu4ptlg5Hqu6JUHi2oDGSVQoCpR9Z4L/z+y1glU3WqCaM+FCz9RvK9wv2z5EXFGRZuGCsVfhvEzdXkl3QJKhJVBHa1mrasjQhn97Ny/Q/uTDWjetLxpQPKlV+B2bFaITmc5f8wn2r9rA+2py+SgzscenX2qBrqoW19Ic6AdmgFBqD/y4FRMJanrgTLjOEbNE669GaRpapo64g/j6SoFZhV9O8NwmXAh3TaqBSq6G1VAkgSkGae9m4IavFdq5pVO+62mQHkZjKXEf1HIJc7G0BxC7ncNhXLkmY+EHPidHv3YIr+r5WWyBrk3AlXdgmCmPfVEYXCgQMtsVQfBE2Xz0EB8o+f6JFWNaH89h8cK4ud69Y/raRKGr1xe9RtRv6M9kw528SxJA1M7eaHGGoQWLNCuGcQVt6kHE9wieLE0sW+pyTHr+j45aBTAXn5ppG28B0PYCZ1sOIALk6jG9ejuZtPlGKpdlFWHSNBHVC6VSdVCbUwu7VoX1iPTKtB8= MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 4c370663-a2ad-41a1-dfe7-08d3cdb91049 X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB1880; 2:7qA1kuWD08rVkf4iBv2XrU9WOjC9voiu+/bmiGae6o1FC29tjt5yAmMNG08O4/+BDg4wkdlAGKVI/zlw4R5pmdZepTk0XH9nDH248Sln9ME0Pn/U5zPneoH59XRCLHnCkJoGjbFuEQox8Daznk0NjXx0AQ/UzF5oIrGUbmu8M8InHM+hyBjznOkvyLoOuggB; 3:ypsu5FhOTygPJoCV7pGarSt/Qkl5t9Y6ya/DVPstf8n0j17RO03ecqPdobq50/rQVWa75SZAz4IqoQ5bltAMozMTqTYh8QVw0Suoovmw5yp7+VG+2fgGyfod+dAX6J5avwufGP2945ZyxDr9mZ+ZGwt1WIJ/eCWr3K51ZO3qpRGlSd7A7p3Y2aiQyG/iI4W/UV5G/1zRhDn21hgVQaUSs1UvqOhAefloMLEbEyXLKaA=; 25:hcsoFpDfA0nE0qpIsR7RKO7bZ4XV5jNsbfUOBi4899BK41L1wRsyAVUtU4OoKBcYkkaK/k9ulUZ/653KfbRRLAJAl1HTVTq+oRB+NOsWlk6gtkXZB2Ui3//Aht+pd20OrICMzFZzmhspsziXmiU4RP2UFIjuhFRdMQXckZEU0q7ZpABkQSqfsjQnY2fC5vtPJcd82NecKEFyi9b67tAKBX+pnXUfgio50NIkOI1+0SuyGqG08gq72KklGotg2OV1vTgOiNof6ETw6aN/hngvkzLYs8BF74knrH+pOWyEXmDLlKzdO9u61DGv7jYAFF+jZku2pTEcvq4Idok3kL04Ko5LUTKhpIQDkk1mNd9NL5aK2DBYaJeSisd/w2HhfvSUjbjNZqstJMYAc1w+yD6YBAHVkHBz3+T8dCjomvePon4= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY2PR03MB1880; 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)(13015025)(13023025)(13024025)(13018025)(13017025)(8121501046)(5005006)(10201501046)(3002001)(6055026); SRVR:BY2PR03MB1880; BCL:0; PCL:0; RULEID:(400006); SRVR:BY2PR03MB1880; X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB1880; 4:y9ryCWpcsV8Jxd1+2jogy0/NHDWRSrRCCStVKa6j7F3692OEm63bRblC/5GsH6Wt0IIlH3/eqOw1xBMwDi6LR+yngrL9UqaJ8V/zxC9hzZ4mhpPo8os5ku/pUm74fvFTq0EAWqxruHpDCVaF7TiAeBcqec0QpGS5gea0ONdJKSL0w3f3n2TR2TxABUN6Y3jdMAu9/uUPK7NyWywYydBa95hTdLMjTUfiLnqsF7iwaurORlrsohSKAB8DU9aM8HMpe8+D1GZPPUJIrRi8rwQ+FA9NdOj53heLxNhkwLJ50oKx6o0O13P3eBs4bWmvDMIcafxT2nxXCtdIHlJGqRHFu7htFYklw5YAigrdozise+WBnvLE4zRqcxy4JNXS+BIbgjldTtB+fU67WL7pTnZMpKlNLNNgkX3RPaPbKIoqRGtxtaqvR8bYOLP8znXrQGn3BrM7JlBICdqnveqaVgUuc0nbF6va8uTTFL9H2RuhcEr9s21ZCsbH/BUZRrFC9qeehXu3KT7eiCAqwUJwuZARVRIyAAwTTjSsi+EfLY9o/wk= X-Forefront-PRVS: 00462943DE X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR03MB1880; 23:GnlAJa9juRBXbZ+0/YZhQUAl6xBHg1M6XWHqcuXq1?= =?us-ascii?Q?sRD8ulScSPA8om0o1xcPdglJm63ql4Ywr+WqQSnzXWwM6fS40SXFhI0BJmZL?= =?us-ascii?Q?yLQh6YjVrv9TesRu9IU2ujfs0cesLj13T7DU9pENmuvcDr9CE3fm6PZjBURE?= =?us-ascii?Q?R1XvUWOkeE114li+XhhFuPO4B2zmTS1tFCZd7uMVbQeON1SdrCz9pYo0eduf?= =?us-ascii?Q?ynWJrl/HUqHV7pLg8B1mWO2YnX6wVyCfZWWZUWRlxKJSulx6SoWaAWEanM2O?= =?us-ascii?Q?+RHP/kuO8/1N6FdNeMc0FDn0kYGxbDuxIcaiRZIujwR3Fw45f23Sp3EPZcnU?= =?us-ascii?Q?NL8qTzaNYhSwEO5V3bDlg9hAXbF+KQJHP/+64B3EZPUruqx840k4jFSFZq38?= =?us-ascii?Q?GwY3+5Vw6AVrwmVv5/7lX/RrqKhfqgJk7y0AO8J1NVpfr6TDM/cgFd9j8fwC?= =?us-ascii?Q?TzXmAkATKVwBOJnO8/bpDGtNPkAAWylHmHlAXOnY8oX4Jctkldx0Nmlcf+qE?= =?us-ascii?Q?EPMhy4B8c0CbmeQbgyaDxZGeV/dF/9xDumTqztp9U0jV03flzuA3MHufu+Nf?= =?us-ascii?Q?g6s0ijD848+jMyfnTB+6vTP+HHvPtOLTJm0sl4222UFqETZMuavcYNh79rGY?= =?us-ascii?Q?dElwcxr1DOOq1/TnsdwP0FNAdc290A7IsAXhPP5vY6qmqx1bSy58uhlknnRL?= =?us-ascii?Q?AVseiu9UYm0dKdieVal1LDWaWba4a4Kp9W6Xtwtye43BbicgzNrTL8D74xPv?= =?us-ascii?Q?KTeXY20924wvnwJsPvNop/PI7THQng+f3VuTNJ5E5bX9kVVOoggXYePj7Bak?= =?us-ascii?Q?ZW8XNB0w20zzGQxNJlusXHr7YCVjo/oxdY6EY3ZZiwYs9azSML/tQHSHG9YM?= =?us-ascii?Q?p7HD31RAk2n/igzDh3miSaaDLEhqo5k4EX5fTg2TKCQdB8PEv0hrScRVbyB8?= =?us-ascii?Q?pR6J03M4Uph9lGCLTiOm64LM8DANI40w6kH2mV0w98zKm/VzCI0HxgW7HaZT?= =?us-ascii?Q?T9n5XZ5w9V097jXDq2J4QUnl1i27ukxBvKXwuzil59vJQLxATEl1I0kayCBl?= =?us-ascii?Q?aGcK9J7KUaNM+LlrRSv93WWRqbg2UflRCHaW16cUJveAFu7Cq6N7I/vdhsj7?= =?us-ascii?Q?smQLc9CrL+txnoXJ1uYcu3dHrkBsFBjM9yZpbYoycH0wvHveLyyjNUkxX5V9?= =?us-ascii?Q?tsVVxKDxbi8cvm1ZyzzNjBz0PCldtb8vhdT?= X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB1880; 5:svqUYUK8wmC1l98kD4tHlq9+awZSmjq9ED2JjO8mGIif8i2jam6iof2yxX6AS+ZGEzGsIV3Y6i4cmWgKBNatC3Ky7PS1gNRPfbIIdgQpvbbMqmLXhxLrJFUn4VjWjpyXyPtInc2qEEBSY4f8VDKCwI3GO7sKsWpT+j0etq4u2BM=; 24:Rg+tupyfJieRNpK/lsIZQPtNAK3CtxAiU1efd0Q/vktHAidzbjBP3xBGIC5ehwlATDNxWk89DDSnynWmPojIowLBO36NoJCLF0UqQX9Pfzg=; 7:lJOsIlSmdu4QvPpQK+6USLC4PiGCURwamkimgClpXyYjRsvZDJDOhwicoX9kV1QHH6L8RTtUzvzP4tP63P/P0lx3F7pLbFfWKDcbMFy/LEk76EA0QWsMRkOK+9PBO3RmWHziRt0b1q7SfaushzPHz9RmKPNBHpdcSXG6E5cWUilCvM9rgJCcQ45QMYIiKgj/ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Aug 2016 13:58:31.3264 (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: BY2PR03MB1880 Subject: [dpdk-dev] [PATCH v8 25/25] 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: Fri, 26 Aug 2016 13:58:38 -0000 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 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/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 +- 9 files changed, 26 insertions(+), 20 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 11e4014..8d815fd 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 892a221..6d2f027 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/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 2c89530..96f6db4 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); @@ -417,7 +418,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 60a5222..a42d1de 100644 --- a/lib/librte_eal/common/include/rte_pci.h +++ b/lib/librte_eal/common/include/rte_pci.h @@ -149,14 +149,13 @@ 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]; /**< PCI Memory Resource */ 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 d7179e1..d54ec9e 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -3207,7 +3207,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