1. 08 6月, 2016 3 次提交
  2. 21 5月, 2016 1 次提交
    • A
      mlx5: avoid unused variable warning · e6790fd8
      Arnd Bergmann 提交于
      When CONFIG_NET_CLS_ACT is disabled, we get a new warning in the mlx5
      ethernet driver because the tc_for_each_action() loop never references
      the iterator:
      
      mellanox/mlx5/core/en_tc.c: In function 'mlx5e_stats_flower':
      mellanox/mlx5/core/en_tc.c:431:20: error: unused variable 'a' [-Werror=unused-variable]
        struct tc_action *a;
      
      This changes the dummy tc_for_each_action() macro by adding a
      cast to void, letting the compiler know that the variable is
      intentionally declared but not used here. I could not come up
      with a nicer workaround, but this seems to do the trick.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Fixes: aad7e08d ("net/mlx5e: Hardware offloaded flower filter statistics support")
      Fixes: 00175aec ("net/sched: Macro instead of CONFIG_NET_CLS_ACT ifdef")
      Acked-By: NAmir Vadai <amir@vadai.me>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e6790fd8
  3. 17 5月, 2016 1 次提交
  4. 07 4月, 2016 1 次提交
  5. 11 3月, 2016 1 次提交
  6. 26 2月, 2016 2 次提交
  7. 27 8月, 2015 1 次提交
  8. 31 7月, 2015 1 次提交
    • D
      net: sched: fix refcount imbalance in actions · 28e6b67f
      Daniel Borkmann 提交于
      Since commit 55334a5d ("net_sched: act: refuse to remove bound action
      outside"), we end up with a wrong reference count for a tc action.
      
      Test case 1:
      
        FOO="1,6 0 0 4294967295,"
        BAR="1,6 0 0 4294967294,"
        tc filter add dev foo parent 1: bpf bytecode "$FOO" flowid 1:1 \
           action bpf bytecode "$FOO"
        tc actions show action bpf
          action order 0: bpf bytecode '1,6 0 0 4294967295' default-action pipe
          index 1 ref 1 bind 1
        tc actions replace action bpf bytecode "$BAR" index 1
        tc actions show action bpf
          action order 0: bpf bytecode '1,6 0 0 4294967294' default-action pipe
          index 1 ref 2 bind 1
        tc actions replace action bpf bytecode "$FOO" index 1
        tc actions show action bpf
          action order 0: bpf bytecode '1,6 0 0 4294967295' default-action pipe
          index 1 ref 3 bind 1
      
      Test case 2:
      
        FOO="1,6 0 0 4294967295,"
        tc filter add dev foo parent 1: bpf bytecode "$FOO" flowid 1:1 action ok
        tc actions show action gact
          action order 0: gact action pass
          random type none pass val 0
           index 1 ref 1 bind 1
        tc actions add action drop index 1
          RTNETLINK answers: File exists [...]
        tc actions show action gact
          action order 0: gact action pass
           random type none pass val 0
           index 1 ref 2 bind 1
        tc actions add action drop index 1
          RTNETLINK answers: File exists [...]
        tc actions show action gact
          action order 0: gact action pass
           random type none pass val 0
           index 1 ref 3 bind 1
      
      What happens is that in tcf_hash_check(), we check tcf_common for a given
      index and increase tcfc_refcnt and conditionally tcfc_bindcnt when we've
      found an existing action. Now there are the following cases:
      
        1) We do a late binding of an action. In that case, we leave the
           tcfc_refcnt/tcfc_bindcnt increased and are done with the ->init()
           handler. This is correctly handeled.
      
        2) We replace the given action, or we try to add one without replacing
           and find out that the action at a specific index already exists
           (thus, we go out with error in that case).
      
      In case of 2), we have to undo the reference count increase from
      tcf_hash_check() in the tcf_hash_check() function. Currently, we fail to
      do so because of the 'tcfc_bindcnt > 0' check which bails out early with
      an -EPERM error.
      
      Now, while commit 55334a5d prevents 'tc actions del action ...' on an
      already classifier-bound action to drop the reference count (which could
      then become negative, wrap around etc), this restriction only accounts for
      invocations outside a specific action's ->init() handler.
      
      One possible solution would be to add a flag thus we possibly trigger
      the -EPERM ony in situations where it is indeed relevant.
      
      After the patch, above test cases have correct reference count again.
      
      Fixes: 55334a5d ("net_sched: act: refuse to remove bound action outside")
      Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
      Reviewed-by: NCong Wang <cwang@twopensource.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      28e6b67f
  9. 09 7月, 2015 2 次提交
  10. 13 2月, 2014 4 次提交
  11. 22 1月, 2014 2 次提交
  12. 20 1月, 2014 1 次提交
  13. 14 1月, 2014 2 次提交
  14. 02 1月, 2014 1 次提交
  15. 19 12月, 2013 5 次提交
  16. 01 8月, 2013 1 次提交
  17. 11 6月, 2013 1 次提交
    • E
      net_sched: add 64bit rate estimators · 45203a3b
      Eric Dumazet 提交于
      struct gnet_stats_rate_est contains u32 fields, so the bytes per second
      field can wrap at 34360Mbit.
      
      Add a new gnet_stats_rate_est64 structure to get 64bit bps/pps fields,
      and switch the kernel to use this structure natively.
      
      This structure is dumped to user space as a new attribute :
      
      TCA_STATS_RATE_EST64
      
      Old tc command will now display the capped bps (to 34360Mbit), instead
      of wrapped values, and updated tc command will display correct
      information.
      
      Old tc command output, after patch :
      
      eric:~# tc -s -d qd sh dev lo
      qdisc pfifo 8001: root refcnt 2 limit 1000p
       Sent 80868245400 bytes 1978837 pkt (dropped 0, overlimits 0 requeues 0)
       rate 34360Mbit 189696pps backlog 0b 0p requeues 0
      
      This patch carefully reorganizes "struct Qdisc" layout to get optimal
      performance on SMP.
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Cc: Ben Hutchings <bhutchings@solarflare.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      45203a3b
  18. 13 2月, 2013 1 次提交
  19. 15 1月, 2013 1 次提交
  20. 06 7月, 2011 1 次提交
  21. 12 6月, 2010 1 次提交
    • E
      pkt_sched: gen_kill_estimator() rcu fixes · c7de2cf0
      Eric Dumazet 提交于
      gen_kill_estimator() API is incomplete or not well documented, since
      caller should make sure an RCU grace period is respected before
      freeing stats_lock.
      
      This was partially addressed in commit 5d944c64
      (gen_estimator: deadlock fix), but same problem exist for all
      gen_kill_estimator() users, if lock they use is not already RCU
      protected.
      
      A code review shows xt_RATEEST.c, act_api.c, act_police.c have this
      problem. Other are ok because they use qdisc lock, already RCU
      protected.
      Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c7de2cf0
  22. 18 8月, 2009 1 次提交
  23. 29 1月, 2008 2 次提交
  24. 15 7月, 2007 1 次提交
  25. 11 7月, 2007 1 次提交
  26. 23 9月, 2006 1 次提交
    • D
      [PKT_SCHED]: Kill pkt_act.h inlining. · e9ce1cd3
      David S. Miller 提交于
      This was simply making templates of functions and mostly causing a lot
      of code duplication in the classifier action modules.
      
      We solve this more cleanly by having a common "struct tcf_common" that
      hash worker functions contained once in act_api.c can work with.
      
      Callers work with real action objects that have the common struct
      plus their module specific struct members.  You go from a common
      object to the higher level one using a "to_foo()" macro which makes
      use of container_of() to do the dirty work.
      
      This also kills off act_generic.h which was only used by act_simple.c
      and keeping it around was more work than the it's value.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e9ce1cd3