[openib-general] [PATCH] sysfs display for local_link_integrity_errors broken

Ralph Campbell ralphc at pathscale.com
Wed May 3 14:30:10 PDT 2006


The code to display local_link_integrity_errors and
excessive_buffer_overrun_errors in
/sys/class/infiniband/<hca>/ports/<n>/counters/
had a bug extracting the 4 bit values.

Signed-off-by: Ralph Campbell <ralph.campbell at qlogic.com>

Index: src/linux-kernel/infiniband/core/sysfs.c
===================================================================
--- src/linux-kernel/infiniband/core/sysfs.c	(revision 6885)
+++ src/linux-kernel/infiniband/core/sysfs.c	(working copy)
@@ -336,7 +336,7 @@
 	switch (width) {
 	case 4:
 		ret = sprintf(buf, "%u\n", (out_mad->data[40 + offset / 8] >>
-					    (offset % 4)) & 0xf);
+					    (4 - (offset % 8))) & 0xf);
 		break;
 	case 8:
 		ret = sprintf(buf, "%u\n", out_mad->data[40 + offset / 8]);

-- 
Ralph Campbell <ralphc at pathscale.com>




More information about the general mailing list