From: Jan Viktorin <viktorin@rehivetech.com>
To: dev@dpdk.org
Cc: Jan Viktorin <viktorin@rehivetech.com>
Subject: [dpdk-dev] [RFC 4/6] eal: move numa_node from rte_pci_device to rte_device
Date: Mon, 18 Jan 2016 17:03:05 +0100 [thread overview]
Message-ID: <1453132987-20564-5-git-send-email-viktorin@rehivetech.com> (raw)
In-Reply-To: <1453132987-20564-1-git-send-email-viktorin@rehivetech.com>
Signed-off-by: Jan Viktorin <viktorin@rehivetech.com>
---
app/test/virtual_pmd.c | 2 +-
lib/librte_eal/bsdapp/eal/eal_pci.c | 2 +-
lib/librte_eal/common/eal_common_pci.c | 4 ++--
lib/librte_eal/common/include/rte_dev.h | 1 +
lib/librte_eal/common/include/rte_pci.h | 1 -
lib/librte_eal/linuxapp/eal/eal_pci.c | 4 ++--
lib/librte_ether/rte_ethdev.c | 2 +-
7 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/app/test/virtual_pmd.c b/app/test/virtual_pmd.c
index a538c8a..0fe957f 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->dev.numa_node = socket_id;
pci_drv->name = virtual_ethdev_driver_name;
pci_drv->id_table = id_table;
diff --git a/lib/librte_eal/bsdapp/eal/eal_pci.c b/lib/librte_eal/bsdapp/eal/eal_pci.c
index 6c21fbd..07fd6c8 100644
--- a/lib/librte_eal/bsdapp/eal/eal_pci.c
+++ b/lib/librte_eal/bsdapp/eal/eal_pci.c
@@ -277,7 +277,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->dev.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 60501a5..4ac180d 100644
--- a/lib/librte_eal/common/eal_common_pci.c
+++ b/lib/librte_eal/common/eal_common_pci.c
@@ -167,7 +167,7 @@ rte_eal_pci_probe_one_driver(struct rte_pci_driver *dr, struct rte_pci_device *d
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);
+ dev->dev.numa_node);
RTE_LOG(DEBUG, EAL, " probe driver: %x:%x %s\n", dev->id.vendor_id,
dev->id.device_id, dr->name);
@@ -241,7 +241,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->dev.numa_node);
RTE_LOG(DEBUG, EAL, " remove driver: %x:%x %s\n", dev->id.vendor_id,
dev->id.device_id, dr->name);
diff --git a/lib/librte_eal/common/include/rte_dev.h b/lib/librte_eal/common/include/rte_dev.h
index 1ab47f9..593ceb3 100644
--- a/lib/librte_eal/common/include/rte_dev.h
+++ b/lib/librte_eal/common/include/rte_dev.h
@@ -161,6 +161,7 @@ struct rte_devargs;
struct rte_bus_device {
const char *name;
struct rte_devargs *devargs;
+ int numa_node;
};
/**
diff --git a/lib/librte_eal/common/include/rte_pci.h b/lib/librte_eal/common/include/rte_pci.h
index b894913..5566e3d 100644
--- a/lib/librte_eal/common/include/rte_pci.h
+++ b/lib/librte_eal/common/include/rte_pci.h
@@ -164,7 +164,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 */
enum rte_kernel_driver kdrv; /**< Kernel driver passthrough */
struct rte_bus_device dev; /**< Generic device */
};
diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c b/lib/librte_eal/linuxapp/eal/eal_pci.c
index bc5b5be..c87dd37 100644
--- a/lib/librte_eal/linuxapp/eal/eal_pci.c
+++ b/lib/librte_eal/linuxapp/eal/eal_pci.c
@@ -326,13 +326,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->dev.numa_node = 0;
} else {
if (eal_parse_sysfs_value(filename, &tmp) < 0) {
free(dev);
return -1;
}
- dev->numa_node = tmp;
+ dev->dev.numa_node = tmp;
}
/* parse resources */
diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index ed971b4..908997a 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -3236,6 +3236,6 @@ 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->dev.numa_node;
eth_dev->data->drv_name = pci_dev->driver->name;
}
--
2.7.0
next prev parent reply other threads:[~2016-01-18 16:05 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-18 16:03 [dpdk-dev] [RFC 0/6] Preview of a big eal/ethdev cleanup Jan Viktorin
2016-01-18 16:03 ` [dpdk-dev] [RFC 1/6] eal: introduce rte_bus_device and rte_bus_driver Jan Viktorin
2016-01-18 16:03 ` [dpdk-dev] [RFC 2/6] eal: define macro container_of Jan Viktorin
2016-01-18 16:03 ` [dpdk-dev] [RFC 3/6] eal: move devargs from rte_pci_device to rte_device Jan Viktorin
2016-01-18 16:03 ` Jan Viktorin [this message]
2016-01-18 16:03 ` [dpdk-dev] [RFC 5/6] eal: move intr_handle " Jan Viktorin
2016-01-18 16:03 ` [dpdk-dev] [RFC 6/6] eal: move driver pointer from rte_pci_device to rte_bus_device Jan Viktorin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1453132987-20564-5-git-send-email-viktorin@rehivetech.com \
--to=viktorin@rehivetech.com \
--cc=dev@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).