Commit 4a94445c9a5cf5461fb41d80040033b9a8e2a85a
Committed by
David S. Miller
1 parent
407eadd996
Exists in
master
and in
7 other branches
net: Use ip_route_input_noref() in input path
Use ip_route_input_noref() in ip fast path, to avoid two atomic ops per incoming packet. Note: loopback is excluded from this optimization in ip_rcv_finish() Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Showing 3 changed files with 5 additions and 5 deletions Side-by-side Diff
net/ipv4/arp.c
net/ipv4/ip_input.c
... | ... | @@ -331,8 +331,8 @@ |
331 | 331 | * how the packet travels inside Linux networking. |
332 | 332 | */ |
333 | 333 | if (skb_dst(skb) == NULL) { |
334 | - int err = ip_route_input(skb, iph->daddr, iph->saddr, iph->tos, | |
335 | - skb->dev); | |
334 | + int err = ip_route_input_noref(skb, iph->daddr, iph->saddr, | |
335 | + iph->tos, skb->dev); | |
336 | 336 | if (unlikely(err)) { |
337 | 337 | if (err == -EHOSTUNREACH) |
338 | 338 | IP_INC_STATS_BH(dev_net(skb->dev), |
net/ipv4/xfrm4_input.c
... | ... | @@ -27,8 +27,8 @@ |
27 | 27 | if (skb_dst(skb) == NULL) { |
28 | 28 | const struct iphdr *iph = ip_hdr(skb); |
29 | 29 | |
30 | - if (ip_route_input(skb, iph->daddr, iph->saddr, iph->tos, | |
31 | - skb->dev)) | |
30 | + if (ip_route_input_noref(skb, iph->daddr, iph->saddr, | |
31 | + iph->tos, skb->dev)) | |
32 | 32 | goto drop; |
33 | 33 | } |
34 | 34 | return dst_input(skb); |