• V
    net: sched: protect block offload-related fields with rw_semaphore · 4f8116c8
    Vlad Buslov 提交于
    In order to remove dependency on rtnl lock, extend tcf_block with 'cb_lock'
    rwsem and use it to protect flow_block->cb_list and related counters from
    concurrent modification. The lock is taken in read mode for read-only
    traversal of cb_list in tc_setup_cb_call() and write mode in all other
    cases. This approach ensures that:
    
    - cb_list is not changed concurrently while filters is being offloaded on
      block.
    
    - block->nooffloaddevcnt is checked while holding the lock in read mode,
      but is only changed by bind/unbind code when holding the cb_lock in write
      mode to prevent concurrent modification.
    Signed-off-by: NVlad Buslov <vladbu@mellanox.com>
    Acked-by: NJiri Pirko <jiri@mellanox.com>
    Signed-off-by: NDavid S. Miller <davem@davemloft.net>
    4f8116c8
sch_generic.h 32.0 KB