• Vlad Buslov's avatar
    net: sched: change tcf block reference counter type to refcount_t · cfebd7e2
    Vlad Buslov authored
    As a preparation for removing rtnl lock dependency from rules update path,
    change tcf block reference counter type to refcount_t to allow modification
    by concurrent users.
    
    In block put function perform decrement and check reference counter once to
    accommodate concurrent modification by unlocked users. After this change
    tcf_chain_put at the end of block put function is called with
    block->refcnt==0 and will deallocate block after the last chain is
    released, so there is no need to manually deallocate block in this case.
    However, if block reference counter reached 0 and there are no chains to
    release, block must still be deallocated manually.
    Signed-off-by: default avatarVlad Buslov <vladbu@mellanox.com>
    Acked-by: default avatarJiri Pirko <jiri@mellanox.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    cfebd7e2
sch_generic.h 28 KB