summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2007-01-12 07:23:31 +0000
committerimp <imp@FreeBSD.org>2007-01-12 07:23:31 +0000
commit3610b784caab2c70fc21186ab858a4d89d80ee3d (patch)
tree5aad38060f4270bcf395b1eb7e96bc11d289336b
parentaafe8d188ddd358fcb0ebdd74004fc1c7c352d5d (diff)
downloadFreeBSD-src-3610b784caab2c70fc21186ab858a4d89d80ee3d.zip
FreeBSD-src-3610b784caab2c70fc21186ab858a4d89d80ee3d.tar.gz
Marking this as __packed was needed to get the alignment and offset of
members right. However, it also said it was aligned(1), which meant that gcc generated really bad code. Mark this as aligned(4). This makes things a little faster on arm (a couple percent), but also saves about 30k on the size of the kernel for arm. I talked about doing this with bde, but didn't check with him before the commit, so I'm hesitant say 'reviewed by: bde'.
-rw-r--r--sys/netinet/ip.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/netinet/ip.h b/sys/netinet/ip.h
index 1ad3a93..63aa4fd 100644
--- a/sys/netinet/ip.h
+++ b/sys/netinet/ip.h
@@ -65,7 +65,7 @@ struct ip {
u_char ip_p; /* protocol */
u_short ip_sum; /* checksum */
struct in_addr ip_src,ip_dst; /* source and dest address */
-} __packed;
+} __packed __aligned(4);
#ifdef CTASSERT
CTASSERT(sizeof (struct ip) == 20);
OpenPOWER on IntegriCloud