Assume natural alignment for IP & ether addrs
authorAndrew Gallatin <gallatin@google.com>
Mon, 23 Jun 2014 20:20:35 +0000 (13:20 -0700)
committerAndrew Gallatin <gallatin@google.com>
Mon, 23 Jun 2014 23:19:40 +0000 (16:19 -0700)
commitb5b3361af8803a01f26aef1392f595bd9446ef11
tree50eda499040aeca3eec22706c2a9ae8ad9a6ef4b
parent7a0a5108dbd97421a8d2f6b6210e9fe5d3f34897
Assume natural alignment for IP & ether addrs

Assume natural alignment for IP addresses and ethernet addresses in
the critical path.  By doing so, we can compare and copy via direct
4-byte load / store rather than either calling memcmp()/memmove(), or
doing hand-unrolled byte-by-byte operations.

This gains about 750Mb/s on a netperf TCP receive workload with a
10GbE NIC in a low-end x86_64.

Signed-off-by: Andrew Gallatin <gallatin@google.com>
kern/drivers/dev/ether.c
kern/include/ip.h
kern/src/net/arp.c
kern/src/net/ethermedium.c
kern/src/net/ipaux.c
kern/src/net/ipifc.c