]> git.baikalelectronics.ru Git - kernel.git/commit
mlxsw: spectrum_span: Only update mirroring agents if present
authorIdo Schimmel <idosch@mellanox.com>
Thu, 20 Feb 2020 07:07:52 +0000 (09:07 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 20 Feb 2020 18:04:34 +0000 (10:04 -0800)
commite95288fbc74d99d2773bffd0d5ee9dfd9da24537
tree27a745b2249af410c3fccb4753581f3e31c33fd7
parent621b24265867e526a05b6980f6dc5ac4d8747b46
mlxsw: spectrum_span: Only update mirroring agents if present

In order not to needlessly schedule the work item that updates the
mirroring agents, only schedule it if there are any mirroring agents
present.

This is done by adding an atomic counter that counts the active
mirroring agents.

It is incremented / decremented whenever a mirroring agent is created /
destroyed. It is read before scheduling the work item and in the
devlink-resource occupancy callback.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c