From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0061.outbound.protection.outlook.com [104.47.41.61]) by dpdk.org (Postfix) with ESMTP id 4BA1E9248 for ; Wed, 7 Sep 2016 16:10:32 +0200 (CEST) Received: from BN3PR0301CA0003.namprd03.prod.outlook.com (10.160.180.141) by MWHPR03MB2445.namprd03.prod.outlook.com (10.169.200.139) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.609.9; Wed, 7 Sep 2016 14:10:30 +0000 Received: from BY2FFO11FD044.protection.gbl (2a01:111:f400:7c0c::190) by BN3PR0301CA0003.outlook.office365.com (2a01:111:e400:4000::13) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.609.9 via Frontend Transport; Wed, 7 Sep 2016 14:10:30 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; rehivetech.com; dkim=none (message not signed) header.d=none;rehivetech.com; dmarc=fail action=none header.from=nxp.com; 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 BY2FFO11FD044.mail.protection.outlook.com (10.1.14.229) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.587.6 via Frontend Transport; Wed, 7 Sep 2016 14:10:29 +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 u87E8BDA013556; Wed, 7 Sep 2016 07:10:27 -0700 From: Shreyansh Jain To: CC: , Shreyansh Jain , "Jan Viktorin" Date: Wed, 7 Sep 2016 19:38:17 +0530 Message-ID: <1473257297-7221-26-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1473257297-7221-1-git-send-email-shreyansh.jain@nxp.com> References: <1466510566-9240-1-git-send-email-shreyansh.jain@nxp.com> <1473257297-7221-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131177310299754466; (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)(105606002)(92566002)(106466001)(626004)(86362001)(50466002)(4326007)(305945005)(2906002)(81166006)(8676002)(48376002)(81156014)(5660300001)(2351001)(50986999)(8936002)(50226002)(97736004)(76176999)(47776003)(36756003)(104016004)(189998001)(229853001)(2950100001)(110136002)(11100500001)(77096005)(586003)(33646002)(7846002)(356003)(87936001)(8666005)(5003940100001)(68736007)(19580395003)(19580405001)(85426001)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR03MB2445; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD044; 1:Gxtn2vUOD6jM01PSekJuxAAtp573BiyOfdOIDlSDgi9TBfvUyDoF3dVK4EqriZrVCv/t344Y7LhhpQdmDL+Pj/aM7IHi0UZMGAyLS+7yCBpXQiAPFl5Pqwlmb1TXHmYs+ISHB4mJ4wejTfFtVO0PyqyBgtUBNLUh09eT4dyvo/wCEpqfo3o+8FAYG/C0c6ew25lT9hlV9+S3MI3zFm6fdT2apd5EDCg5D0SwHSgijOyGsP0qWKHHJwmACJ2SWT1dyjZZi4QhgNN8PfchyXYnnD/QKDtBMsd37tevo6C8S9I7iTzqnudz+dwE7pX518LEgLlGRiGW5OziengH+gqdRc/RPaOMPB6nhEjdLvilCqUUg7+tly1/XuDWI62YufbAz/8Qp1ukXOx5oKMI/5PbWSh4Pe8397hgOvOe5AW9IgJqNT3SfdfG8Jh/x56kC35B9/2dCQ+V1dge2x2Mv9w+rDlVofpSP5TuBIn0sPTyOEjdBUW0tQQjTV9433tcvlrEqcFJsEX/osMAS50m1hX4cbHvxM+/Oapv5USvxDG3hxdNzJVRklulbZs/FJPiIZKMqYXUPq1uOZ5i3IqKkE4x0i987lqYOZF3e3kcXf3XeFG/OSBKz1ABdvtd1617d6pZ MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 33f0e792-58e0-4312-0fe2-08d3d728b979 X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2445; 2:k86/0YLR9D7PqtPcBoj9si4VWhqdxwa3n8RjTfms8Imd2Iom59uS23fO4+WYo0PuZyKtd5Iew6tCVjFkocTJo8s6XLoLCIsf6UL6xD3jxLqPwT/TWISRXw2Q3D4Fdwj1ciVuWnjh4GctP79N3TQwEble+/iYKD/+ZLCNui7DjpB2MxKGmOZ1NLPTNv5aZU8L; 3:w+ETLzuM9Mt+tNX9T+ZIRtt1ZStejX5xn9ltMVySnZXFaP+8NcxIzsZisPE8/CfxYBMDKuqm1ZDN62XiA0QO01Ivz1IxJHV0VB86MdCIp3JlrpO2/K+ZS/1zZHn3jm7/7YcrXZvELzRmmno24PvzhqdImq5wrfmRtCgG4tfH+x44YDLsGvzHtpfWytaEh6wVY2t7MasqNtFoEHfOn8POiXT2OnAmCq+yqmGSkZpojIM= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:MWHPR03MB2445; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2445; 25:wsE35Gyhm0R6ho2RLgFqz+PuMl80cvUX8OCKku9VzOETw+SKVuAa09UraZpE664B71OZD5mmye+7BhuWpbRW0HJ6pDVAqhCZq5CTTdFBxyfzaFCOF99bRwGwVDorwOsGY/c/+j8Cnvm+BTff8HAwo2IFlEuoo5AJ66BtQfzFs4lV8pAgnvS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wuZL+jR7PjwZm4K1FuGsHRpPkTeeYTAEabyPfUq+QK4XL0i1krRfVaO8ObqGok7yxC/rxkblXNQUMAaDNqZ2fghNTKH/dRU930zWSjzes09Ch6a9bypvZD0lLC7IBczl/0gissSbeNt5xVDRtRH4k/un3/ZnX1Fgl2tsxwYu2O/xYXMRdIaWJtsSCRwOTyad7PHSm8LB6xC5fTu5SD/Wr4qKTRHZj7LOq1B9a2nBqvEMYhRl2zh2jSnfUB2ua2cLs0MVgC565j+aQybSSD+9YmzqJrIu5wamOJGsDXB8uNL5E2rkQWDqyCcKv6XOtfRHKso5j9A= 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)(13017025)(13023025)(13024025)(13018025)(8121501046)(5005006)(3002001)(10201501046)(6055026); SRVR:MWHPR03MB2445; BCL:0; PCL:0; RULEID:(400006); SRVR:MWHPR03MB2445; X-Forefront-PRVS: 0058ABBBC7 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR03MB2445; 23:cIVWdksNHszmS41RUURFtjXHh565tDsVtlw05qPJt?= =?us-ascii?Q?romiogU+VsPeps4HtszKbtfvC/Bf5UggSHOkOhJNgVs5GWujO5BbEc880MiM?= =?us-ascii?Q?JaPrv0grnyTkMLSCB6wdI/ucT01XKqx7LBIW6v7qKycSZHdPv6k6A944C4Pi?= =?us-ascii?Q?rMhKckNhUGKlhdfOUXD5PDKhLnvL1YQbIZ6V52ZQ/SmWA1GKMo0s9z7d+QBY?= =?us-ascii?Q?g9VLHCilKd9cgCBcnf7dcgE9NGkqdwldlC5Cg4kG14kpemVhKrkfYxneNbZ/?= =?us-ascii?Q?FQRs7NKQrDPtHOCZV1qcvr+QOMkqfL8KBRv/dmnqSKbCKVRTXaOxqYXm6GBM?= =?us-ascii?Q?Alw6ErYc2R2a1wJ9gdAwqo176CV960HWnKH5HgzKt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RS38tOva3yH++1Esnp+ljttor3VSnHKLGUx71paehOLRvcHbfxA/buW7nMauhnVPE0XzZ+AFai8im445P3Q+CrBeARZRTu4KDCEitmmtT6VywsKpNp1mnnCHVE9K9po4GEDaoY3h+m1TNG47F7ynqRR7W0uLK3PfafmzKB0ZERq89XTlGVbgdJFVAxuiU7qi5lnSWNo07B8ohbSJEvQyEaF/cwP/e+iIMAf4DJzgkwUARWXf7lrIqZNIYNFMc4uuARcIxulNS2qbG5IYt4xL2yjRM0A4=; 5:JCo7xkapFADPVPHB2YDZzHajqgMP/7Coc9nkLMYmF4avQOyNG7RLlmyU8X9oFEBqHq/3tkwO8NqSxrCii30jVZC+mVYTUNhF2RRV2AYgmUdAJ2SNdbIHThoZT30v/VYf0c91y9pKUFdwsEGcCz/c03DgUP7rJag/Q0XOvpSjSFQ=; 24:Gfudcv8ZVtRdSfJQj998gGBrl8Hg1O4SOi7xf2yFiOvPLwEeksmNUVktinq16WiH3n5UNUtK11Mu+MP/gJytEAF/9y2zLqhmCHMuSOvC1Ec=; 7:vypcsY+L+0KpI515YU1x+pIHFO8Aa1zTyplbb+BftFhkvnnVN7zMqF7U/y1/wHwolu/qG1NIHFouPTDh4Vy7/z89IaRU3ZnwtZFlpXpT0BGju3F50PaqpkMSfuhSIAvkedsKubDyePkONz2Sq/7KY0GjVF5ztvUglhEXWDRXhAzVDC+NCJtKz/RvB4XHcQ0c+jS6sX+6dnr4YVOuwxi1GjfRvoo+tJeVkxVzFMRH6jZ/oTc29pbdflgWahiO1Pdk SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Sep 2016 14:10:29.7882 (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: MWHPR03MB2445 Subject: [dpdk-dev] [PATCH v9 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: Wed, 07 Sep 2016 14:10:33 -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/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 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/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index 82c11f3..85d6c1d 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -511,7 +511,7 @@ mlx5_pci_devinit(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 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 4d8daf7..56ff6f2 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