From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0050.outbound.protection.outlook.com [104.47.36.50]) by dpdk.org (Postfix) with ESMTP id 10E3758EC for ; Fri, 16 Sep 2016 06:33:18 +0200 (CEST) Received: from BN3PR0301CA0073.namprd03.prod.outlook.com (10.160.152.169) by BLUPR0301MB2003.namprd03.prod.outlook.com (10.164.22.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.619.10; Fri, 16 Sep 2016 04:33:16 +0000 Received: from BL2FFO11FD053.protection.gbl (2a01:111:f400:7c09::193) by BN3PR0301CA0073.outlook.office365.com (2a01:111:e400:401e::41) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.629.8 via Frontend Transport; Fri, 16 Sep 2016 04:33:17 +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 BL2FFO11FD053.mail.protection.outlook.com (10.173.161.181) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.619.6 via Frontend Transport; Fri, 16 Sep 2016 04:33:16 +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 u8G4Trg7029256; Thu, 15 Sep 2016 21:33:13 -0700 From: Shreyansh Jain To: CC: , David Marchand , , Thomas Monjalon , Shreyansh Jain Date: Fri, 16 Sep 2016 10:00:00 +0530 Message-ID: <1474000200-16705-26-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1474000200-16705-1-git-send-email-shreyansh.jain@nxp.com> References: <1466510566-9240-1-git-send-email-shreyansh.jain@nxp.com> <1474000200-16705-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131184739964934601; (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)(199003)(189002)(85426001)(19580405001)(68736007)(19580395003)(586003)(5660300001)(97736004)(626004)(48376002)(50466002)(575784001)(305945005)(356003)(8666005)(87936001)(36756003)(47776003)(110136003)(86362001)(77096005)(81156014)(76176999)(81166006)(4326007)(2950100001)(189998001)(2351001)(229853001)(8936002)(7846002)(50986999)(104016004)(8676002)(50226002)(105606002)(106466001)(2906002)(92566002)(33646002)(5003940100001)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0301MB2003; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD053; 1:ibVEkEyD/k7CcN5mnHBK7Zrswlil1J78UdwZvOCx23eyUUxyMpAgz+HZZ5UNycBirGb//ImDTt7udzLzsJwWamB0//SnEvtUr83roLv2wrvmcuHX6wDNIEgSLzzlJfMN2Xvpca2JtfWZo6XJ/KvAD8CM8WmBbxJ15BlszwVMFWj8OfyAw4onWs1tOkXJ96eM2QgchCI1svhafhMPewEdxzj8dnqw0WENk+68pderOTjU2WoyGZ2xCmrLYlhREPg9I7yTCRJ9VYEA7sR7dnBepUDhB5GiRmqTENRpJ2H7+8u23RrTEtZ3A5YMJPPBqWTBnaumRDYMlpkC/ZE3CWGdoylkRyzZ5OeJDQK/WCD4jnqsNqIf2lbgI/wZhQgvtb2pm7Xg13aGLskA4+JQTuvLycUEG09uZFaEZWgURzr1a+kWedoaJv79uLvV7aO0ZCnfenR5h+2DjTEaoTwW5u7NXkemZEXusqahTK5ayqSZMFI+yblysJxDU6KaZRctGLs/9Ibv88T6TgQMAyHtoZz5vT8ZFPxHiQ35loiaFlm5npzqhmO26FP7R2h0GMV91yALvpJ85pxq2RONfrPj38Amc70+zTJNgWXUKa1FNcTt4HR43sV7NJkyru6JFhlq9hRr9J5tqwgEk9shG7TJnmloOquHstDCpobrTKq+hcOtoww7wytn8aFQrwHfczpim6G9J/i1ev246i6cgBW6wVsRxbK/G8b5LQbIoue/J5dCGN0= MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: c852d59e-0965-4f62-d9c9-08d3ddea9406 X-Microsoft-Exchange-Diagnostics: 1; BLUPR0301MB2003; 2:CwHu5aa5HaA1l4gHpoWSM76CL9Up7Zj1HEwo+rjko4zlRxWHWb3EVSB5uSu2OusvbJO2U4vzxNrb88ZmEwTXZbWxCJm4VGW5EYBqmjvy6ZSRKun3kYUN2okgvApcW+PmINCPAlOsiGvLUfH7B+IZ+B91yqA5OajEEx0tuNrMXF5VKslJJT9f0ATUWORHznqF; 3:DMAlUm5UeaGb2lSD9J+ZbnYJuPZEeqkbaaU8NTAlKlGFghRFvYoKw5ho70wlpPAO3PQwuMVUgYqz91Wlqkxljfp0OHbZ10JxeqPwRQCgGKoGVgxA10CHvM71D7fRj8tUng0/1az+eWhwQmaMJdq10JtdmqAj/8DGsGWIiS8G9nZCImkr9zoXp1HV3yq3WKUD0GwksQrhmD2N+gN+wjs5j1Bckwd7S1YHvap+OrD7Zzg=; 25:UbO7F99LFrFFk9H029BAC4C0AFBSB8FBYp1s1YNuo1xH1NIYl0+zxhvH9cSwcO5vMn+5b54QQtFVMPQstPZa0kIvXFz8j6DxWnKJ5MQKaZ7dRYL9wKhbxZvk2we0QNY/afs9xf457HEv8pgaxpKtQa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xyG6v9OnHBcfbtYBKynokD0QzH8GqBxmuvfagH1TiaPzz8RgCLnI8NXS6TN7WOrlJ6VNocj8uRvclWNX0prmzWNJ7G0xGJTDrv4cIRc= 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)(13023025)(13015025)(13017025)(5005006)(8121501046)(3002001)(10201501046)(6055026); SRVR:BLUPR0301MB2003; BCL:0; PCL:0; RULEID:(400006); SRVR:BLUPR0301MB2003; X-Forefront-PRVS: 0067A8BA2A X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0301MB2003; 23:pFmOdALcONwqASUFjrQMB5Hg3usQNMXO72LB/HF?= =?us-ascii?Q?LYIn015dwSh/qTOyNbBnz6kdltzInky5vbTHBjLlubXDtwfufAl2l23NtqGf?= =?us-ascii?Q?vq3p3KoT3Z/APNXzHGQCfi8TzdaJKVOA+K2S2aKFkf6qer8h5YqH0d5gIjuM?= =?us-ascii?Q?LHkXrdHKipBFlY+ZzQ23lDxCKxw/kOPTjPO7jwbGb5G5pSaLMoCbmwX3sVpO?= =?us-ascii?Q?+CB6nQaxBo1u/uSuMD2N1TmgD5yAizkG1+WjU8LEy0RRPxpUIXXDJej9fNJt?= =?us-ascii?Q?NjuWf98M4IcM3Cv4WTeMIQt0lD+KniAU4/Emo4ZdCdNBjrq0905AQNzpdWiI?= =?us-ascii?Q?GaMOwNyaD+EHHgLrwLx9sCiQ9yKdauujGGfiQbhV/9tp4wC8sY7W/BW7Q7iA?= =?us-ascii?Q?q7PgfcWOJPwJJTU9XUzEKgVrjuBG/deAYty5HVPUYgyjpSzU1ZMcI4Q81vvQ?= =?us-ascii?Q?FBnDfNJIw1IC6+NFmTenuj3S04wHvxdkOS8b27JCAYLgYQM5ZljI1taERwJz?= =?us-ascii?Q?+yPt/+GIWpTaCvYZ7MCVbwOQRrnnZwJN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QKbEiE/4LuP6oJECTOeUyKgjW676lHGYo5IYSJ2LfcStej0S0m/smU62STn+ok=; 5:WEdKlnz/wVJ0lOgypNPhL/QryAIhomsIu5xnE3QjAlQcKsbZkzE3cUm7OTNvWt+UlAKqtuFASRqd5c6wqltqBUg5wM+eFn1/O2dWN+9qn/vAHJ1qqF2uR0noJ0no8EeOYRiqgJwX3pQx9RbWMGAdw4NjkXteiylDEiD/sq0Bddo=; 24:n6d4DaL9wnvYXmR3wTwC60AxwwYT7xk4LUFVTe9DIRtzaebEvmp93qB1lVT1u7t8QlHnhOe+W3MBlnUMJg50AuO6XKF5Cq78bCdAC7I3/Aw=; 7:f5+k4YvQF0OnDGYa5XN7+fFSrNQaCfxKWkWavNRYVZGbGqIBtw9QdTMgtrBz0qu4j8fNAlsbtYEMkygov97wRSn0vq/4tBOVWCPiBKK8tMeHRNQPjKJ01GoWJeTFlcWDndRl06qnp6navHFdMZM6LGDTTQMH/AT4xs8Awvl4YimDMR7KdtZtSdGFIp6CK2vV145VfDvEP5lUa+ysFAcNz2fGGxy1c2UcvNAb8CVUjHzzcnZgSxTZkBkXzNVa4KDc SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Sep 2016 04:33:16.3218 (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: BLUPR0301MB2003 Subject: [dpdk-dev] [PATCH v10 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, 16 Sep 2016 04:33:18 -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 c6b5acd..645b8cd 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 4dfc92a..e8cf909 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 063f1d0..68bdc46 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 3b9917e..fd0fcc5 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -3210,7 +3210,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