diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2008-05-12 23:48:31 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-05-12 23:48:31 -0400 |
commit | f5184d267c1aedb9b7a8cc44e08ff6b8d382c3b5 (patch) | |
tree | 5ccce7558f9e1e53e5b189d6e2fe62a667988ac8 /net/ipv6 | |
parent | 8388e3da34edb141362bb42811ee487dfec15525 (diff) |
net: Allow netdevices to specify needed head/tailroom
This patch adds needed_headroom/needed_tailroom members to struct
net_device and updates many places that allocate sbks to use them. Not
all of them can be converted though, and I'm sure I missed some (I
mostly grepped for LL_RESERVED_SPACE)
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/ip6_output.c | 2 | ||||
-rw-r--r-- | net/ipv6/mcast.c | 4 | ||||
-rw-r--r-- | net/ipv6/ndisc.c | 4 | ||||
-rw-r--r-- | net/ipv6/raw.c | 10 |
4 files changed, 9 insertions, 11 deletions
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index 0af2e055f883..48cdce9c696c 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c | |||
@@ -780,7 +780,7 @@ slow_path: | |||
780 | * Allocate buffer. | 780 | * Allocate buffer. |
781 | */ | 781 | */ |
782 | 782 | ||
783 | if ((frag = alloc_skb(len+hlen+sizeof(struct frag_hdr)+LL_RESERVED_SPACE(rt->u.dst.dev), GFP_ATOMIC)) == NULL) { | 783 | if ((frag = alloc_skb(len+hlen+sizeof(struct frag_hdr)+LL_ALLOCATED_SPACE(rt->u.dst.dev), GFP_ATOMIC)) == NULL) { |
784 | NETDEBUG(KERN_INFO "IPv6: frag: no memory for new fragment!\n"); | 784 | NETDEBUG(KERN_INFO "IPv6: frag: no memory for new fragment!\n"); |
785 | IP6_INC_STATS(ip6_dst_idev(skb->dst), | 785 | IP6_INC_STATS(ip6_dst_idev(skb->dst), |
786 | IPSTATS_MIB_FRAGFAILS); | 786 | IPSTATS_MIB_FRAGFAILS); |
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c index 54f91efdae58..fd632dd7f98d 100644 --- a/net/ipv6/mcast.c +++ b/net/ipv6/mcast.c | |||
@@ -1411,7 +1411,7 @@ static struct sk_buff *mld_newpack(struct net_device *dev, int size) | |||
1411 | IPV6_TLV_PADN, 0 }; | 1411 | IPV6_TLV_PADN, 0 }; |
1412 | 1412 | ||
1413 | /* we assume size > sizeof(ra) here */ | 1413 | /* we assume size > sizeof(ra) here */ |
1414 | skb = sock_alloc_send_skb(sk, size + LL_RESERVED_SPACE(dev), 1, &err); | 1414 | skb = sock_alloc_send_skb(sk, size + LL_ALLOCATED_SPACE(dev), 1, &err); |
1415 | 1415 | ||
1416 | if (!skb) | 1416 | if (!skb) |
1417 | return NULL; | 1417 | return NULL; |
@@ -1790,7 +1790,7 @@ static void igmp6_send(struct in6_addr *addr, struct net_device *dev, int type) | |||
1790 | payload_len = len + sizeof(ra); | 1790 | payload_len = len + sizeof(ra); |
1791 | full_len = sizeof(struct ipv6hdr) + payload_len; | 1791 | full_len = sizeof(struct ipv6hdr) + payload_len; |
1792 | 1792 | ||
1793 | skb = sock_alloc_send_skb(sk, LL_RESERVED_SPACE(dev) + full_len, 1, &err); | 1793 | skb = sock_alloc_send_skb(sk, LL_ALLOCATED_SPACE(dev) + full_len, 1, &err); |
1794 | 1794 | ||
1795 | if (skb == NULL) { | 1795 | if (skb == NULL) { |
1796 | rcu_read_lock(); | 1796 | rcu_read_lock(); |
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c index 2c74885f8355..a55fc05b8125 100644 --- a/net/ipv6/ndisc.c +++ b/net/ipv6/ndisc.c | |||
@@ -479,7 +479,7 @@ static void __ndisc_send(struct net_device *dev, | |||
479 | 479 | ||
480 | skb = sock_alloc_send_skb(sk, | 480 | skb = sock_alloc_send_skb(sk, |
481 | (MAX_HEADER + sizeof(struct ipv6hdr) + | 481 | (MAX_HEADER + sizeof(struct ipv6hdr) + |
482 | len + LL_RESERVED_SPACE(dev)), | 482 | len + LL_ALLOCATED_SPACE(dev)), |
483 | 1, &err); | 483 | 1, &err); |
484 | if (!skb) { | 484 | if (!skb) { |
485 | ND_PRINTK0(KERN_ERR | 485 | ND_PRINTK0(KERN_ERR |
@@ -1521,7 +1521,7 @@ void ndisc_send_redirect(struct sk_buff *skb, struct neighbour *neigh, | |||
1521 | 1521 | ||
1522 | buff = sock_alloc_send_skb(sk, | 1522 | buff = sock_alloc_send_skb(sk, |
1523 | (MAX_HEADER + sizeof(struct ipv6hdr) + | 1523 | (MAX_HEADER + sizeof(struct ipv6hdr) + |
1524 | len + LL_RESERVED_SPACE(dev)), | 1524 | len + LL_ALLOCATED_SPACE(dev)), |
1525 | 1, &err); | 1525 | 1, &err); |
1526 | if (buff == NULL) { | 1526 | if (buff == NULL) { |
1527 | ND_PRINTK0(KERN_ERR | 1527 | ND_PRINTK0(KERN_ERR |
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c index 396f0ea11090..232e0dc45bf5 100644 --- a/net/ipv6/raw.c +++ b/net/ipv6/raw.c | |||
@@ -609,7 +609,6 @@ static int rawv6_send_hdrinc(struct sock *sk, void *from, int length, | |||
609 | struct ipv6_pinfo *np = inet6_sk(sk); | 609 | struct ipv6_pinfo *np = inet6_sk(sk); |
610 | struct ipv6hdr *iph; | 610 | struct ipv6hdr *iph; |
611 | struct sk_buff *skb; | 611 | struct sk_buff *skb; |
612 | unsigned int hh_len; | ||
613 | int err; | 612 | int err; |
614 | 613 | ||
615 | if (length > rt->u.dst.dev->mtu) { | 614 | if (length > rt->u.dst.dev->mtu) { |
@@ -619,13 +618,12 @@ static int rawv6_send_hdrinc(struct sock *sk, void *from, int length, | |||
619 | if (flags&MSG_PROBE) | 618 | if (flags&MSG_PROBE) |
620 | goto out; | 619 | goto out; |
621 | 620 | ||
622 | hh_len = LL_RESERVED_SPACE(rt->u.dst.dev); | 621 | skb = sock_alloc_send_skb(sk, |
623 | 622 | length + LL_ALLOCATED_SPACE(rt->u.dst.dev) + 15, | |
624 | skb = sock_alloc_send_skb(sk, length+hh_len+15, | 623 | flags & MSG_DONTWAIT, &err); |
625 | flags&MSG_DONTWAIT, &err); | ||
626 | if (skb == NULL) | 624 | if (skb == NULL) |
627 | goto error; | 625 | goto error; |
628 | skb_reserve(skb, hh_len); | 626 | skb_reserve(skb, LL_RESERVED_SPACE(rt->u.dst.dev)); |
629 | 627 | ||
630 | skb->priority = sk->sk_priority; | 628 | skb->priority = sk->sk_priority; |
631 | skb->mark = sk->sk_mark; | 629 | skb->mark = sk->sk_mark; |