Blame SOURCES/irqbalance-1.7.0-Also-fetch-node-info-for-non-PCI-devices.patch

bee840
From a1f83a563475bd77843c4b44ee44a7d764bc9bba Mon Sep 17 00:00:00 2001
bee840
From: Kairui Song <kasong@redhat.com>
bee840
Date: Thu, 28 Jan 2021 15:24:32 +0800
bee840
Subject: [PATCH] Also fetch node info for non-PCI devices
bee840
bee840
non-PCI devices could also be bind to a certain node. So if failed to
bee840
fetch the info from sysfs, try to get it from /proc/irq/<irq>/node.
bee840
---
bee840
 classify.c | 5 ++++-
bee840
 1 file changed, 4 insertions(+), 1 deletion(-)
bee840
bee840
diff --git a/classify.c b/classify.c
bee840
index df8a89b..92f43cc 100644
bee840
--- a/classify.c
bee840
+++ b/classify.c
bee840
@@ -395,7 +395,10 @@ static struct irq_info *add_one_irq_to_db(const char *devpath, int irq, struct u
bee840
 get_numa_node:
bee840
 	numa_node = -1;
bee840
 	if (numa_avail) {
bee840
-		sprintf(path, "%s/numa_node", devpath);
bee840
+		if (devpath)
bee840
+			sprintf(path, "%s/numa_node", devpath);
bee840
+		else
bee840
+			sprintf(path, "/proc/irq/%i/node", irq);
bee840
 		fd = fopen(path, "r");
bee840
 		if (fd) {
bee840
 			fscanf(fd, "%d", &numa_node);
bee840
-- 
bee840
2.29.2
bee840