diff options
author | Maor Gottlieb <maorg@mellanox.com> | 2017-08-27 09:19:11 +0300 |
---|---|---|
committer | Saeed Mahameed <saeedm@mellanox.com> | 2017-09-26 20:52:03 +0300 |
commit | bd71b08ec2ee4504bcc3b37a9283ce15e93dfacd (patch) | |
tree | 7bfff28b77ff1a56eebb0455c3ce55d14676e76c /drivers/net/ethernet/mellanox/mlx5/core/fs_core.h | |
parent | c7784b1c8ab3f44dc2e643a8feb77584792c9108 (diff) | |
download | linux-bd71b08ec2ee4504bcc3b37a9283ce15e93dfacd.tar.bz2 |
net/mlx5: Support multiple updates of steering rules in parallel
Most of the time spent on adding new flow steering rule
is executing the firmware command.
The most common action is adding a new flow steering entry.
In order to enhance the update rate we parallelize the
commands by doing the following:
1) Replace the mutex lock with readers-writers semaphore and take
the write lock only when necessary (e.g. allocating a new flow
table entry index or adding a node to the parent's children list).
When we try to find a suitable child in the parent's children list
(e.g. search for flow group with the same match_criteria of the rule)
then we only take the read lock.
2) Add versioning mechanism - each steering entity (FT, FG, FTE, DST)
will have an incremental version. The version is increased when the
entity is changed (e.g. when a new FTE was added to FG - the FG's
version is increased).
Versioning is used in order to determine if the last traverse of an
entity's children is valid or a rescan under write lock is required.
This support improves the insertion rate of steering rules
from ~5k/sec to ~40k/sec.
Signed-off-by: Maor Gottlieb <maorg@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx5/core/fs_core.h')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/fs_core.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.h b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.h index b5c079f35051..875b753862b0 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.h @@ -83,7 +83,9 @@ struct fs_node { struct rw_semaphore lock; atomic_t refcount; bool active; - void (*remove_func)(struct fs_node *); + void (*del_hw_func)(struct fs_node *); + void (*del_sw_func)(struct fs_node *); + atomic_t version; }; struct mlx5_flow_rule { |