[ofw][patch][WinVerbs tests] Re: fix IPv6relatedconnectionproblem

Tzachi Dar tzachid at mellanox.co.il
Tue Feb 24 00:46:31 PST 2009


Hi Sean,

This patch solves one part of the problem but not all of it:
Reducing the time that it takes to do the measurements helps, but you
have to remove it *twice*.

To understand why this is so, let's look at the ping pong test.
Let's look at a simple scenario:

For (i=0; I < 1000; i++) {
	T0 = time();
	Send();
	Receive()
}
Latency will be measured as T0 -T0 previous and will be calculated by 2.
Please note that if the other side is running the same code, than the 
time that elapses before receive returns includes also running the
function time()
on the remote side.

So, I guess to get a good measurement, either we should find a function
with neglectable time or
we should run the loop for a few times and only take the time at the
beginning and at the end.

Also a good approach is what we had before:
Send()
Time()
Receive()

Since this is running in a loop then we get the time of each loop
correctly.

Thanks
Tzachi
 

> -----Original Message-----
> From: ofw-bounces at lists.openfabrics.org 
> [mailto:ofw-bounces at lists.openfabrics.org] On Behalf Of Sean Hefty
> Sent: Monday, February 23, 2009 8:59 PM
> To: Leonid Keller; Diego Guella; Fab Tillier; 
> ofw at lists.openfabrics.org
> Subject: RE: [ofw][patch][WinVerbs tests] Re: fix 
> IPv6relatedconnectionproblem 
> 
> How about replacing get_cycles() with something like this?
> 
> static __inline UINT64 get_cycles()
> {
> 	LARGE_INTEGER counter;
> 	static UINT64 base_adj = 0;
> 	static UINT64 running_adj = 0;
> 
> 	if (base_adj == 0) {
> 		int i;
> 
> 		QueryPerformanceCounter(&counter);
> 		base_adj = counter.QuadPart;
> 		for (i = 0; i < (1 << 16) - 2; i++) {
> 			QueryPerformanceCounter(&counter);
> 		}
> 		QueryPerformanceCounter(&counter);
> 		base_adj = (counter.QuadPart - base_adj) >> 16;
> 	}
> 
> 	QueryPerformanceCounter(&counter);
> 
> 	running_adj += base_adj;
> 	return counter.QuadPart - running_adj;
> }
> 
> - Sean
> 
> _______________________________________________
> ofw mailing list
> ofw at lists.openfabrics.org
> http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ofw
> 



More information about the ofw mailing list