1. 23 Sep, 2016 7 commits
    • Eric Dumazet's avatar
      net_sched: sch_fq: account for schedule/timers drifts · fefa569a
      Eric Dumazet authored
      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: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fefa569a
    • Bert Kenward's avatar
      sfc: check async completer is !NULL before calling · 429baa6f
      Bert Kenward authored
      Add a NULL check before calling asynchronous MCDI completion functions
      during device removal.
      
      Fixes: 7014d7f6 ("sfc: allow asynchronous MCDI without completion function")
      Signed-off-by: default avatarBert Kenward <bkenward@solarflare.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      429baa6f
    • David S. Miller's avatar
      Merge branch 'sctp-fix-gap-ack-blocks' · 88e4f759
      David S. Miller authored
      Marcelo Ricardo Leitner says:
      
      ====================
      sctp: fix the handling of SACK Gap Ack blocks
      
      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: default avatarDavid Laight <David.Laight@ACULAB.COM>
      Reported-by: default avatarDavid Laight <David.Laight@ACULAB.COM>
      Signed-off-by: default avatarMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      88e4f759
    • Marcelo Ricardo Leitner's avatar
      sctp: improve how SSN, TSN and ASCONF serial are compared · 182691d0
      Marcelo Ricardo Leitner authored
      Make it similar to time_before() macros:
      - easier to understand
      - make use of typecheck() to avoid working on unexpected variable types
        (made the issue on previous patch visible)
      - for _[lg]te versions, slighly faster, as the compiler used to generate
        a sequence of cmp/je/cmp/js instructions and now it's sub/test/jle
        (for _lte):
      
      Before, for sctp_outq_sack:
      	if (primary->cacc.changeover_active) {
          1f01:	80 b9 84 02 00 00 00 	cmpb   $0x0,0x284(%rcx)
          1f08:	74 6e                	je     1f78 <sctp_outq_sack+0xe8>
      		u8 clear_cycling = 0;
      
      		if (TSN_lte(primary->cacc.next_tsn_at_change, sack_ctsn)) {
          1f0a:	8b 81 80 02 00 00    	mov    0x280(%rcx),%eax
      	return ((s) - (t)) & TSN_SIGN_BIT;
      }
      
      static inline int TSN_lte(__u32 s, __u32 t)
      {
      	return ((s) == (t)) || (((s) - (t)) & TSN_SIGN_BIT);
          1f10:	8b 7d bc             	mov    -0x44(%rbp),%edi
          1f13:	39 c7                	cmp    %eax,%edi
          1f15:	74 25                	je     1f3c <sctp_outq_sack+0xac>
          1f17:	39 f8                	cmp    %edi,%eax
          1f19:	78 21                	js     1f3c <sctp_outq_sack+0xac>
      			primary->cacc.changeover_active = 0;
      
      After:
      	if (primary->cacc.changeover_active) {
          1ee7:	80 b9 84 02 00 00 00 	cmpb   $0x0,0x284(%rcx)
          1eee:	74 73                	je     1f63 <sctp_outq_sack+0xf3>
      		u8 clear_cycling = 0;
      
      		if (TSN_lte(primary->cacc.next_tsn_at_change, sack_ctsn)) {
          1ef0:	8b 81 80 02 00 00    	mov    0x280(%rcx),%eax
          1ef6:	2b 45 b4             	sub    -0x4c(%rbp),%eax
          1ef9:	85 c0                	test   %eax,%eax
          1efb:	7e 26                	jle    1f23 <sctp_outq_sack+0xb3>
      			primary->cacc.changeover_active = 0;
      
      *_lt() generated pretty much the same code.
      Tested with gcc (GCC) 6.1.1 20160621.
      
      This patch also removes SSN_lte as it is not used and cleanups some
      comments.
      Signed-off-by: default avatarMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      182691d0
    • Marcelo Ricardo Leitner's avatar
      sctp: fix the handling of SACK Gap Ack blocks · a3007446
      Marcelo Ricardo Leitner authored
      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: default avatarDavid Laight <David.Laight@ACULAB.COM>
      Reported-by: default avatarDavid Laight <David.Laight@ACULAB.COM>
      Signed-off-by: default avatarMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a3007446
    • WANG Cong's avatar
      net_sched: check NULL on error path in route4_change() · 21641c2e
      WANG Cong authored
      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: default avatarkbuild test robot <fengguang.wu@intel.com>
      Cc: Jamal Hadi Salim <jhs@mojatatu.com>
      Signed-off-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
      Acked-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      21641c2e
    • David S. Miller's avatar
  2. 22 Sep, 2016 33 commits