Skip to contentSkip to conversation

drm/amdkfd: Print unique_id as hex instead of decimal

PATCH In review Kent Russell 2 participants 3 messages Feb 3, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdkfd: Print unique_id as hex instead of decimal

Add a new helper function for printing Topology values to support printing 64-bit hex values. Use this for unique_id to ensure that the unique_id in KFD's topology matches the one in amdgpu's sysfs pool.

---
 drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdkfd/kfd_topology.c +3 -1
index a3fc23873819..4e4f651dcb88 100644
@@ -217,6 +217,8 @@ struct kfd_topology_device *kfd_create_topology_device(
 		sysfs_show_gen_prop(buffer, offs, "%s %u\n", name, value)
 #define sysfs_show_64bit_prop(buffer, offs, name, value) \
 		sysfs_show_gen_prop(buffer, offs, "%s %llu\n", name, value)
+#define sysfs_show_64bit_hex_prop(buffer, offs, name, value) \
+		sysfs_show_gen_prop(buffer, offs, "%s %llx\n", name, value)
 #define sysfs_show_32bit_val(buffer, offs, value) \
 		sysfs_show_gen_prop(buffer, offs, "%u\n", value)
 #define sysfs_show_str_val(buffer, offs, value) \
@@ -497,7 +499,7 @@ static ssize_t node_show(struct kobject *kobj, struct attribute *attr,
 			      dev->node_props.num_sdma_queues_per_engine);
 	sysfs_show_32bit_prop(buffer, offs, "num_cp_queues",
 			      dev->node_props.num_cp_queues);
-	sysfs_show_64bit_prop(buffer, offs, "unique_id",
+	sysfs_show_64bit_hex_prop(buffer, offs, "unique_id",
 			      dev->node_props.unique_id);
 
 	if (dev->gpu) {
Signature · 6 lines
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
maintainer
#1 lore raw

Doesn't this break the ABI?

Am 2021-02-03 um 1:22 p.m. schrieb Kent Russell:

Quoted 23 lines

Add a new helper function for printing Topology values to support printing 64-bit hex values. Use this for unique_id to ensure that the unique_id in KFD's topology matches the one in amdgpu's sysfs pool.

---
 drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdkfd/kfd_topology.c +2 -0
index a3fc23873819..4e4f651dcb88 100644
@@ -217,6 +217,8 @@ struct kfd_topology_device *kfd_create_topology_device(
 		sysfs_show_gen_prop(buffer, offs, "%s %u\n", name, value)
 #define sysfs_show_64bit_prop(buffer, offs, name, value) \
 		sysfs_show_gen_prop(buffer, offs, "%s %llu\n", name, value)
+#define sysfs_show_64bit_hex_prop(buffer, offs, name, value) \
+		sysfs_show_gen_prop(buffer, offs, "%s %llx\n", name, value)
 #define sysfs_show_32bit_val(buffer, offs, value) \
 		sysfs_show_gen_prop(buffer, offs, "%u\n", value)
 #define sysfs_show_str_val(buffer, offs, value) \

drivers/gpu/drm/amd/amdkfd/kfd_topology.c static ssize_t node_show(struct kobject *kobj, struct attribute *attr, · line 505

Quoted 8 lines
drivers/gpu/drm/amd/amdkfd/kfd_topology.c +1 -1
@@ -497,7 +499,7 @@ static ssize_t node_show(struct kobject *kobj, struct attribute *attr,
 			      dev->node_props.num_sdma_queues_per_engine);
 	sysfs_show_32bit_prop(buffer, offs, "num_cp_queues",
 			      dev->node_props.num_cp_queues);
-	sysfs_show_64bit_prop(buffer, offs, "unique_id",
+	sysfs_show_64bit_hex_prop(buffer, offs, "unique_id",
 			      dev->node_props.unique_id);
 
 	if (dev->gpu) {

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#2 lore raw

[AMD Public Use]

Indeed it will. Consider this dropped, as no one was asking for it anyways.

Kent

Quoted 34 lines

-----Original Message-----
From: Kuehling, Felix <[email protected]>
Sent: Wednesday, February 3, 2021 1:38 PM
To: Russell, Kent <[email protected]>; [email protected]
Subject: Re: [PATCH] drm/amdkfd: Print unique_id as hex instead of decimal

Doesn't this break the ABI?

Am 2021-02-03 um 1:22 p.m. schrieb Kent Russell:

Review

Quoted 10 lines

Add a new helper function for printing Topology values to support printing 64-bit hex values. Use this for unique_id to ensure that the unique_id in KFD's topology matches the one in amdgpu's sysfs pool.

---
 drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
(quoted diff) +0 -0

b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c

drivers/gpu/drm/amd/amdkfd/kfd_topology.c static ssize_t node_show(struct kobject *kobj, struct attribute

Quoted 13 lines

index a3fc23873819..4e4f651dcb88 100644

drivers/gpu/drm/amd/amdkfd/kfd_topology.c +2 -0
@@ -217,6 +217,8 @@ struct kfd_topology_device *kfd_create_topology_device(
 		sysfs_show_gen_prop(buffer, offs, "%s %u\n", name, value)
 #define sysfs_show_64bit_prop(buffer, offs, name, value) \
 		sysfs_show_gen_prop(buffer, offs, "%s %llu\n", name, value)
+#define sysfs_show_64bit_hex_prop(buffer, offs, name, value) \
+		sysfs_show_gen_prop(buffer, offs, "%s %llx\n", name, value)
 #define sysfs_show_32bit_val(buffer, offs, value) \
 		sysfs_show_gen_prop(buffer, offs, "%u\n", value)
 #define sysfs_show_str_val(buffer, offs, value) \
@@ -497,7 +499,7 @@ static ssize_t node_show(struct kobject *kobj, struct attribute

*attr,

Quoted 8 lines

drivers/gpu/drm/amd/amdkfd/kfd_topology.c static ssize_t node_show(struct kobject *kobj, struct attribute *attr, · line 505

Quoted 8 lines
drivers/gpu/drm/amd/amdkfd/kfd_topology.c +1 -1
 			      dev->node_props.num_sdma_queues_per_engine);
 	sysfs_show_32bit_prop(buffer, offs, "num_cp_queues",
 			      dev->node_props.num_cp_queues);
-	sysfs_show_64bit_prop(buffer, offs, "unique_id",
+	sysfs_show_64bit_hex_prop(buffer, offs, "unique_id",
 			      dev->node_props.unique_id);
 
 	if (dev->gpu) {

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx