Arnaldo Carvalho de Melo
d5c42c0ec4
[NET]: Pack struct hh_cache
[acme@newtoy net-2.6.20]$ pahole net/ipv4/tcp.o hh_cache
/* /pub/scm/linux/kernel/git/acme/net-2.6.20/include/linux/netdevice.h:190 */
struct hh_cache {
struct hh_cache * hh_next; /* 0 4 */
atomic_t hh_refcnt; /* 4 4 */
__be16 hh_type; /* 8 2 */
/* XXX 2 bytes hole, try to pack */
int hh_len; /* 12 4 */
int (*hh_output)(); /* 16 4 */
rwlock_t hh_lock; /* 20 36 */
long unsigned int hh_data[24]; /* 56 96 */
}; /* size: 152, sum members: 150, holes: 1, sum holes: 2 */
[acme@newtoy net-2.6.20]$ find net -name "*.[ch]" | xargs grep 'hh_len.\+=' | sort -u
net/atm/br2684.c: hh->hh_len = PADLEN + ETH_HLEN;
net/ethernet/eth.c: hh->hh_len = ETH_HLEN;
net/ipv4/ipconfig.c: int hh_len = LL_RESERVED_SPACE(dev);
net/ipv4/ip_output.c: hh_len = LL_RESERVED_SPACE(rt->u.dst.dev);
net/ipv4/ip_output.c: int hh_len = LL_RESERVED_SPACE(dev);
net/ipv4/netfilter.c: hh_len = (*pskb)->dst->dev->hard_header_len;
net/ipv4/raw.c: hh_len = LL_RESERVED_SPACE(rt->u.dst.dev);
net/ipv6/ip6_output.c: hh_len = LL_RESERVED_SPACE(rt->u.dst.dev);
net/ipv6/netfilter/ip6t_REJECT.c: hh_len = (dst->dev->hard_header_len + 15)&~15;
net/ipv6/raw.c: hh_len = LL_RESERVED_SPACE(rt->u.dst.dev);
[acme@newtoy net-2.6.20]$
[acme@newtoy net-2.6.20]$ find include -name "*.h" | xargs grep 'define ETH_HLEN'
include/linux/if_ether.h:#define ETH_HLEN 14 /* Total octets in header. */
(((dev)->hard_header_len&~(HH_DATA_MOD - 1)) + HH_DATA_MOD)
[acme@newtoy net-2.6.20]$ pahole net/ipv4/tcp.o net_device | grep hard_header_len
short unsigned int hard_header_len; /* 106 2 */
[acme@newtoy net-2.6.20]$
So I think we're safe in turning hh_len an u16, end result:
[acme@newtoy net-2.6.20]$ codiff -sV /tmp/tcp.o.before net/ipv4/tcp.o
/pub/scm/linux/kernel/git/acme/net-2.6.20/net/ipv4/tcp.c:
struct hh_cache | -4
hh_len;
from: int /* 12(0) 4(0) */
to: u16 /* 10(0) 2(0) */
1 struct changed
[acme@newtoy net-2.6.20]$
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
2006-12-02 21:30:47 -08:00
..
2006-10-20 10:26:40 -07:00
2006-12-02 08:29:04 -08:00
2006-10-30 12:08:41 -08:00
2006-12-02 21:27:12 -08:00
2006-11-15 21:18:49 -08:00
2006-12-02 21:22:56 -08:00
2006-12-02 21:23:42 -08:00
2006-11-15 21:18:49 -08:00
2006-11-08 18:29:23 -08:00
2006-10-21 13:35:05 -07:00
2006-12-02 21:23:32 -08:00
2006-10-14 00:49:52 -04:00
2006-12-02 21:22:55 -08:00
2006-12-02 21:22:55 -08:00
2006-12-02 21:22:55 -08:00
2006-10-20 10:26:35 -07:00
2006-10-11 11:14:22 -07:00
2006-12-01 10:40:55 +01:00
2006-12-01 10:39:12 +01:00
2006-10-17 08:18:46 -07:00
2006-10-11 11:14:21 -07:00
2006-10-21 13:35:05 -07:00
2006-11-03 12:27:59 -08:00
2006-10-11 11:14:22 -07:00
2006-11-20 08:27:08 +11:00
2006-10-11 11:14:25 -07:00
2006-12-02 21:23:26 -08:00
2006-12-01 14:52:01 -08:00
2006-10-21 18:37:02 +02:00
2006-12-01 10:42:33 +01:00
2006-10-11 11:14:18 -07:00
2006-12-01 14:52:00 -08:00
2006-12-02 21:21:42 -08:00
2006-10-19 20:53:08 +02:00
2006-11-08 18:29:25 -08:00
2006-11-14 09:09:27 -08:00
2006-12-02 21:23:26 -08:00
2006-12-02 21:23:26 -08:00
2006-12-02 21:21:24 -08:00
2006-12-02 21:21:17 -08:00
2006-12-02 21:23:26 -08:00
2006-12-02 21:21:21 -08:00
2006-12-02 21:22:46 -08:00
2006-12-02 21:22:50 -08:00
2006-11-20 11:47:18 -08:00
2006-10-11 11:14:23 -07:00
2006-12-01 14:36:58 -08:00
2006-12-02 21:21:21 -08:00
2006-12-02 21:23:26 -08:00
2006-11-08 18:29:24 -08:00
2006-12-02 21:21:21 -08:00
2006-11-05 14:11:24 -08:00
2006-10-20 10:26:37 -07:00
2006-11-26 16:27:17 -08:00
2006-11-30 05:24:39 +01:00
2006-11-30 04:53:49 +01:00
2006-12-02 21:22:23 -08:00
2006-11-30 04:46:13 +01:00
2006-11-30 01:14:44 +00:00
2006-12-01 14:52:01 -08:00
2006-10-31 20:40:09 -05:00
2006-10-11 23:45:23 -04:00
2006-10-21 13:35:06 -07:00
2006-12-01 14:51:59 -08:00
2006-10-20 10:26:38 -07:00
2006-10-28 11:30:50 -07:00
2006-12-01 14:52:02 -08:00
2006-11-30 04:40:22 +01:00
2006-11-16 11:43:38 -08:00
2006-12-02 00:22:29 -05:00
2006-10-11 11:14:24 -07:00
2006-12-02 21:22:57 -08:00
2006-12-02 21:30:47 -08:00
2006-12-02 21:22:56 -08:00
2006-12-02 21:23:38 -08:00
2006-12-02 21:23:38 -08:00
2006-12-02 21:23:42 -08:00
2006-12-02 21:30:43 -08:00
2006-12-02 21:22:38 -08:00
2006-12-02 21:21:09 -08:00
2006-10-20 10:26:40 -07:00
2006-10-11 11:14:22 -07:00
2006-11-25 13:28:33 -08:00
2006-10-20 10:26:38 -07:00
2006-10-28 11:30:50 -07:00
2006-10-18 11:36:12 -07:00
2006-12-02 21:24:33 -08:00
2006-12-01 14:36:56 -08:00
2006-12-01 14:36:59 -08:00
2006-11-13 07:40:42 -08:00
2006-12-02 21:21:18 -08:00
2006-12-02 00:33:11 -05:00
2006-12-01 14:52:02 -08:00
2006-11-03 12:27:58 -08:00
2006-12-02 21:22:51 -08:00
2006-11-30 05:24:39 +01:00
2006-12-02 21:30:44 -08:00
2006-10-28 11:30:54 -07:00
2006-12-02 21:26:16 -08:00
2006-12-02 21:21:34 -08:00
2006-12-02 21:27:18 -08:00
2006-12-02 21:23:32 -08:00
2006-12-02 21:22:23 -08:00
2006-11-25 13:28:34 -08:00
2006-11-26 16:27:17 -08:00
2006-10-11 11:14:21 -07:00
2006-12-02 21:24:42 -08:00
2006-12-01 14:52:01 -08:00
2006-10-28 11:30:54 -07:00
2006-12-02 21:23:26 -08:00
2006-11-30 05:32:19 +01:00
2006-12-02 21:30:42 -08:00
2006-12-02 21:21:08 -08:00
2006-10-18 19:55:22 -07:00
2006-12-01 14:51:59 -08:00
2006-12-02 21:23:00 -08:00
2006-12-02 21:23:26 -08:00
2006-11-03 12:27:56 -08:00
2006-10-21 18:37:01 +02:00
2006-12-01 14:25:52 -08:00
2006-10-14 00:44:23 -03:00
2006-11-13 07:40:42 -08:00
2006-10-30 12:08:40 -08:00
2006-12-02 00:11:58 -05:00
2006-10-20 10:26:35 -07:00
2006-12-02 21:21:17 -08:00