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

Leonid Keller leonid at mellanox.co.il
Tue Feb 24 02:06:06 PST 2009


Hi  Sean,

Tzachi is absoluteiy right.
I tried this approach (with my own implementation).
Here are the numbers (for send_lat()):
Before fixes: 3.49 usec;
After your kind of fix: 2.65 (- 0.84 usec)
After our fix:  1.82 (- 0.83 usec)

Ping-pong is a "serialized" test, meaning nothing is being done in
parallel.
If the time T of time stamping is less than the time U of roundrobin,
the time stamping just descreases the time of *resultless* polling and
we get RIGHT results.
If T > U, then the results will be WORSE than the real ones.
So the best solution in my opinion is to keep our fix + to use for the
time stamping a function with as little T as possible.
If there is no good suggestion for another time stamping function, let
us apply our patch for now.

Fab, I failed to understand, whether you suggest to replace
QueryPerformanceCounter by GetSystemTimeAsFileTime ?
Is it faster and as much stable/trustful ?


> -----Original Message-----
> From: Tzachi Dar 
> Sent: Tuesday, February 24, 2009 10:47 AM
> To: Sean Hefty; Leonid Keller; Diego Guella; Fab Tillier; 
> ofw at lists.openfabrics.org
> Subject: RE: [ofw][patch][WinVerbs tests] Re: fix 
> IPv6relatedconnectionproblem 
> 
> 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