mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-28 17:41:50 +00:00
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>
This commit is contained in:
parent
8388e3da34
commit
f5184d267c
13 changed files with 39 additions and 31 deletions
|
@ -25,11 +25,11 @@ static int xfrm_state_check_space(struct xfrm_state *x, struct sk_buff *skb)
|
|||
struct dst_entry *dst = skb->dst;
|
||||
int nhead = dst->header_len + LL_RESERVED_SPACE(dst->dev)
|
||||
- skb_headroom(skb);
|
||||
int ntail = dst->dev->needed_tailroom - skb_tailroom(skb);
|
||||
|
||||
if (nhead > 0)
|
||||
return pskb_expand_head(skb, nhead, 0, GFP_ATOMIC);
|
||||
if (nhead > 0 || ntail > 0)
|
||||
return pskb_expand_head(skb, nhead, ntail, GFP_ATOMIC);
|
||||
|
||||
/* Check tail too... */
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue