aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_input.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2015-05-23 01:22:35 -0400
committerDavid S. Miller <davem@davemloft.net>2015-05-23 01:22:35 -0400
commit36583eb54d46c36a447afd6c379839f292397429 (patch)
tree70f5399529dc2135a986947b37c655194da60e9d /net/ipv4/tcp_input.c
parentfa7912be967102cdbecd8ef172571b28eb22099e (diff)
parentcf539cbd8a81e12880735a0912de8b99f46c84fd (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts: drivers/net/ethernet/cadence/macb.c drivers/net/phy/phy.c include/linux/skbuff.h net/ipv4/tcp.c net/switchdev/switchdev.c Switchdev was a case of RTNH_H_{EXTERNAL --> OFFLOAD} renaming overlapping with net-next changes of various sorts. phy.c was a case of two changes, one adding a local variable to a function whilst the second was removing one. tcp.c overlapped a deadlock fix with the addition of new tcp_info statistic values. macb.c involved the addition of two zyncq device entries. skbuff.h involved adding back ipv4_daddr to nf_bridge_info whilst net-next changes put two other existing members of that struct into a union. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_input.c')
-rw-r--r--net/ipv4/tcp_input.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 40c435997e54..15c4536188a4 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -2695,16 +2695,21 @@ static void tcp_process_loss(struct sock *sk, int flag, bool is_dupack)
2695 struct tcp_sock *tp = tcp_sk(sk); 2695 struct tcp_sock *tp = tcp_sk(sk);
2696 bool recovered = !before(tp->snd_una, tp->high_seq); 2696 bool recovered = !before(tp->snd_una, tp->high_seq);
2697 2697
2698 if ((flag & FLAG_SND_UNA_ADVANCED) &&
2699 tcp_try_undo_loss(sk, false))
2700 return;
2701
2698 if (tp->frto) { /* F-RTO RFC5682 sec 3.1 (sack enhanced version). */ 2702 if (tp->frto) { /* F-RTO RFC5682 sec 3.1 (sack enhanced version). */
2699 /* Step 3.b. A timeout is spurious if not all data are 2703 /* Step 3.b. A timeout is spurious if not all data are
2700 * lost, i.e., never-retransmitted data are (s)acked. 2704 * lost, i.e., never-retransmitted data are (s)acked.
2701 */ 2705 */
2702 if (tcp_try_undo_loss(sk, flag & FLAG_ORIG_SACK_ACKED)) 2706 if ((flag & FLAG_ORIG_SACK_ACKED) &&
2707 tcp_try_undo_loss(sk, true))
2703 return; 2708 return;
2704 2709
2705 if (after(tp->snd_nxt, tp->high_seq) && 2710 if (after(tp->snd_nxt, tp->high_seq)) {
2706 (flag & FLAG_DATA_SACKED || is_dupack)) { 2711 if (flag & FLAG_DATA_SACKED || is_dupack)
2707 tp->frto = 0; /* Loss was real: 2nd part of step 3.a */ 2712 tp->frto = 0; /* Step 3.a. loss was real */
2708 } else if (flag & FLAG_SND_UNA_ADVANCED && !recovered) { 2713 } else if (flag & FLAG_SND_UNA_ADVANCED && !recovered) {
2709 tp->high_seq = tp->snd_nxt; 2714 tp->high_seq = tp->snd_nxt;
2710 __tcp_push_pending_frames(sk, tcp_current_mss(sk), 2715 __tcp_push_pending_frames(sk, tcp_current_mss(sk),
@@ -2729,8 +2734,6 @@ static void tcp_process_loss(struct sock *sk, int flag, bool is_dupack)
2729 else if (flag & FLAG_SND_UNA_ADVANCED) 2734 else if (flag & FLAG_SND_UNA_ADVANCED)
2730 tcp_reset_reno_sack(tp); 2735 tcp_reset_reno_sack(tp);
2731 } 2736 }
2732 if (tcp_try_undo_loss(sk, false))
2733 return;
2734 tcp_xmit_retransmit_queue(sk); 2737 tcp_xmit_retransmit_queue(sk);
2735} 2738}
2736 2739
@@ -3281,7 +3284,9 @@ static void tcp_snd_una_update(struct tcp_sock *tp, u32 ack)
3281{ 3284{
3282 u32 delta = ack - tp->snd_una; 3285 u32 delta = ack - tp->snd_una;
3283 3286
3287 u64_stats_update_begin(&tp->syncp);
3284 tp->bytes_acked += delta; 3288 tp->bytes_acked += delta;
3289 u64_stats_update_end(&tp->syncp);
3285 tp->snd_una = ack; 3290 tp->snd_una = ack;
3286} 3291}
3287 3292
@@ -3290,7 +3295,9 @@ static void tcp_rcv_nxt_update(struct tcp_sock *tp, u32 seq)
3290{ 3295{
3291 u32 delta = seq - tp->rcv_nxt; 3296 u32 delta = seq - tp->rcv_nxt;
3292 3297
3298 u64_stats_update_begin(&tp->syncp);
3293 tp->bytes_received += delta; 3299 tp->bytes_received += delta;
3300 u64_stats_update_end(&tp->syncp);
3294 tp->rcv_nxt = seq; 3301 tp->rcv_nxt = seq;
3295} 3302}
3296 3303