diff options
author | Peter Pan(潘卫平) <panweiping3@gmail.com> | 2014-09-24 10:17:02 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-09-28 16:37:57 -0400 |
commit | 155c6e1ad4a778cad7f9fe6695afc91b3f5fe1ac (patch) | |
tree | f769a4d224724a1de9f99c85e45322b9d7e29ddc /net/ipv4/tcp_input.c | |
parent | cd7d8498c9a5d510c64db38d9f4f4fbc41790f09 (diff) |
tcp: use tcp_flags in tcp_data_queue()
This patch is a cleanup which follows the idea in commit e11ecddf5128 (tcp: use
TCP_SKB_CB(skb)->tcp_flags in input path),
and it may reduce register pressure since skb->cb[] access is fast,
bacause skb is probably in a register.
v2: remove variable th
v3: reword the changelog
Signed-off-by: Weiping Pan <panweiping3@gmail.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_input.c')
-rw-r--r-- | net/ipv4/tcp_input.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 2c0af90231cf..5073eefa6fae 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -4344,7 +4344,6 @@ err: | |||
4344 | 4344 | ||
4345 | static void tcp_data_queue(struct sock *sk, struct sk_buff *skb) | 4345 | static void tcp_data_queue(struct sock *sk, struct sk_buff *skb) |
4346 | { | 4346 | { |
4347 | const struct tcphdr *th = tcp_hdr(skb); | ||
4348 | struct tcp_sock *tp = tcp_sk(sk); | 4347 | struct tcp_sock *tp = tcp_sk(sk); |
4349 | int eaten = -1; | 4348 | int eaten = -1; |
4350 | bool fragstolen = false; | 4349 | bool fragstolen = false; |
@@ -4353,7 +4352,7 @@ static void tcp_data_queue(struct sock *sk, struct sk_buff *skb) | |||
4353 | goto drop; | 4352 | goto drop; |
4354 | 4353 | ||
4355 | skb_dst_drop(skb); | 4354 | skb_dst_drop(skb); |
4356 | __skb_pull(skb, th->doff * 4); | 4355 | __skb_pull(skb, tcp_hdr(skb)->doff * 4); |
4357 | 4356 | ||
4358 | TCP_ECN_accept_cwr(tp, skb); | 4357 | TCP_ECN_accept_cwr(tp, skb); |
4359 | 4358 | ||
@@ -4397,7 +4396,7 @@ queue_and_out: | |||
4397 | tp->rcv_nxt = TCP_SKB_CB(skb)->end_seq; | 4396 | tp->rcv_nxt = TCP_SKB_CB(skb)->end_seq; |
4398 | if (skb->len) | 4397 | if (skb->len) |
4399 | tcp_event_data_recv(sk, skb); | 4398 | tcp_event_data_recv(sk, skb); |
4400 | if (th->fin) | 4399 | if (TCP_SKB_CB(skb)->tcp_flags & TCPHDR_FIN) |
4401 | tcp_fin(sk); | 4400 | tcp_fin(sk); |
4402 | 4401 | ||
4403 | if (!skb_queue_empty(&tp->out_of_order_queue)) { | 4402 | if (!skb_queue_empty(&tp->out_of_order_queue)) { |