[openib-general] [PATCH] libmthca: optimize calls to htonl with constant parameter

Michael S. Tsirkin mst at mellanox.co.il
Fri Feb 23 03:36:43 PST 2007


> Quoting Michael S. Tsirkin <mst at mellanox.co.il>:
> Subject: Re: [PATCH] libmthca: optimize calls to htonl with constant parameter
> 
> > So what is different in your setup that causes this patch to make a
> > difference for you?
> 
> Hmm. I agree it is somewhat strange.
> 
> Below is a simple test that attempts to compare htonl, CONSTANT_HTONL,
> and an array-driven implementation. The code line is taken directly from htonl.
> Could you compile and run it please?

OK, this was stupid, the test was missing 
#include <netinet/in.h>
so htonl was expanded by a gcc intrinsic which seems to work worse
than the macro tricks present in netinet/in.h.

I guess this include got killed on the test system somehow,
and this explains why I saw a difference in libmthca.

-- 
MST




More information about the general mailing list