Skip to content

Commit

Permalink
[NET]: Move sk_setup_caps() out of line.
Browse files Browse the repository at this point in the history
It is far too large to be an inline and not in any hot paths.

Signed-off-by: Andi Kleen <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Andi Kleen authored and David S. Miller committed Apr 26, 2007
1 parent 4ac02ba commit 9958089
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
14 changes: 1 addition & 13 deletions include/net/sock.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

static inline 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;
}
}
extern void sk_setup_caps(struct sock *sk, struct dst_entry *dst);

static inline void sk_charge_skb(struct sock *sk, struct sk_buff *skb)
{
Expand Down
15 changes: 15 additions & 0 deletions net/core/sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -979,6 +979,21 @@ struct sock *sk_clone(const struct sock *sk, const gfp_t priority)

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)
{
if (num_physpages <= 4096) {
Expand Down

0 comments on commit 9958089

Please sign in to comment.