Re: Using Altivec for TCP checksum calculations
On Mar 26, 2004, at 10:09 AM, Brian Tabone wrote:
I was reading up on the PowerPC 7455, and happened upon an interesting
document (http://e-www.motorola.com/files/if/cnb/ALTIVECTCPIPWP.pdf)
on Motorola's website. This document covered the advantages of doing
TCP checksum calculations in the Altivec SIMD unit versus doing it in
the scalar integer units.
Digging around in the xnu source, I found the checksum assembly code
for Darwin (in bsd/dev/ppc/xsumas.s) and found that it was doing the
checksum calculations in the integer units. My question is , beyond
having to support the G3, is there any reason why the Darwin kernel
does the checksum calculations in scalar code versus doing it in
vector code? Is there reason to avoid Altivec instructions in the
kernel?
I'm assuming that there should be some way to test for altivec and use
the scalar code when the altivec is not available so that the kernel
remains compatible with the G3.
If Motorola's numbers are to be believed, it would seem that this
tweak would open up a potential bottleneck in the TCP stack, leaving
more CPU time to do stuff like serve web pages and query databases.
This would be a fine tweak for a web server or some other network busy
server type.
There are two factors in involved here. If you use altivec in the kernel, you have to do some additional work to save and restore the registers. Any gains from altivec would have to be balanced against the cost of using altivec in the kernel. In addition, many NICs including those built-in to some of our machines, support hardware checksums. -josh [demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s] _______________________________________________ darwin-kernel mailing list | darwin-kernel@lists.apple.com Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-kernel Do not post admin requests to the list. They will be ignored.
participants (1)
-
Joshua Graessley