DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] eal: disable NUMA related warnings on non-NUMA systems
@ 2017-07-13 10:28 Hemant Agrawal
  2017-07-21  6:01 ` Thomas Monjalon
  2017-07-24  9:14 ` [dpdk-dev] [PATCH v2] " Hemant Agrawal
  0 siblings, 2 replies; 7+ messages in thread
From: Hemant Agrawal @ 2017-07-13 10:28 UTC (permalink / raw)
  To: thomas; +Cc: dev

Disabling NUMA warnings on non-NUMA systems.

"EAL: eal_parse_sysfs_value(): cannot open sysfs value
	/sys/bus/pci/devices/0000:00:00.0/numa_node
EAL: numa_node is invalid or not present. Set it 0 as default
EAL: cannot open /proc/self/numa_maps, consider that all memory is
	in socket_id 0"

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 lib/librte_eal/linuxapp/eal/eal_memory.c | 8 ++++----
 lib/librte_eal/linuxapp/eal/eal_pci.c    | 4 ++++
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c
index 040f24a..44e7e4e 100644
--- a/lib/librte_eal/linuxapp/eal/eal_memory.c
+++ b/lib/librte_eal/linuxapp/eal/eal_memory.c
@@ -595,6 +595,7 @@ unmap_all_hugepages_orig(struct hugepage_file *hugepg_tbl, struct hugepage_info
         return 0;
 }
 
+#ifdef RTE_EAL_NUMA_AWARE_HUGEPAGES
 /*
  * Parse /proc/self/numa_maps to get the NUMA socket ID for each huge
  * page.
@@ -662,11 +663,9 @@ find_numasocket(struct hugepage_file *hugepg_tbl, struct hugepage_info *hpi)
 			if (hugepg_tbl[i].orig_va == va) {
 				hugepg_tbl[i].socket_id = socket_id;
 				hp_count++;
-#ifdef RTE_EAL_NUMA_AWARE_HUGEPAGES
 				RTE_LOG(DEBUG, EAL,
 					"Hugepage %s is on socket %d\n",
 					hugepg_tbl[i].filepath, socket_id);
-#endif
 			}
 		}
 	}
@@ -681,6 +680,7 @@ find_numasocket(struct hugepage_file *hugepg_tbl, struct hugepage_info *hpi)
 	fclose(f);
 	return -1;
 }
+#endif
 
 static int
 cmp_physaddr(const void *a, const void *b)
@@ -1160,13 +1160,13 @@ rte_eal_hugepage_init(void)
 				goto fail;
 			}
 		}
-
+#ifdef RTE_EAL_NUMA_AWARE_HUGEPAGES
 		if (find_numasocket(&tmp_hp[hp_offset], hpi) < 0){
 			RTE_LOG(DEBUG, EAL, "Failed to find NUMA socket for %u MB pages\n",
 					(unsigned)(hpi->hugepage_sz / 0x100000));
 			goto fail;
 		}
-
+#endif
 		qsort(&tmp_hp[hp_offset], hpi->num_pages[0],
 		      sizeof(struct hugepage_file), cmp_physaddr);
 
diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c b/lib/librte_eal/linuxapp/eal/eal_pci.c
index 7d9e1a9..688b052 100644
--- a/lib/librte_eal/linuxapp/eal/eal_pci.c
+++ b/lib/librte_eal/linuxapp/eal/eal_pci.c
@@ -310,6 +310,7 @@ pci_scan_one(const char *dirname, const struct rte_pci_addr *addr)
 			dev->max_vfs = (uint16_t)tmp;
 	}
 
+#ifdef RTE_EAL_NUMA_AWARE_HUGEPAGES
 	/* get numa node, default to 0 if not present */
 	snprintf(filename, sizeof(filename), "%s/numa_node",
 		 dirname);
@@ -323,6 +324,9 @@ pci_scan_one(const char *dirname, const struct rte_pci_addr *addr)
 			"Set it 0 as default\n");
 		dev->device.numa_node = 0;
 	}
+#else
+	dev->device.numa_node = 0;
+#endif
 
 	rte_pci_device_name(addr, dev->name, sizeof(dev->name));
 	dev->device.name = dev->name;
-- 
2.7.4

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dpdk-dev] [PATCH] eal: disable NUMA related warnings on non-NUMA systems
  2017-07-13 10:28 [dpdk-dev] [PATCH] eal: disable NUMA related warnings on non-NUMA systems Hemant Agrawal
@ 2017-07-21  6:01 ` Thomas Monjalon
  2017-07-21 12:14   ` Hemant Agrawal
  2017-07-24  9:14 ` [dpdk-dev] [PATCH v2] " Hemant Agrawal
  1 sibling, 1 reply; 7+ messages in thread
From: Thomas Monjalon @ 2017-07-21  6:01 UTC (permalink / raw)
  To: Hemant Agrawal; +Cc: dev

13/07/2017 13:28, Hemant Agrawal:
> Disabling NUMA warnings on non-NUMA systems.
> 
> "EAL: eal_parse_sysfs_value(): cannot open sysfs value
> 	/sys/bus/pci/devices/0000:00:00.0/numa_node
> EAL: numa_node is invalid or not present. Set it 0 as default
> EAL: cannot open /proc/self/numa_maps, consider that all memory is
> 	in socket_id 0"
> 
> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>

If I understand well, you are disabling every warnings when DPDK
is compiled without libnuma.
I think we should keep one warning in case libnuma is not available
but it is running on a NUMA system.

What about adding this kind of sysfs check?

#ifndef RTE_EAL_NUMA_AWARE_HUGEPAGES
if (sysfs/numa_node is present)
	RTE_LOG(WARN, "Only the first NUMA node will be used\n");
#endif

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dpdk-dev] [PATCH] eal: disable NUMA related warnings on non-NUMA systems
  2017-07-21  6:01 ` Thomas Monjalon
@ 2017-07-21 12:14   ` Hemant Agrawal
  0 siblings, 0 replies; 7+ messages in thread
From: Hemant Agrawal @ 2017-07-21 12:14 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev

On 7/21/2017 11:31 AM, Thomas Monjalon wrote:
> 13/07/2017 13:28, Hemant Agrawal:
>> Disabling NUMA warnings on non-NUMA systems.
>>
>> "EAL: eal_parse_sysfs_value(): cannot open sysfs value
>> 	/sys/bus/pci/devices/0000:00:00.0/numa_node
>> EAL: numa_node is invalid or not present. Set it 0 as default
>> EAL: cannot open /proc/self/numa_maps, consider that all memory is
>> 	in socket_id 0"
>>
>> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
>
> If I understand well, you are disabling every warnings when DPDK
> is compiled without libnuma.
> I think we should keep one warning in case libnuma is not available
> but it is running on a NUMA system.
>
> What about adding this kind of sysfs check?
>
> #ifndef RTE_EAL_NUMA_AWARE_HUGEPAGES
> if (sysfs/numa_node is present)
> 	RTE_LOG(WARN, "Only the first NUMA node will be used\n");
> #endif
>
Good suggestion. I will rework the patch.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [dpdk-dev] [PATCH v2] eal: disable NUMA related warnings on non-NUMA systems
  2017-07-13 10:28 [dpdk-dev] [PATCH] eal: disable NUMA related warnings on non-NUMA systems Hemant Agrawal
  2017-07-21  6:01 ` Thomas Monjalon
@ 2017-07-24  9:14 ` Hemant Agrawal
  2017-07-24  9:20   ` [dpdk-dev] [PATCH v3] " Hemant Agrawal
  1 sibling, 1 reply; 7+ messages in thread
From: Hemant Agrawal @ 2017-07-24  9:14 UTC (permalink / raw)
  To: thomas; +Cc: dev

Disable multiple NUMA warnings on non-NUMA systems.

"EAL: eal_parse_sysfs_value(): cannot open sysfs value
	/sys/bus/pci/devices/0000:00:00.0/numa_node
EAL: numa_node is invalid or not present. Set it 0 as default
EAL: cannot open /proc/self/numa_maps, consider that all memory is
	in socket_id 0"

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 lib/librte_eal/linuxapp/eal/eal_memory.c |  4 ++--
 lib/librte_eal/linuxapp/eal/eal_pci.c    | 12 ++++++++----
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c
index daead31..5279128 100644
--- a/lib/librte_eal/linuxapp/eal/eal_memory.c
+++ b/lib/librte_eal/linuxapp/eal/eal_memory.c
@@ -610,8 +610,8 @@ find_numasocket(struct hugepage_file *hugepg_tbl, struct hugepage_info *hpi)
 
 	f = fopen("/proc/self/numa_maps", "r");
 	if (f == NULL) {
-		RTE_LOG(NOTICE, EAL, "cannot open /proc/self/numa_maps,"
-				" consider that all memory is in socket_id 0\n");
+		RTE_LOG(NOTICE, EAL, "NUMA support not available"
+			" consider that all memory is in socket_id 0\n");
 		return 0;
 	}
 
diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c b/lib/librte_eal/linuxapp/eal/eal_pci.c
index 2041d5f..1d664af 100644
--- a/lib/librte_eal/linuxapp/eal/eal_pci.c
+++ b/lib/librte_eal/linuxapp/eal/eal_pci.c
@@ -314,10 +314,14 @@ pci_scan_one(const char *dirname, const struct rte_pci_addr *addr)
 	snprintf(filename, sizeof(filename), "%s/numa_node",
 		 dirname);
 
-	if (eal_parse_sysfs_value(filename, &tmp) == 0)
-		dev->device.numa_node = tmp;
-	else
-		dev->device.numa_node = -1;
+	if (access(filename, F_OK ) != -1 ) {
+		if (eal_parse_sysfs_value(filename, &tmp) == 0)
+			dev->device.numa_node = tmp;
+		else
+			dev->device.numa_node = -1;
+	} else {
+		dev->device.numa_node = 0;
+	}
 
 	pci_name_set(dev);
 
-- 
2.7.4

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [dpdk-dev] [PATCH v3] eal: disable NUMA related warnings on non-NUMA systems
  2017-07-24  9:14 ` [dpdk-dev] [PATCH v2] " Hemant Agrawal
@ 2017-07-24  9:20   ` Hemant Agrawal
  2017-07-24  9:45     ` Jerin Jacob
  0 siblings, 1 reply; 7+ messages in thread
From: Hemant Agrawal @ 2017-07-24  9:20 UTC (permalink / raw)
  To: thomas; +Cc: dev

Disable multiple NUMA warnings on non-NUMA systems.

"EAL: eal_parse_sysfs_value(): cannot open sysfs value
	/sys/bus/pci/devices/0000:00:00.0/numa_node
EAL: numa_node is invalid or not present. Set it 0 as default
EAL: cannot open /proc/self/numa_maps, consider that all memory is
	in socket_id 0"

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
v3: fix checkpatch error
v2: convert check to run time for NUMA systems

 lib/librte_eal/linuxapp/eal/eal_memory.c |  4 ++--
 lib/librte_eal/linuxapp/eal/eal_pci.c    | 12 ++++++++----
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c
index daead31..5279128 100644
--- a/lib/librte_eal/linuxapp/eal/eal_memory.c
+++ b/lib/librte_eal/linuxapp/eal/eal_memory.c
@@ -610,8 +610,8 @@ find_numasocket(struct hugepage_file *hugepg_tbl, struct hugepage_info *hpi)
 
 	f = fopen("/proc/self/numa_maps", "r");
 	if (f == NULL) {
-		RTE_LOG(NOTICE, EAL, "cannot open /proc/self/numa_maps,"
-				" consider that all memory is in socket_id 0\n");
+		RTE_LOG(NOTICE, EAL, "NUMA support not available"
+			" consider that all memory is in socket_id 0\n");
 		return 0;
 	}
 
diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c b/lib/librte_eal/linuxapp/eal/eal_pci.c
index 2041d5f..8951ce7 100644
--- a/lib/librte_eal/linuxapp/eal/eal_pci.c
+++ b/lib/librte_eal/linuxapp/eal/eal_pci.c
@@ -314,10 +314,14 @@ pci_scan_one(const char *dirname, const struct rte_pci_addr *addr)
 	snprintf(filename, sizeof(filename), "%s/numa_node",
 		 dirname);
 
-	if (eal_parse_sysfs_value(filename, &tmp) == 0)
-		dev->device.numa_node = tmp;
-	else
-		dev->device.numa_node = -1;
+	if (access(filename, F_OK) != -1) {
+		if (eal_parse_sysfs_value(filename, &tmp) == 0)
+			dev->device.numa_node = tmp;
+		else
+			dev->device.numa_node = -1;
+	} else {
+		dev->device.numa_node = 0;
+	}
 
 	pci_name_set(dev);
 
-- 
2.7.4

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dpdk-dev] [PATCH v3] eal: disable NUMA related warnings on non-NUMA systems
  2017-07-24  9:20   ` [dpdk-dev] [PATCH v3] " Hemant Agrawal
@ 2017-07-24  9:45     ` Jerin Jacob
  2017-07-30 21:29       ` Thomas Monjalon
  0 siblings, 1 reply; 7+ messages in thread
From: Jerin Jacob @ 2017-07-24  9:45 UTC (permalink / raw)
  To: Hemant Agrawal; +Cc: thomas, dev

-----Original Message-----
> Date: Mon, 24 Jul 2017 14:50:27 +0530
> From: Hemant Agrawal <hemant.agrawal@nxp.com>
> To: thomas@monjalon.net
> CC: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH v3] eal: disable NUMA related warnings on
>  non-NUMA systems
> X-Mailer: git-send-email 2.7.4
> 
> Disable multiple NUMA warnings on non-NUMA systems.
> 
> "EAL: eal_parse_sysfs_value(): cannot open sysfs value
> 	/sys/bus/pci/devices/0000:00:00.0/numa_node
> EAL: numa_node is invalid or not present. Set it 0 as default
> EAL: cannot open /proc/self/numa_maps, consider that all memory is
> 	in socket_id 0"
> 
> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>

Tested-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dpdk-dev] [PATCH v3] eal: disable NUMA related warnings on non-NUMA systems
  2017-07-24  9:45     ` Jerin Jacob
@ 2017-07-30 21:29       ` Thomas Monjalon
  0 siblings, 0 replies; 7+ messages in thread
From: Thomas Monjalon @ 2017-07-30 21:29 UTC (permalink / raw)
  To: Hemant Agrawal; +Cc: dev, Jerin Jacob

> > Disable multiple NUMA warnings on non-NUMA systems.
> > 
> > "EAL: eal_parse_sysfs_value(): cannot open sysfs value
> > 	/sys/bus/pci/devices/0000:00:00.0/numa_node
> > EAL: numa_node is invalid or not present. Set it 0 as default
> > EAL: cannot open /proc/self/numa_maps, consider that all memory is
> > 	in socket_id 0"
> > 
> > Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
> 
> Tested-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>

Applied, thanks

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-07-30 21:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-13 10:28 [dpdk-dev] [PATCH] eal: disable NUMA related warnings on non-NUMA systems Hemant Agrawal
2017-07-21  6:01 ` Thomas Monjalon
2017-07-21 12:14   ` Hemant Agrawal
2017-07-24  9:14 ` [dpdk-dev] [PATCH v2] " Hemant Agrawal
2017-07-24  9:20   ` [dpdk-dev] [PATCH v3] " Hemant Agrawal
2017-07-24  9:45     ` Jerin Jacob
2017-07-30 21:29       ` Thomas Monjalon

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).