• Vlad Buslov's avatar
    net: sched: flower: refactor fl_change · 620da486
    Vlad Buslov authored
    As a preparation for using classifier spinlock instead of relying on
    external rtnl lock, rearrange code in fl_change. The goal is to group the
    code which changes classifier state in single block in order to allow
    following commits in this set to protect it from parallel modification with
    tp->lock. Data structures that require tp->lock protection are mask
    hashtable and filters list, and classifier handle_idr.
    
    fl_hw_replace_filter() is a sleeping function and cannot be called while
    holding a spinlock. In order to execute all sequence of changes to shared
    classifier data structures atomically, call fl_hw_replace_filter() before
    modifying them.
    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>
    620da486
cls_flower.c 63.1 KB