]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitc2e1cf8e8417a0afadbcdf3b5c9f7e969ca1cc3a
tree4ca9abdf57ceb33140b15af79270320c8ab24482
parent7facd5cd4a8103f747b73e27ed55c8130eb89f76
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