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 /drivers/media/dvb | |
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 'drivers/media/dvb')
-rw-r--r-- | drivers/media/dvb/dvb-core/dvb_net.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/media/dvb/dvb-core/dvb_net.c b/drivers/media/dvb/dvb-core/dvb_net.c index c6b004182d91..9de177a5b9f1 100644 --- a/drivers/media/dvb/dvb-core/dvb_net.c +++ b/drivers/media/dvb/dvb-core/dvb_net.c | |||
@@ -600,6 +600,7 @@ static void dvb_net_ule( struct net_device *dev, const u8 *buf, size_t buf_len ) | |||
600 | /* Check CRC32, we've got it in our skb already. */ | 600 | /* Check CRC32, we've got it in our skb already. */ |
601 | unsigned short ulen = htons(priv->ule_sndu_len); | 601 | unsigned short ulen = htons(priv->ule_sndu_len); |
602 | unsigned short utype = htons(priv->ule_sndu_type); | 602 | unsigned short utype = htons(priv->ule_sndu_type); |
603 | const u8 *tail; | ||
603 | struct kvec iov[3] = { | 604 | struct kvec iov[3] = { |
604 | { &ulen, sizeof ulen }, | 605 | { &ulen, sizeof ulen }, |
605 | { &utype, sizeof utype }, | 606 | { &utype, sizeof utype }, |
@@ -613,10 +614,11 @@ static void dvb_net_ule( struct net_device *dev, const u8 *buf, size_t buf_len ) | |||
613 | } | 614 | } |
614 | 615 | ||
615 | ule_crc = iov_crc32(ule_crc, iov, 3); | 616 | ule_crc = iov_crc32(ule_crc, iov, 3); |
616 | expected_crc = *((u8 *)priv->ule_skb->tail - 4) << 24 | | 617 | tail = skb_tail_pointer(priv->ule_skb); |
617 | *((u8 *)priv->ule_skb->tail - 3) << 16 | | 618 | expected_crc = *(tail - 4) << 24 | |
618 | *((u8 *)priv->ule_skb->tail - 2) << 8 | | 619 | *(tail - 3) << 16 | |
619 | *((u8 *)priv->ule_skb->tail - 1); | 620 | *(tail - 2) << 8 | |
621 | *(tail - 1); | ||
620 | if (ule_crc != expected_crc) { | 622 | if (ule_crc != expected_crc) { |
621 | printk(KERN_WARNING "%lu: CRC32 check FAILED: %08x / %08x, SNDU len %d type %#x, ts_remain %d, next 2: %x.\n", | 623 | printk(KERN_WARNING "%lu: CRC32 check FAILED: %08x / %08x, SNDU len %d type %#x, ts_remain %d, next 2: %x.\n", |
622 | priv->ts_count, ule_crc, expected_crc, priv->ule_sndu_len, priv->ule_sndu_type, ts_remain, ts_remain > 2 ? *(unsigned short *)from_where : 0); | 624 | priv->ts_count, ule_crc, expected_crc, priv->ule_sndu_len, priv->ule_sndu_type, ts_remain, ts_remain > 2 ? *(unsigned short *)from_where : 0); |