aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSlava Shwartsman <slavash@nvidia.com>2026-07-02 15:06:39 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2026-07-06 10:15:02 +0000
commitb125b736eaf7da334b07dead671e48ecad3211b3 (patch)
tree66988352a4cce22f9c6abaea54841f5de2bd02ac
parent759ce9a2b38e1de70c14c81dee7e245bf0bc6b94 (diff)
ibcore: Fix GID sysctl fallback formatting
When a GID table entry is empty or not yet present in the cache, show_port_gid() falls back to printing a zero GID. Use the existing GID_PRINT_FMT/GID_PRINT_ARGS helpers instead of Linux's %pI6 format, which FreeBSD printf treats as a pointer followed by "I6". This makes empty GID sysctl entries consistently report 0000:0000:0000:0000:0000:0000:0000:0000. Tested by: Wafa Hamzah <wafah@nvidia.com> (mlx5_ib) Reviewed by: jhb, kib Sponsored by: NVIDIA Networking Fixes: 6a75471dbcf0 ("OFED: Various changes from Linux 4.19") Differential Revision: https://reviews.freebsd.org/D58042
-rw-r--r--sys/ofed/drivers/infiniband/core/ib_sysfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/ofed/drivers/infiniband/core/ib_sysfs.c b/sys/ofed/drivers/infiniband/core/ib_sysfs.c
index b44d4b1d85f7..b9e8c57ddd67 100644
--- a/sys/ofed/drivers/infiniband/core/ib_sysfs.c
+++ b/sys/ofed/drivers/infiniband/core/ib_sysfs.c
@@ -421,7 +421,7 @@ static ssize_t show_port_gid(struct ib_port *p, struct port_attribute *attr,
* space throwing such error on fail to read gid, return zero
* GID as before. This maintains backward compatibility.
*/
- return sprintf(buf, "%pI6\n", zgid.raw);
+ return sprintf(buf, GID_PRINT_FMT"\n", GID_PRINT_ARGS(zgid.raw));
}
ret = sprintf(buf, GID_PRINT_FMT"\n", GID_PRINT_ARGS(gid_attr->gid.raw));