diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2007-04-19 23:29:13 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-26 01:26:28 -0400 |
commit | 27a884dc3cb63b93c2b3b643f5b31eed5f8a4d26 (patch) | |
tree | 5a267e40f9b94014be38dad5de0a52b6628834e0 /arch | |
parent | be8bd86321fa7f06359d866ef61fb4d2f3e9dce9 (diff) |
[SK_BUFF]: Convert skb->tail to sk_buff_data_t
So that it is also an offset from skb->head, reduces its size from 8 to 4 bytes
on 64bit architectures, allowing us to combine the 4 bytes hole left by the
layer headers conversion, reducing struct sk_buff size to 256 bytes, i.e. 4
64byte cachelines, and since the sk_buff slab cache is SLAB_HWCACHE_ALIGN...
:-)
Many calculations that previously required that skb->{transport,network,
mac}_header be first converted to a pointer now can be done directly, being
meaningful as offsets or pointers.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/ia64/sn/kernel/xpnet.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/arch/ia64/sn/kernel/xpnet.c b/arch/ia64/sn/kernel/xpnet.c index 68d59d912c99..eb416c95967d 100644 --- a/arch/ia64/sn/kernel/xpnet.c +++ b/arch/ia64/sn/kernel/xpnet.c | |||
@@ -264,7 +264,7 @@ xpnet_receive(partid_t partid, int channel, struct xpnet_message *msg) | |||
264 | 264 | ||
265 | dev_dbg(xpnet, "<skb->head=0x%p skb->data=0x%p skb->tail=0x%p " | 265 | dev_dbg(xpnet, "<skb->head=0x%p skb->data=0x%p skb->tail=0x%p " |
266 | "skb->end=0x%p skb->len=%d\n", (void *) skb->head, | 266 | "skb->end=0x%p skb->len=%d\n", (void *) skb->head, |
267 | (void *) skb->data, (void *) skb->tail, (void *) skb->end, | 267 | (void *)skb->data, skb_tail_pointer(skb), (void *)skb->end, |
268 | skb->len); | 268 | skb->len); |
269 | 269 | ||
270 | skb->protocol = eth_type_trans(skb, xpnet_device); | 270 | skb->protocol = eth_type_trans(skb, xpnet_device); |
@@ -272,7 +272,7 @@ xpnet_receive(partid_t partid, int channel, struct xpnet_message *msg) | |||
272 | 272 | ||
273 | dev_dbg(xpnet, "passing skb to network layer; \n\tskb->head=0x%p " | 273 | dev_dbg(xpnet, "passing skb to network layer; \n\tskb->head=0x%p " |
274 | "skb->data=0x%p skb->tail=0x%p skb->end=0x%p skb->len=%d\n", | 274 | "skb->data=0x%p skb->tail=0x%p skb->end=0x%p skb->len=%d\n", |
275 | (void *) skb->head, (void *) skb->data, (void *) skb->tail, | 275 | (void *)skb->head, (void *)skb->data, skb_tail_pointer(skb), |
276 | (void *) skb->end, skb->len); | 276 | (void *) skb->end, skb->len); |
277 | 277 | ||
278 | 278 | ||
@@ -475,7 +475,7 @@ xpnet_dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
475 | 475 | ||
476 | dev_dbg(xpnet, ">skb->head=0x%p skb->data=0x%p skb->tail=0x%p " | 476 | dev_dbg(xpnet, ">skb->head=0x%p skb->data=0x%p skb->tail=0x%p " |
477 | "skb->end=0x%p skb->len=%d\n", (void *) skb->head, | 477 | "skb->end=0x%p skb->len=%d\n", (void *) skb->head, |
478 | (void *) skb->data, (void *) skb->tail, (void *) skb->end, | 478 | (void *)skb->data, skb_tail_pointer(skb), (void *)skb->end, |
479 | skb->len); | 479 | skb->len); |
480 | 480 | ||
481 | 481 | ||
@@ -497,7 +497,7 @@ xpnet_dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
497 | 497 | ||
498 | /* get the beginning of the first cacheline and end of last */ | 498 | /* get the beginning of the first cacheline and end of last */ |
499 | start_addr = ((u64) skb->data & ~(L1_CACHE_BYTES - 1)); | 499 | start_addr = ((u64) skb->data & ~(L1_CACHE_BYTES - 1)); |
500 | end_addr = L1_CACHE_ALIGN((u64) skb->tail); | 500 | end_addr = L1_CACHE_ALIGN((u64)skb_tail_pointer(skb)); |
501 | 501 | ||
502 | /* calculate how many bytes to embed in the XPC message */ | 502 | /* calculate how many bytes to embed in the XPC message */ |
503 | embedded_bytes = 0; | 503 | embedded_bytes = 0; |
@@ -573,7 +573,7 @@ xpnet_dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
573 | msg->magic = XPNET_MAGIC; | 573 | msg->magic = XPNET_MAGIC; |
574 | msg->size = end_addr - start_addr; | 574 | msg->size = end_addr - start_addr; |
575 | msg->leadin_ignore = (u64) skb->data - start_addr; | 575 | msg->leadin_ignore = (u64) skb->data - start_addr; |
576 | msg->tailout_ignore = end_addr - (u64) skb->tail; | 576 | msg->tailout_ignore = end_addr - (u64)skb_tail_pointer(skb); |
577 | msg->buf_pa = __pa(start_addr); | 577 | msg->buf_pa = __pa(start_addr); |
578 | 578 | ||
579 | dev_dbg(xpnet, "sending XPC message to %d:%d\nmsg->buf_pa=" | 579 | dev_dbg(xpnet, "sending XPC message to %d:%d\nmsg->buf_pa=" |