Skip to content

Commit

Permalink
ipv4: ip_route_output_key() is better as an inline.
Browse files Browse the repository at this point in the history
This avoid a stack frame at zero cost.

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Mar 2, 2011
1 parent b23dd4f commit 5bfa787
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
6 changes: 5 additions & 1 deletion include/net/route.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,15 @@ extern void ip_rt_redirect(__be32 old_gw, __be32 dst, __be32 new_gw,
extern void rt_cache_flush(struct net *net, int how);
extern void rt_cache_flush_batch(struct net *net);
extern struct rtable *__ip_route_output_key(struct net *, const struct flowi *flp);
extern struct rtable *ip_route_output_key(struct net *, struct flowi *flp);
extern struct rtable *ip_route_output_flow(struct net *, struct flowi *flp,
struct sock *sk);
extern struct dst_entry *ipv4_blackhole_route(struct net *net, struct dst_entry *dst_orig);

static inline struct rtable *ip_route_output_key(struct net *net, struct flowi *flp)
{
return ip_route_output_flow(net, flp, NULL);
}

extern int ip_route_input_common(struct sk_buff *skb, __be32 dst, __be32 src,
u8 tos, struct net_device *devin, bool noref);

Expand Down
6 changes: 0 additions & 6 deletions net/ipv4/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -2736,12 +2736,6 @@ struct rtable *ip_route_output_flow(struct net *net, struct flowi *flp,
}
EXPORT_SYMBOL_GPL(ip_route_output_flow);

struct rtable *ip_route_output_key(struct net *net, struct flowi *flp)
{
return ip_route_output_flow(net, flp, NULL);
}
EXPORT_SYMBOL(ip_route_output_key);

static int rt_fill_info(struct net *net,
struct sk_buff *skb, u32 pid, u32 seq, int event,
int nowait, unsigned int flags)
Expand Down

0 comments on commit 5bfa787

Please sign in to comment.