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-12-01 14:52:01 -08:00
2006-12-02 21:23:01 -08:00
2006-12-02 21:23:15 -08:00
2006-12-02 21:23:16 -08:00
2006-12-02 21:23:18 -08:00
2006-12-02 21:23:02 -08:00
2006-12-02 21:23:03 -08:00
2006-12-01 14:52:01 -08:00
2006-12-02 21:23:04 -08:00
2006-12-02 21:23:19 -08:00
2006-12-02 21:23:05 -08:00
2006-12-02 21:23:06 -08:00
2006-12-02 21:23:07 -08:00
2006-12-02 21:23:08 -08:00
2006-12-02 21:23:09 -08:00
2006-12-02 21:23:10 -08:00
2006-12-02 21:23:20 -08:00
2006-12-01 14:52:01 -08:00
2006-12-02 21:23:21 -08:00
2006-12-02 21:23:22 -08:00
2006-12-02 21:23:11 -08:00
2006-12-02 21:23:22 -08:00
2006-12-02 21:23:23 -08:00
2006-12-01 14:52:01 -08:00
2006-12-02 21:23:13 -08:00
2006-12-02 21:23:14 -08:00
2006-12-02 21:23:24 -08:00
2006-09-21 11:46:17 +10:00
2006-12-02 21:30:47 -08:00
2006-10-03 15:13:48 -03:00
2006-10-01 17:55:53 +01:00
2006-12-02 21:30:46 -08:00
2006-11-29 15:33:10 -08:00
2006-11-28 17:26:50 -08:00
2006-12-01 14:52:01 -08:00
2006-10-03 23:01:26 +02:00
2006-09-19 12:43:58 +01:00