OSDN Git Service

net: sched: flower: refactor fl_change
authorVlad Buslov <vladbu@mellanox.com>
Thu, 21 Mar 2019 13:17:34 +0000 (15:17 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 21 Mar 2019 21:32:17 +0000 (14:32 -0700)
commit620da4860827e1d0ddc7b941d43920c19314de0e
tree4ca9abdf57ceb33140b15af79270320c8ab24482
parente474619a2498c57f7f0ed8b4abb29d6c62e2393b
net: sched: flower: refactor fl_change

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: Vlad Buslov <vladbu@mellanox.com>
Reviewed-by: Stefano Brivio <sbrivio@redhat.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/cls_flower.c