net: sched: ensure tc flower reoffload takes filter ref
authorJohn Hurley <john.hurley@netronome.com>
Tue, 2 Apr 2019 22:53:20 +0000 (23:53 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 5 Apr 2019 00:19:43 +0000 (17:19 -0700)
commit95e27a4da6143ad8a0c908215a0f402031b9ebf3
treed9dc04a1fe9225526b1520be020a608c7b208100
parent847d44efad07c4e4e37eddd8cdfea3bc9a5df51b
net: sched: ensure tc flower reoffload takes filter ref

Recent changes to TC flower remove the requirement for rtnl lock when
accessing and modifying filters. Refcounts now ensure access and deletion
do not happen concurrently. However, the reoffload function which cycles
through all filters and replays them to registered hw drivers is not
protected.

Use the fl_get_next_filter() function to cycle the filters for reoffload
and ensure the ref taken by this function is put when done with each
filter.

Signed-off-by: John Hurley <john.hurley@netronome.com>
Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Vlad Buslov <vladbu@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/cls_flower.c