public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
* [Patch] [Tools][infiniband-diags]
@ 2010-07-28 11:36 Irena Kruchkovsky
       [not found] ` <E113D394D7C5DB4F8FF691FA7EE9DB443B390460E6-WQlSmcKwN8Te+A/uUDamNg@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Irena Kruchkovsky @ 2010-07-28 11:36 UTC (permalink / raw)
  To: Linux RDMA list, Sasha Khapyorsky, ofw@lists.openfabrics.org


[-- Attachment #1.1: Type: text/plain, Size: 1532 bytes --]

A patch that fixes the GUID output in ibstat to work correctly in windows 2003.

Index: D:/Windows/MLNX_VPI/tools/infiniband-diags/src/ibstat.c
===================================================================
--- D:/Windows/MLNX_VPI/tools/infiniband-diags/src/ibstat.c  (revision 6199)
+++ D:/Windows/MLNX_VPI/tools/infiniband-diags/src/ibstat.c               (revision 6200)
@@ -72,9 +72,9 @@
                printf("\tNumber of ports: %d\n", ca->numports);
                printf("\tFirmware version: %s\n", ca->fw_ver);
                printf("\tHardware version: %s\n", ca->hw_ver);
-              printf("\tNode GUID: 0x%016llx\n",
+             printf("\tNode GUID: 0x%016I64x\n",
                       (long long unsigned)ntohll(ca->node_guid));
-              printf("\tSystem image GUID: 0x%016llx\n",
+             printf("\tSystem image GUID: 0x%016I64x\n",
                       (long long unsigned)ntohll(ca->system_guid));
 }

@@ -122,7 +122,7 @@
                printf("%sLMC: %d\n", pre, port->lmc);
                printf("%sSM lid: %d\n", pre, port->sm_lid);
                printf("%sCapability mask: 0x%08x\n", pre, ntohl(port->capmask));
-              printf("%sPort GUID: 0x%016llx\n", pre,
+             printf("%sPort GUID: 0x%016I64x\n", pre,
                       (long long unsigned)ntohll(port->port_guid));
                return 0;
 }


Example:

Previous output:
System image GUID: 0x000000000003cc13

Current output:
System image GUID: 0x0002c9020003cc13


[-- Attachment #1.2: Type: text/html, Size: 6054 bytes --]

[-- Attachment #2: ibstatGUID.patch --]
[-- Type: application/octet-stream, Size: 1068 bytes --]

Index: D:/Windows/MLNX_VPI/tools/infiniband-diags/src/ibstat.c
===================================================================
--- D:/Windows/MLNX_VPI/tools/infiniband-diags/src/ibstat.c	(revision 6199)
+++ D:/Windows/MLNX_VPI/tools/infiniband-diags/src/ibstat.c	(revision 6200)
@@ -72,9 +72,9 @@
 	printf("\tNumber of ports: %d\n", ca->numports);
 	printf("\tFirmware version: %s\n", ca->fw_ver);
 	printf("\tHardware version: %s\n", ca->hw_ver);
-	printf("\tNode GUID: 0x%016llx\n",
+	printf("\tNode GUID: 0x%016I64x\n",
 	       (long long unsigned)ntohll(ca->node_guid));
-	printf("\tSystem image GUID: 0x%016llx\n",
+	printf("\tSystem image GUID: 0x%016I64x\n",
 	       (long long unsigned)ntohll(ca->system_guid));
 }
 
@@ -122,7 +122,7 @@
 	printf("%sLMC: %d\n", pre, port->lmc);
 	printf("%sSM lid: %d\n", pre, port->sm_lid);
 	printf("%sCapability mask: 0x%08x\n", pre, ntohl(port->capmask));
-	printf("%sPort GUID: 0x%016llx\n", pre,
+	printf("%sPort GUID: 0x%016I64x\n", pre,
 	       (long long unsigned)ntohll(port->port_guid));
 	return 0;
 }

[-- Attachment #3: Type: text/plain, Size: 148 bytes --]

_______________________________________________
ofw mailing list
ofw@lists.openfabrics.org
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ofw

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [ofw] [Patch] [Tools][infiniband-diags]
       [not found] ` <E113D394D7C5DB4F8FF691FA7EE9DB443B390460E6-WQlSmcKwN8Te+A/uUDamNg@public.gmane.org>
@ 2010-08-01 17:19   ` Sasha Khapyorsky
  2010-08-25 17:20     ` Sasha Khapyorsky
  0 siblings, 1 reply; 3+ messages in thread
From: Sasha Khapyorsky @ 2010-08-01 17:19 UTC (permalink / raw)
  To: Irena Kruchkovsky
  Cc: Linux RDMA list,
	ofw-ZwoEplunGu1OwGhvXhtEPSCwEArCW2h5@public.gmane.org

On 14:36 Wed 28 Jul     , Irena Kruchkovsky wrote:
> A patch that fixes the GUID output in ibstat to work correctly in windows 2003.
> 
> Index: D:/Windows/MLNX_VPI/tools/infiniband-diags/src/ibstat.c
> ===================================================================
> --- D:/Windows/MLNX_VPI/tools/infiniband-diags/src/ibstat.c  (revision 6199)
> +++ D:/Windows/MLNX_VPI/tools/infiniband-diags/src/ibstat.c               (revision 6200)
> @@ -72,9 +72,9 @@
>                 printf("\tNumber of ports: %d\n", ca->numports);
>                 printf("\tFirmware version: %s\n", ca->fw_ver);
>                 printf("\tHardware version: %s\n", ca->hw_ver);
> -              printf("\tNode GUID: 0x%016llx\n",
> +             printf("\tNode GUID: 0x%016I64x\n",

Normally we are using PRI* macros with management code. What about this:

diff --git a/infiniband-diags/src/ibstat.c b/infiniband-diags/src/ibstat.c
index c44d8c4..525902d 100644
--- a/infiniband-diags/src/ibstat.c
+++ b/infiniband-diags/src/ibstat.c
@@ -72,10 +72,9 @@ static void ca_dump(umad_ca_t * ca)
 	printf("\tNumber of ports: %d\n", ca->numports);
 	printf("\tFirmware version: %s\n", ca->fw_ver);
 	printf("\tHardware version: %s\n", ca->hw_ver);
-	printf("\tNode GUID: 0x%016llx\n",
-	       (long long unsigned)ntohll(ca->node_guid));
-	printf("\tSystem image GUID: 0x%016llx\n",
-	       (long long unsigned)ntohll(ca->system_guid));
+	printf("\tNode GUID: 0x%016" PRIx64 "\n", ntohll(ca->node_guid));
+	printf("\tSystem image GUID: 0x%016" PRIx64 "\n",
+	       ntohll(ca->system_guid));
 }
 
 static char *port_state_str[] = {
@@ -122,8 +121,7 @@ static int port_dump(umad_port_t * port, int alone)
 	printf("%sLMC: %d\n", pre, port->lmc);
 	printf("%sSM lid: %d\n", pre, port->sm_lid);
 	printf("%sCapability mask: 0x%08x\n", pre, ntohl(port->capmask));
-	printf("%sPort GUID: 0x%016llx\n", pre,
-	       (long long unsigned)ntohll(port->port_guid));
+	printf("%sPort GUID: 0x%016" PRIx64 "\n", pre, ntohll(port->port_guid));
 	printf("%sLink layer: %s\n", pre, port->link_layer);
 	return 0;
 }


? Does it solve an issue as well?

Sasha
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [ofw] [Patch] [Tools][infiniband-diags]
  2010-08-01 17:19   ` [ofw] " Sasha Khapyorsky
@ 2010-08-25 17:20     ` Sasha Khapyorsky
  0 siblings, 0 replies; 3+ messages in thread
From: Sasha Khapyorsky @ 2010-08-25 17:20 UTC (permalink / raw)
  To: Irena Kruchkovsky
  Cc: Linux RDMA list,
	ofw-ZwoEplunGu1OwGhvXhtEPSCwEArCW2h5@public.gmane.org

On 20:19 Sun 01 Aug     , Sasha Khapyorsky wrote:
> On 14:36 Wed 28 Jul     , Irena Kruchkovsky wrote:
> > A patch that fixes the GUID output in ibstat to work correctly in windows 2003.
> > 
> > Index: D:/Windows/MLNX_VPI/tools/infiniband-diags/src/ibstat.c
> > ===================================================================
> > --- D:/Windows/MLNX_VPI/tools/infiniband-diags/src/ibstat.c  (revision 6199)
> > +++ D:/Windows/MLNX_VPI/tools/infiniband-diags/src/ibstat.c               (revision 6200)
> > @@ -72,9 +72,9 @@
> >                 printf("\tNumber of ports: %d\n", ca->numports);
> >                 printf("\tFirmware version: %s\n", ca->fw_ver);
> >                 printf("\tHardware version: %s\n", ca->hw_ver);
> > -              printf("\tNode GUID: 0x%016llx\n",
> > +             printf("\tNode GUID: 0x%016I64x\n",
> 
> Normally we are using PRI* macros with management code. What about this:

I've commited this couple of days ago:

commit e4b73c2081a9afc346adf98d0f4d348005c920f6
Author: Sasha Khapyorsky <sashak-smomgflXvOZWk0Htik3J/w@public.gmane.org>
Date:   Sun Aug 1 20:26:11 2010 +0300

    infiniband-diags/ibstat: convert to PRIx64 macros GUID printing
    
    Convert to using PRIx64 macros for printing GUID values.
    
    Pointed out by Irena Kruchkovsky.
    
    Signed-off-by: Sasha Khapyorsky <sashak-smomgflXvOZWk0Htik3J/w@public.gmane.org>

diff --git a/infiniband-diags/src/ibstat.c b/infiniband-diags/src/ibstat.c
index c44d8c4..f655a13 100644
--- a/infiniband-diags/src/ibstat.c
+++ b/infiniband-diags/src/ibstat.c
@@ -72,10 +72,9 @@ static void ca_dump(umad_ca_t * ca)
 	printf("\tNumber of ports: %d\n", ca->numports);
 	printf("\tFirmware version: %s\n", ca->fw_ver);
 	printf("\tHardware version: %s\n", ca->hw_ver);
-	printf("\tNode GUID: 0x%016llx\n",
-	       (long long unsigned)ntohll(ca->node_guid));
-	printf("\tSystem image GUID: 0x%016llx\n",
-	       (long long unsigned)ntohll(ca->system_guid));
+	printf("\tNode GUID: 0x%016" PRIx64 "\n", ntohll(ca->node_guid));
+	printf("\tSystem image GUID: 0x%016" PRIx64 "\n",
+	       ntohll(ca->system_guid));
 }
 
 static char *port_state_str[] = {
@@ -122,8 +121,7 @@ static int port_dump(umad_port_t * port, int alone)
 	printf("%sLMC: %d\n", pre, port->lmc);
 	printf("%sSM lid: %d\n", pre, port->sm_lid);
 	printf("%sCapability mask: 0x%08x\n", pre, ntohl(port->capmask));
-	printf("%sPort GUID: 0x%016llx\n", pre,
-	       (long long unsigned)ntohll(port->port_guid));
+	printf("%sPort GUID: 0x%016" PRIx64 "\n", pre, ntohll(port->port_guid));
 	printf("%sLink layer: %s\n", pre, port->link_layer);
 	return 0;
 }
@@ -182,8 +180,7 @@ static int ports_list(char names[][UMAD_CA_NAME_LEN], int n)
 
 	for (i = 0; i < found; i++)
 		if (guids[i])
-			printf("0x%016llx\n",
-			       (long long unsigned)ntohll(guids[i]));
+			printf("0x%016" PRIx64 "\n", ntohll(guids[i]));
 	return found;
 }


, hope this solves your issues too.

Sasha
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-08-25 17:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-28 11:36 [Patch] [Tools][infiniband-diags] Irena Kruchkovsky
     [not found] ` <E113D394D7C5DB4F8FF691FA7EE9DB443B390460E6-WQlSmcKwN8Te+A/uUDamNg@public.gmane.org>
2010-08-01 17:19   ` [ofw] " Sasha Khapyorsky
2010-08-25 17:20     ` Sasha Khapyorsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox