• Vlad Buslov's avatar
    net: sched: refactor tp insert/delete for concurrent execution · 8b64678e
    Vlad Buslov authored
    Implement unique insertion function to atomically attach tcf_proto to chain
    after verifying that no other tcf proto with specified priority exists.
    Implement delete function that verifies that tp is actually empty before
    deleting it. Use these functions to refactor cls API to account for
    concurrent tp and rule update instead of relying on rtnl lock. Add new
    'deleting' flag to tcf proto. Use it to restart search when iterating over
    tp's on chain to prevent accessing potentially inval tp->next pointer.
    
    Extend tcf proto with spinlock that is intended to be used to protect its
    data from concurrent modification instead of relying on rtnl mutex. Use it
    to protect 'deleting' flag. Add lockdep macros to validate that lock is
    held when accessing protected fields.
    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>
    8b64678e
sch_generic.h 30 KB