]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
RDMA/cxgb4: add missing qpid increment
authorPotnuri Bharat Teja <bharat@chelsio.com>
Thu, 15 Apr 2021 15:14:22 +0000 (20:44 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 May 2021 08:50:13 +0000 (10:50 +0200)
[ Upstream commit 3a6684385928d00b29acac7658a5ae1f2a44494c ]

missing qpid increment leads to skipping few qpids while allocating QP.
This eventually leads to adapter running out of qpids after establishing
fewer connections than it actually supports.
Current patch increments the qpid correctly.

Fixes: cfdda9d76436 ("RDMA/cxgb4: Add driver for Chelsio T4 RNIC")
Link: https://lore.kernel.org/r/20210415151422.9139-1-bharat@chelsio.com
Signed-off-by: Potnuri Bharat Teja <bharat@chelsio.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/hw/cxgb4/resource.c

index 5c95c789f302dab389e529fbc926e3a0f3736a83..e800e8e8bed5aebcfcd662d6aa363c6f7343e592 100644 (file)
@@ -216,7 +216,7 @@ u32 c4iw_get_qpid(struct c4iw_rdev *rdev, struct c4iw_dev_ucontext *uctx)
                        goto out;
                entry->qid = qid;
                list_add_tail(&entry->entry, &uctx->cqids);
-               for (i = qid; i & rdev->qpmask; i++) {
+               for (i = qid + 1; i & rdev->qpmask; i++) {
                        entry = kmalloc(sizeof(*entry), GFP_KERNEL);
                        if (!entry)
                                goto out;