1. 10 7月, 2015 5 次提交
    • Y
      tcp: update congestion state first before raising cwnd · b20a3fa3
      Yuchung Cheng 提交于
      The congestion state and cwnd can be updated in the wrong order.
      For example, upon receiving a dubious ACK, we incorrectly raise
      the cwnd first (tcp_may_raise_cwnd()/tcp_cong_avoid()) because
      the state is still Open, then enter recovery state to reduce cwnd.
      
      For another example, if the ACK indicates spurious timeout or
      retransmits, we first revert the cwnd reduction and congestion
      state back to Open state.  But we don't raise the cwnd even though
      the ACK does not indicate any congestion.
      
      To fix this problem we should first call tcp_fastretrans_alert() to
      process the dubious ACK and update the congestion state, then call
      tcp_may_raise_cwnd() that raises cwnd based on the current state.
      Signed-off-by: NYuchung Cheng <ycheng@google.com>
      Signed-off-by: NNeal Cardwell <ncardwell@google.com>
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NNandita Dukkipati <nanditad@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b20a3fa3
    • Y
      tcp: do not slow start when cwnd equals ssthresh · 76174004
      Yuchung Cheng 提交于
      In the original design slow start is only used to raise cwnd
      when cwnd is stricly below ssthresh. It makes little sense
      to slow start when cwnd == ssthresh: especially
      when hystart has set ssthresh in the initial ramp, or after
      recovery when cwnd resets to ssthresh. Not doing so will
      also help reduce the buffer bloat slightly.
      Signed-off-by: NYuchung Cheng <ycheng@google.com>
      Signed-off-by: NNeal Cardwell <ncardwell@google.com>
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NNandita Dukkipati <nanditad@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      76174004
    • Y
      tcp: add tcp_in_slow_start helper · 071d5080
      Yuchung Cheng 提交于
      Add a helper to test the slow start condition in various congestion
      control modules and other places. This is to prepare a slight improvement
      in policy as to exactly when to slow start.
      Signed-off-by: NYuchung Cheng <ycheng@google.com>
      Signed-off-by: NNeal Cardwell <ncardwell@google.com>
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NNandita Dukkipati <nanditad@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      071d5080
    • A
      net: skb_defer_rx_timestamp should check for phydev before setting up classify · 1007f59d
      Alexander Duyck 提交于
      This change makes it so that the call skb_defer_rx_timestamp will first
      check for a phydev before going in and manipulating the skb->data and
      skb->len values.  By doing this we can avoid unnecessary work on network
      devices that don't support phydev.  As a result we reduce the total
      instruction count needed to process this on most devices.
      Signed-off-by: NAlexander Duyck <alexander.h.duyck@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1007f59d
    • J
      tcp: v1 always send a quick ack when quickacks are enabled · 2251ae46
      Jon Maxwell 提交于
      V1 of this patch contains Eric Dumazet's suggestion to move the per
      dst RTAX_QUICKACK check into tcp_in_quickack_mode(). Thanks Eric.
      
      I ran some tests and after setting the "ip route change quickack 1"
      knob there were still many delayed ACKs sent. This occured
      because when icsk_ack.quick=0 the !icsk_ack.pingpong value is
      subsequently ignored as tcp_in_quickack_mode() checks both these
      values. The condition for a quick ack to trigger requires
      that both icsk_ack.quick != 0 and icsk_ack.pingpong=0. Currently
      only icsk_ack.pingpong is controlled by the knob. But the
      icsk_ack.quick value changes dynamically depending on heuristics.
      The crux of the matter is that delayed acks still cannot be entirely
      disabled even with the RTAX_QUICKACK per dst knob enabled. This
      patch ensures that a quick ack is always sent when the RTAX_QUICKACK
      per dst knob is turned on.
      
      The "ip route change quickack 1" knob was recently added to enable
      quickacks. It was modeled around the TCP_QUICKACK setsockopt() option.
      This issue is that even with "ip route change quickack 1" enabled
      we still see delayed ACKs under some conditions. It would be nice
      to be able to completely disable delayed ACKs.
      
      Here is an example:
      
      # netstat -s|grep dela
          3 delayed acks sent
      
      For all routes enable the knob
      
      # ip route change quickack 1
      
      Generate some traffic across a slow link and we still see the delayed
      acks.
      
      # netstat -s|grep dela
          106 delayed acks sent
          1 delayed acks further delayed because of locked socket
      
      The issue is that both the "ip route change quickack 1" knob and
      the TCP_QUICKACK option set the icsk_ack.pingpong variable to 0.
      However at the business end in the __tcp_ack_snd_check() routine,
      tcp_in_quickack_mode() checks that both icsk_ack.quick != 0
      and icsk_ack.pingpong=0 in order to trigger a quickack. As
      icsk_ack.quick is determined by heuristics it can be 0. When
      that occurs the icsk_ack.pingpong value is ignored and a delayed
      ACK is sent regardless.
      
      This patch moves the RTAX_QUICKACK per dst check into the
      tcp_in_quickack_mode() routine which ensures that a quickack is
      always sent when the quickack knob is enabled for that dst.
      Signed-off-by: NJon Maxwell <jmaxwell37@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2251ae46
  2. 09 7月, 2015 29 次提交
  3. 04 7月, 2015 5 次提交
  4. 03 7月, 2015 1 次提交