1. 23 9月, 2016 16 次提交
    • D
      rxrpc: Add a tracepoint to log injected Rx packet loss · 89b475ab
      David Howells 提交于
      Add a tracepoint to log received packets that get discarded due to Rx
      packet loss.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      89b475ab
    • D
      rxrpc: Add data Tx tracepoint and adjust Tx ACK tracepoint · be832aec
      David Howells 提交于
      Add a tracepoint to log transmission of DATA packets (including loss
      injection).
      
      Adjust the ACK transmission tracepoint to include the packet serial number
      and to line this up with the DATA transmission display.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      be832aec
    • D
      rxrpc: Add a tracepoint for the call timer · fc7ab6d2
      David Howells 提交于
      Add a tracepoint to log call timer initiation, setting and expiry.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      fc7ab6d2
    • D
      rxrpc: Don't call the tx_ack tracepoint if don't generate an ACK · b86e218e
      David Howells 提交于
      rxrpc_send_call_packet() is invoking the tx_ack tracepoint before it checks
      whether there's an ACK to transmit (another thread may jump in and transmit
      it).
      
      Fix this by only invoking the tracepoint if we get a valid ACK to transmit.
      
      Further, only allocate a serial number if we're going to actually transmit
      something.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      b86e218e
    • D
      rxrpc: Pass the last Tx packet marker in the annotation buffer · 70790dbe
      David Howells 提交于
      When the last packet of data to be transmitted on a call is queued, tx_top
      is set and then the RXRPC_CALL_TX_LAST flag is set.  Unfortunately, this
      leaves a race in the ACK processing side of things because the flag affects
      the interpretation of tx_top and also allows us to start receiving reply
      data before we've finished transmitting.
      
      To fix this, make the following changes:
      
       (1) rxrpc_queue_packet() now sets a marker in the annotation buffer
           instead of setting the RXRPC_CALL_TX_LAST flag.
      
       (2) rxrpc_rotate_tx_window() detects the marker and sets the flag in the
           same context as the routines that use it.
      
       (3) rxrpc_end_tx_phase() is simplified to just shift the call state.
           The Tx window must have been rotated before calling to discard the
           last packet.
      
       (4) rxrpc_receiving_reply() is added to handle the arrival of the first
           DATA packet of a reply to a client call (which is an implicit ACK of
           the Tx phase).
      
       (5) The last part of rxrpc_input_ack() is reordered to perform Tx
           rotation, then soft-ACK application and then to end the phase if we've
           rotated the last packet.  In the event of a terminal ACK, the soft-ACK
           application will be skipped as nAcks should be 0.
      
       (6) rxrpc_input_ackall() now has to rotate as well as ending the phase.
      
      In addition:
      
       (7) Alter the transmit tracepoint to log the rotation of the last packet.
      
       (8) Remove the no-longer relevant queue_reqack tracepoint note.  The
           ACK-REQUESTED packet header flag is now set as needed when we actually
           transmit the packet and may vary by retransmission.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      70790dbe
    • D
      rxrpc: Fix call timer · 01a88f7f
      David Howells 提交于
      Fix the call timer in the following ways:
      
       (1) If call->resend_at or call->ack_at are before or equal to the current
           time, then ignore that timeout.
      
       (2) If call->expire_at is before or equal to the current time, then don't
           set the timer at all (possibly we should queue the call).
      
       (3) Don't skip modifying the timer if timer_pending() is true.  This
           indicates that the timer is working, not that it has expired and is
           running/waiting to run its expiry handler.
      
      Also call rxrpc_set_timer() to start the call timer going rather than
      calling add_timer().
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      01a88f7f
    • D
      rxrpc: Fix accidental cancellation of scheduled resend by ACK parser · be8aa338
      David Howells 提交于
      When rxrpc_input_soft_acks() is parsing the soft-ACKs from an ACK packet,
      it updates the Tx packet annotations in the annotation buffer.  If a
      soft-ACK is an ACK, then we overwrite unack'd, nak'd or to-be-retransmitted
      states and that is fine; but if the soft-ACK is an NACK, we overwrite the
      to-be-retransmitted with a nak - which isn't.
      
      Instead, we need to let any scheduled retransmission stand if the packet
      was NAK'd.
      
      Note that we don't reissue a resend if the annotation is in the
      to-be-retransmitted state because someone else must've scheduled the
      resend already.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      be8aa338
    • D
      rxrpc: Need to start the resend timer on initial transmission · dfc3da44
      David Howells 提交于
      When a DATA packet has its initial transmission, we may need to start or
      adjust the resend timer.  Without this we end up relying on being sent a
      NACK to initiate the resend.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      dfc3da44
    • D
      rxrpc: Use before_eq() and friends to compare serial numbers · 98dafac5
      David Howells 提交于
      before_eq() and friends should be used to compare serial numbers (when not
      checking for (non)equality) rather than casting to int, subtracting and
      checking the result.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      98dafac5
    • D
      rxrpc: Should be using ktime_add_ms() not ktime_add_ns() · 90bd684d
      David Howells 提交于
      ktime_add_ms() should be used to add the resend time (in ms) rather than
      ktime_add_ns().
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      90bd684d
    • D
      rxrpc: Make sure sendmsg() is woken on call completion · c0d058c2
      David Howells 提交于
      Make sure that sendmsg() gets woken up if the call it is waiting for
      completes abnormally.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      c0d058c2
    • D
      rxrpc: Don't send an ACK at the end of service call response transmission · 9aff212b
      David Howells 提交于
      Don't send an IDLE ACK at the end of the transmission of the response to a
      service call.  The service end resends DATA packets until the client sends an
      ACK that hard-acks all the send data.  At that point, the call is complete.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      9aff212b
    • D
      rxrpc: Preset timestamp on Tx sk_buffs · b24d2891
      David Howells 提交于
      Set the timestamp on sk_buffs holding packets to be transmitted before
      queueing them because the moment the packet is on the queue it can be seen
      by the retransmission algorithm - which may see a completely random
      timestamp.
      
      If the retransmission algorithm sees such a timestamp, it may retransmit
      the packet and, in future, tell the congestion management algorithm that
      the retransmit timer expired.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      b24d2891
    • E
      net_sched: sch_fq: account for schedule/timers drifts · fefa569a
      Eric Dumazet 提交于
      It looks like the following patch can make FQ very precise, even in VM
      or stressed hosts. It matters at high pacing rates.
      
      We take into account the difference between the time that was programmed
      when last packet was sent, and current time (a drift of tens of usecs is
      often observed)
      
      Add an EWMA of the unthrottle latency to help diagnostics.
      
      This latency is the difference between current time and oldest packet in
      delayed RB-tree. This accounts for the high resolution timer latency,
      but can be different under stress, as fq_check_throttled() can be
      opportunistically be called from a dequeue() called after an enqueue()
      for a different flow.
      
      Tested:
      // Start a 10Gbit flow
      $ netperf --google-pacing-rate 1250000000 -H lpaa24 -l 10000 -- -K bbr &
      
      Before patch :
      $ sar -n DEV 10 5 | grep eth0 | grep Average
      Average:         eth0  17106.04 756876.84   1102.75 1119049.02      0.00      0.00      0.52
      
      After patch :
      $ sar -n DEV 10 5 | grep eth0 | grep Average
      Average:         eth0  17867.00 800245.90   1151.77 1183172.12      0.00      0.00      0.52
      
      A new iproute2 tc can output the 'unthrottle latency' :
      
      $ tc -s qd sh dev eth0 | grep latency
        0 gc, 0 highprio, 32490767 throttled, 2382 ns latency
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      fefa569a
    • M
      sctp: fix the handling of SACK Gap Ack blocks · a3007446
      Marcelo Ricardo Leitner 提交于
      sctp_acked() is using 32bit arithmetics on 16bits vars, via TSN_lte()
      macros, which is weird and confusing.
      
      Once the offset to ctsn is calculated, all wrapping is already handled
      and thus to verify the Gap Ack blocks we can just use pure
      less/big-or-equal than checks.
      
      Also, rename gap variable to tsn_offset, so it's more meaningful, as
      it doesn't point to any gap at all.
      
      Even so, I don't think this discrepancy resulted in any practical bug.
      
      This patch is a preparation for the next one, which will introduce
      typecheck() for TSN_lte() macros and would cause a compile error here.
      Suggested-by: NDavid Laight <David.Laight@ACULAB.COM>
      Reported-by: NDavid Laight <David.Laight@ACULAB.COM>
      Signed-off-by: NMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a3007446
    • W
      net_sched: check NULL on error path in route4_change() · 21641c2e
      WANG Cong 提交于
      On error path in route4_change(), 'f' could be NULL,
      so we should check NULL before calling tcf_exts_destroy().
      
      Fixes: b9a24bb7 ("net_sched: properly handle failure case of tcf_exts_init()")
      Reported-by: Nkbuild test robot <fengguang.wu@intel.com>
      Cc: Jamal Hadi Salim <jhs@mojatatu.com>
      Signed-off-by: NCong Wang <xiyou.wangcong@gmail.com>
      Acked-by: NJamal Hadi Salim <jhs@mojatatu.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      21641c2e
  2. 22 9月, 2016 23 次提交
  3. 21 9月, 2016 1 次提交
    • N
      vti6: fix input path · 63c43787
      Nicolas Dichtel 提交于
      Since commit 1625f452, vti6 is broken, all input packets are dropped
      (LINUX_MIB_XFRMINNOSTATES is incremented).
      
      XFRM_TUNNEL_SKB_CB(skb)->tunnel.ip6 is set by vti6_rcv() before calling
      xfrm6_rcv()/xfrm6_rcv_spi(), thus we cannot set to NULL that value in
      xfrm6_rcv_spi().
      
      A new function xfrm6_rcv_tnl() that enables to pass a value to
      xfrm6_rcv_spi() is added, so that xfrm6_rcv() is not touched (this function
      is used in several handlers).
      
      CC: Alexey Kodanev <alexey.kodanev@oracle.com>
      Fixes: 1625f452 ("net/xfrm_input: fix possible NULL deref of tunnel.ip6->parms.i_key")
      Signed-off-by: NNicolas Dichtel <nicolas.dichtel@6wind.com>
      Signed-off-by: NSteffen Klassert <steffen.klassert@secunet.com>
      63c43787