1. 22 8月, 2018 2 次提交
    • C
      net_sched: remove unnecessary ops->delete() · 97a3f84f
      Cong Wang 提交于
      All ops->delete() wants is getting the tn->idrinfo, but we already
      have tc_action before calling ops->delete(), and tc_action has
      a pointer ->idrinfo.
      
      More importantly, each type of action does the same thing, that is,
      just calling tcf_idr_delete_index().
      
      So it can be just removed.
      
      Fixes: b409074e ("net: sched: add 'delete' function to action ops")
      Cc: Jiri Pirko <jiri@mellanox.com>
      Cc: Vlad Buslov <vladbu@mellanox.com>
      Signed-off-by: NCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      97a3f84f
    • C
      net_sched: improve and refactor tcf_action_put_many() · edfaf94f
      Cong Wang 提交于
      tcf_action_put_many() is mostly called to clean up actions on
      failure path, but tcf_action_put_many(&actions[acts_deleted]) is
      used in the ugliest way: it passes a slice of the array and
      uses an additional NULL at the end to avoid out-of-bound
      access.
      
      acts_deleted is completely unnecessary since we can teach
      tcf_action_put_many() scan the whole array and checks against
      NULL pointer. Which also means tcf_action_delete() should
      set deleted action pointers to NULL to avoid double free.
      
      Fixes: 90b73b77 ("net: sched: change action API to use array of pointers to actions")
      Cc: Jiri Pirko <jiri@mellanox.com>
      Cc: Vlad Buslov <vladbu@mellanox.com>
      Signed-off-by: NCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      edfaf94f
  2. 31 7月, 2018 1 次提交
    • P
      net/sched: user-space can't set unknown tcfa_action values · 802bfb19
      Paolo Abeni 提交于
      Currently, when initializing an action, the user-space can specify
      and use arbitrary values for the tcfa_action field. If the value
      is unknown by the kernel, is implicitly threaded as TC_ACT_UNSPEC.
      
      This change explicitly checks for unknown values at action creation
      time, and explicitly convert them to TC_ACT_UNSPEC. No functional
      changes are introduced, but this will allow introducing tcfa_action
      values not exposed to user-space in a later patch.
      
      Note: we can't use the above to hide TC_ACT_REDIRECT from user-space,
      as the latter is already part of uAPI.
      
      v3 -> v4:
       - use an helper to check for action validity (JiriP)
       - emit an extack for invalid actions (JiriP)
      v4 -> v5:
       - keep messages on a single line, drop net_warn (Marcelo)
      Signed-off-by: NPaolo Abeni <pabeni@redhat.com>
      Acked-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      802bfb19
  3. 28 7月, 2018 1 次提交
  4. 12 7月, 2018 1 次提交
  5. 08 7月, 2018 11 次提交
  6. 23 5月, 2018 1 次提交
    • V
      net: sched: don't disable bh when accessing action idr · 290aa0ad
      Vlad Buslov 提交于
      Initial net_device implementation used ingress_lock spinlock to synchronize
      ingress path of device. This lock was used in both process and bh context.
      In some code paths action map lock was obtained while holding ingress_lock.
      Commit e1e992e5 ("[NET_SCHED] protect action config/dump from irqs")
      modified actions to always disable bh, while using action map lock, in
      order to prevent deadlock on ingress_lock in softirq. This lock was removed
      from net_device, so disabling bh, while accessing action map, is no longer
      necessary.
      
      Replace all action idr spinlock usage with regular calls that do not
      disable bh.
      Signed-off-by: NVlad Buslov <vladbu@mellanox.com>
      Acked-by: NJamal Hadi Salim <jhs@mojatatu.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      290aa0ad
  7. 28 3月, 2018 1 次提交
  8. 27 3月, 2018 1 次提交
    • C
      net sched actions: fix dumping which requires several messages to user space · 734549eb
      Craig Dillabaugh 提交于
      Fixes a bug in the tcf_dump_walker function that can cause some actions
      to not be reported when dumping a large number of actions. This issue
      became more aggrevated when cookies feature was added. In particular
      this issue is manifest when large cookie values are assigned to the
      actions and when enough actions are created that the resulting table
      must be dumped in multiple batches.
      
      The number of actions returned in each batch is limited by the total
      number of actions and the memory buffer size.  With small cookies
      the numeric limit is reached before the buffer size limit, which avoids
      the code path triggering this bug. When large cookies are used buffer
      fills before the numeric limit, and the erroneous code path is hit.
      
      For example after creating 32 csum actions with the cookie
      aaaabbbbccccdddd
      
      $ tc actions ls action csum
      total acts 26
      
          action order 0: csum (tcp) action continue
          index 1 ref 1 bind 0
          cookie aaaabbbbccccdddd
      
          .....
      
          action order 25: csum (tcp) action continue
          index 26 ref 1 bind 0
          cookie aaaabbbbccccdddd
      total acts 6
      
          action order 0: csum (tcp) action continue
          index 28 ref 1 bind 0
          cookie aaaabbbbccccdddd
      
          ......
      
          action order 5: csum (tcp) action continue
          index 32 ref 1 bind 0
          cookie aaaabbbbccccdddd
      
      Note that the action with index 27 is omitted from the report.
      
      Fixes: 4b3550ef ("[NET_SCHED]: Use nla_nest_start/nla_nest_end")"
      Signed-off-by: NCraig Dillabaugh <cdillaba@mojatatu.com>
      Acked-by: NJamal Hadi Salim <jhs@mojatatu.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      734549eb
  9. 24 3月, 2018 1 次提交
  10. 10 3月, 2018 2 次提交
  11. 05 3月, 2018 1 次提交
  12. 17 2月, 2018 11 次提交
  13. 13 2月, 2018 1 次提交
  14. 07 2月, 2018 5 次提交