• Vlad Buslov's avatar
    net: sched: flower: introduce reference counting for filters · 06177558
    Vlad Buslov authored
    Extend flower filters with reference counting in order to remove dependency
    on rtnl lock in flower ops and allow to modify filters concurrently.
    Reference to flower filter can be taken/released concurrently as soon as it
    is marked as 'unlocked' by last patch in this series. Use atomic reference
    counter type to make concurrent modifications safe.
    
    Always take reference to flower filter while working with it:
    - Modify fl_get() to take reference to filter.
    - Implement tp->put() callback as fl_put() function to allow cls API to
    release reference taken by fl_get().
    - Modify fl_change() to assume that caller holds reference to fold and take
    reference to fnew.
    - Take reference to filter while using it in fl_walk().
    
    Implement helper functions to get/put filter reference counter.
    Signed-off-by: default avatarVlad Buslov <vladbu@mellanox.com>
    Reviewed-by: default avatarStefano Brivio <sbrivio@redhat.com>
    Acked-by: default avatarJiri Pirko <jiri@mellanox.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    06177558
cls_flower.c 64.4 KB