aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/mlx5/main.c
diff options
context:
space:
mode:
authorMaor Gottlieb <maorg@mellanox.com>2016-08-28 14:16:33 +0300
committerDoug Ledford <dledford@redhat.com>2016-10-07 16:54:15 -0400
commitd9d4980af21df94f527caeecd35bfa4bafe38c9c (patch)
tree663aca4a8115f6ab5c6c4173c5fa4a17506b4d4a /drivers/infiniband/hw/mlx5/main.c
parentIB/mlx5: Fix coverity warning (diff)
downloadlinux-dev-d9d4980af21df94f527caeecd35bfa4bafe38c9c.tar.xz
linux-dev-d9d4980af21df94f527caeecd35bfa4bafe38c9c.zip
IB/mlx5: Increase flow table reference count in create rule
Move the reference count increasing of flow table to be in create_flow_rule, it will increase the reference count for each rule creation and not for each flow. Signed-off-by: Maor Gottlieb <maorg@mellanox.com> Signed-off-by: Leon Romanovsky <leon@kernel.org> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to '')
-rw-r--r--drivers/infiniband/hw/mlx5/main.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
index dd766d67a2f5..79f0486f2b1f 100644
--- a/drivers/infiniband/hw/mlx5/main.c
+++ b/drivers/infiniband/hw/mlx5/main.c
@@ -1776,6 +1776,7 @@ static struct mlx5_ib_flow_handler *create_flow_rule(struct mlx5_ib_dev *dev,
goto free;
}
+ ft_prio->refcount++;
handler->prio = ft_prio;
ft_prio->flow_table = ft;
@@ -1800,6 +1801,7 @@ static struct mlx5_ib_flow_handler *create_dont_trap_rule(struct mlx5_ib_dev *de
flow_attr, dst);
if (IS_ERR(handler_dst)) {
mlx5_del_flow_rule(handler->rule);
+ ft_prio->refcount--;
kfree(handler);
handler = handler_dst;
} else {
@@ -1862,6 +1864,7 @@ static struct mlx5_ib_flow_handler *create_leftovers_rule(struct mlx5_ib_dev *de
dst);
if (IS_ERR(handler_ucast)) {
mlx5_del_flow_rule(handler->rule);
+ ft_prio->refcount--;
kfree(handler);
handler = handler_ucast;
} else {
@@ -1928,7 +1931,6 @@ static struct ib_flow *mlx5_ib_create_flow(struct ib_qp *qp,
goto destroy_ft;
}
- ft_prio->refcount++;
mutex_unlock(&dev->flow_db.lock);
kfree(dst);