aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python
diff options
context:
space:
mode:
authorVivien Didelot <[email protected]>2017-11-03 19:05:22 -0400
committerDavid S. Miller <[email protected]>2017-11-05 22:31:38 +0900
commit8e5bf9759a06be2251fa96cfd8b412f1808c62f9 (patch)
treeb328e0e1df8dd864946ef0a17f5b25310fa4f3cd /tools/perf/scripts/python
parent49463b7f2da1a115404b02c5533bc2c2125833a3 (diff)
net: dsa: simplify tree reference counting
DSA trees have a refcount used to automatically free the dsa_switch_tree structure once there is no switch devices inside of it. The refcount is incremented when a switch is added to the tree, and decremented when it is removed from it. But because of kref_init, the refcount is also incremented at initialization, and when looking up the tree from the list for symmetry. Thus the current code stores the number of switches plus one, and makes the switch registration more complex. To simplify the switch registration function, we reset the refcount to zero after initialization and don't increment it when looking up a tree. Signed-off-by: Vivien Didelot <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions