提交 cd14e9b7 编写于 作者: M Martin KaFai Lau 提交者: David S. Miller

net: Postpone skb_clear_delivery_time() until knowing the skb is delivered locally

The previous patches handled the delivery_time in the ingress path
before the routing decision is made.  This patch can postpone clearing
delivery_time in a skb until knowing it is delivered locally and also
set the (rcv) timestamp if needed.  This patch moves the
skb_clear_delivery_time() from dev.c to ip_local_deliver_finish()
and ip6_input_finish().
Signed-off-by: NMartin KaFai Lau <kafai@fb.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 80fcec67
...@@ -5220,10 +5220,8 @@ static int __netif_receive_skb_core(struct sk_buff **pskb, bool pfmemalloc, ...@@ -5220,10 +5220,8 @@ static int __netif_receive_skb_core(struct sk_buff **pskb, bool pfmemalloc,
goto out; goto out;
} }
if (skb_skip_tc_classify(skb)) { if (skb_skip_tc_classify(skb))
skb_clear_delivery_time(skb);
goto skip_classify; goto skip_classify;
}
if (pfmemalloc) if (pfmemalloc)
goto skip_taps; goto skip_taps;
...@@ -5252,14 +5250,12 @@ static int __netif_receive_skb_core(struct sk_buff **pskb, bool pfmemalloc, ...@@ -5252,14 +5250,12 @@ static int __netif_receive_skb_core(struct sk_buff **pskb, bool pfmemalloc,
goto another_round; goto another_round;
if (!skb) if (!skb)
goto out; goto out;
skb_clear_delivery_time(skb);
nf_skip_egress(skb, false); nf_skip_egress(skb, false);
if (nf_ingress(skb, &pt_prev, &ret, orig_dev) < 0) if (nf_ingress(skb, &pt_prev, &ret, orig_dev) < 0)
goto out; goto out;
} else }
#endif #endif
skb_clear_delivery_time(skb);
skb_reset_redirect(skb); skb_reset_redirect(skb);
skip_classify: skip_classify:
if (pfmemalloc && !skb_pfmemalloc_protocol(skb)) if (pfmemalloc && !skb_pfmemalloc_protocol(skb))
......
...@@ -226,6 +226,7 @@ void ip_protocol_deliver_rcu(struct net *net, struct sk_buff *skb, int protocol) ...@@ -226,6 +226,7 @@ void ip_protocol_deliver_rcu(struct net *net, struct sk_buff *skb, int protocol)
static int ip_local_deliver_finish(struct net *net, struct sock *sk, struct sk_buff *skb) static int ip_local_deliver_finish(struct net *net, struct sock *sk, struct sk_buff *skb)
{ {
skb_clear_delivery_time(skb);
__skb_pull(skb, skb_network_header_len(skb)); __skb_pull(skb, skb_network_header_len(skb));
rcu_read_lock(); rcu_read_lock();
......
...@@ -459,6 +459,7 @@ void ip6_protocol_deliver_rcu(struct net *net, struct sk_buff *skb, int nexthdr, ...@@ -459,6 +459,7 @@ void ip6_protocol_deliver_rcu(struct net *net, struct sk_buff *skb, int nexthdr,
static int ip6_input_finish(struct net *net, struct sock *sk, struct sk_buff *skb) static int ip6_input_finish(struct net *net, struct sock *sk, struct sk_buff *skb)
{ {
skb_clear_delivery_time(skb);
rcu_read_lock(); rcu_read_lock();
ip6_protocol_deliver_rcu(net, skb, 0, false); ip6_protocol_deliver_rcu(net, skb, 0, false);
rcu_read_unlock(); rcu_read_unlock();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册