Commit 9958089a authored by Andi Kleen's avatar Andi Kleen Committed by David S. Miller

[NET]: Move sk_setup_caps() out of line.

It is far too large to be an inline and not in any hot paths.
Signed-off-by: default avatarAndi Kleen <ak@suse.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4ac02bab
...@@ -1075,19 +1075,7 @@ static inline int sk_can_gso(const struct sock *sk) ...@@ -1075,19 +1075,7 @@ static inline int sk_can_gso(const struct sock *sk)
return net_gso_ok(sk->sk_route_caps, sk->sk_gso_type); return net_gso_ok(sk->sk_route_caps, sk->sk_gso_type);
} }
static inline void sk_setup_caps(struct sock *sk, struct dst_entry *dst) extern void sk_setup_caps(struct sock *sk, struct dst_entry *dst);
{
__sk_dst_set(sk, dst);
sk->sk_route_caps = dst->dev->features;
if (sk->sk_route_caps & NETIF_F_GSO)
sk->sk_route_caps |= NETIF_F_GSO_MASK;
if (sk_can_gso(sk)) {
if (dst->header_len)
sk->sk_route_caps &= ~NETIF_F_GSO_MASK;
else
sk->sk_route_caps |= NETIF_F_SG | NETIF_F_HW_CSUM;
}
}
static inline void sk_charge_skb(struct sock *sk, struct sk_buff *skb) static inline void sk_charge_skb(struct sock *sk, struct sk_buff *skb)
{ {
......
...@@ -979,6 +979,21 @@ out: ...@@ -979,6 +979,21 @@ out:
EXPORT_SYMBOL_GPL(sk_clone); EXPORT_SYMBOL_GPL(sk_clone);
void sk_setup_caps(struct sock *sk, struct dst_entry *dst)
{
__sk_dst_set(sk, dst);
sk->sk_route_caps = dst->dev->features;
if (sk->sk_route_caps & NETIF_F_GSO)
sk->sk_route_caps |= NETIF_F_GSO_MASK;
if (sk_can_gso(sk)) {
if (dst->header_len)
sk->sk_route_caps &= ~NETIF_F_GSO_MASK;
else
sk->sk_route_caps |= NETIF_F_SG | NETIF_F_HW_CSUM;
}
}
EXPORT_SYMBOL_GPL(sk_setup_caps);
void __init sk_init(void) void __init sk_init(void)
{ {
if (num_physpages <= 4096) { if (num_physpages <= 4096) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment