]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
RDMA/counter: Allow manually bind QPs with different pids to same counter
authorMark Zhang <markz@mellanox.com>
Thu, 2 Jul 2020 08:29:33 +0000 (11:29 +0300)
committerThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Fri, 4 Sep 2020 19:30:01 +0000 (16:30 -0300)
BugLink: https://bugs.launchpad.net/bugs/1892899
[ Upstream commit cbeb7d896c0f296451ffa7b67e7706786b8364c8 ]

In manual mode allow bind user QPs with different pids to same counter,
since this is allowed in auto mode.
Bind kernel QPs and user QPs to the same counter are not allowed.

Fixes: 1bd8e0a9d0fd ("RDMA/counter: Allow manual mode configuration support")
Link: https://lore.kernel.org/r/20200702082933.424537-4-leon@kernel.org
Signed-off-by: Mark Zhang <markz@mellanox.com>
Reviewed-by: Maor Gottlieb <maorg@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
drivers/infiniband/core/counters.c

index 42809f612c2c4b9d11a23b0478161987e658b3d2..f454d63008d69e9649dea1a15426b1efdb29c353 100644 (file)
@@ -487,7 +487,7 @@ int rdma_counter_bind_qpn(struct ib_device *dev, u8 port,
                goto err;
        }
 
-       if (counter->res.task != qp->res.task) {
+       if (rdma_is_kernel_res(&counter->res) != rdma_is_kernel_res(&qp->res)) {
                ret = -EINVAL;
                goto err_task;
        }