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

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