On Thu, Nov 18, 2004 at 10:58:50AM -0800, Roland Dreier wrote:
> Add ip_ib_mc_map() to convert IPv$ multicast addresses to IPoIB
> hardware addresses.
...
> + addr = ntohl(addr);
...
> + buf[19] = addr & 0xff;
> + addr >>= 8;
> + buf[18] = addr & 0xff;
> + addr >>= 8;
> + buf[17] = addr & 0xff;
> + addr >>= 8;
> + buf[16] = addr & 0x0f;
Can the same be done instead with the following?
addr &= 0x0fffffff;
((unsigned int *)buf)[4] = cpu_to_be32(addr);
Or are there possible alignment issues with buf?
Maybe the following is also correct:
((unsigned int *)buf)[4] = addr & htonl(0x0fffffff);
anyway...just some micro-optimizations...probably really only matters
on BE machines.
thanks,
grant
_______________________________________________
openib-general mailing list
[EMAIL PROTECTED]
http://openib.org/mailman/listinfo/openib-general
To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general