summaryrefslogtreecommitdiff
path: root/drivers/infiniband/core/counters.c
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@mellanox.com>2019-09-12 18:49:56 +0300
committerJason Gunthorpe <jgg@mellanox.com>2019-09-13 22:59:51 +0300
commit75c66515e4fea4e9bb488b6125e014220f846c61 (patch)
treea7a79ca9a05da74fd3fd74b1c8c3e1cb2901c167 /drivers/infiniband/core/counters.c
parent1ba7c8f800586805c409f5b1ff1803318a41933a (diff)
parentf74c2bb98776e2de508f4d607cd519873065118e (diff)
downloadlinux-75c66515e4fea4e9bb488b6125e014220f846c61.tar.xz
Merge tag 'v5.3-rc8' into rdma.git for-next
To resolve dependencies in following patches mlx5_ib.h conflict resolved by keeing both hunks Linux 5.3-rc8 Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband/core/counters.c')
-rw-r--r--drivers/infiniband/core/counters.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/infiniband/core/counters.c b/drivers/infiniband/core/counters.c
index 61fcb3a31340..680ad27f497d 100644
--- a/drivers/infiniband/core/counters.c
+++ b/drivers/infiniband/core/counters.c
@@ -149,13 +149,11 @@ static bool auto_mode_match(struct ib_qp *qp, struct rdma_counter *counter,
struct auto_mode_param *param = &counter->mode.param;
bool match = true;
- if (rdma_is_kernel_res(&counter->res) != rdma_is_kernel_res(&qp->res))
+ if (!rdma_is_visible_in_pid_ns(&qp->res))
return false;
- /* Ensure that counter belong to right PID */
- if (!rdma_is_kernel_res(&counter->res) &&
- !rdma_is_kernel_res(&qp->res) &&
- (task_pid_vnr(counter->res.task) != current->pid))
+ /* Ensure that counter belongs to the right PID */
+ if (task_pid_nr(counter->res.task) != task_pid_nr(qp->res.task))
return false;
if (auto_mask & RDMA_COUNTER_MASK_QP_TYPE)
@@ -424,7 +422,7 @@ static struct ib_qp *rdma_counter_get_qp(struct ib_device *dev, u32 qp_num)
return qp;
err:
- rdma_restrack_put(&qp->res);
+ rdma_restrack_put(res);
return NULL;
}