Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4564598pxj; Wed, 12 May 2021 08:17:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyEt4RajEzoOONScpdRf6EvLiprM9ECOSALXstHeRKdDvmqFLJb/yubH3XTHIDDFunuSvry X-Received: by 2002:a17:907:628a:: with SMTP id nd10mr38720677ejc.326.1620832642642; Wed, 12 May 2021 08:17:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620832642; cv=none; d=google.com; s=arc-20160816; b=jeogCT1qm7EhOZ6w2WUMckSqjVjn97gbyV4tFPZNxHvulJ+p/NV/Rfk7fQ7SBE72s1 KrVO4axPPOo1FS937hTD/4eH3u9S53ZNBdjkbb9ZDLJ1R6maVzxIOOqofBg3pgngFNRn oSH4dUJfS9zcUexU3E2pNaoYzyR3f7xztEi7ETCd3EiLojc3y6Yls05LtZJXzgtehS8X 1dXFuvvYY1rNA3wj5bgccjRAgxwxya6UQ9BJS7s9g4rw/yslLN0GtCTDCJuWE8xJfVLW z3jaqOkzBKCSu/4wbdoE++x5WEy4xPeh8tN6s3knzIYBYfcCtVj21wOc8FOPlApdrXI6 hH0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=iV7T33Vtxl8OW9VxUwrColI/1TfV3hFC2GUowduaIs4=; b=YWWgygYQt1bN4tpD0DOe3yDZGqP/Bj39AbulI70rI+yEm/jTwoD6Mma0Ad25lwCLcK vebuddryA698b3Hcemjk7qkHtfEsX/SuAIrsJFX/ULiVtUaiYmqAdfKDFrFg/Co0SJDT oPfLfDAIHPzROukU8ilLQlKtC52Bz13Bp8JOJ20HVBUXZQ+mhY/DOCmqeAKKISi1MIv+ 1ugWyVXGpT8QV91bAPt3Q6QBINUMM4rPRd5SGLSQjzJjpCkScT70PAaS2EdxmsFHSgVb LD0CTS3Kcd1LhMXush9UW1TQs0YTiVd0ViZqKMiVCu3dmZo/MORFQyrPsRQV/zGlReaf 03kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tKDSHwMM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e21si11709eds.204.2021.05.12.08.16.58; Wed, 12 May 2021 08:17:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tKDSHwMM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234225AbhELPQQ (ORCPT + 99 others); Wed, 12 May 2021 11:16:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:59200 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232821AbhELPGd (ORCPT ); Wed, 12 May 2021 11:06:33 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4C99461441; Wed, 12 May 2021 15:01:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620831678; bh=SNDeB7Z6P2MY6QJujyykjpUFebnKf0w2LNOHf3T2JXw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tKDSHwMMN0I5EG7ETWGWYUqae/3hCPEOFJiGFypm99mMEpWT4P2Uw7jr2CnC5RdHc sXu8un8dQO6okD+4DqZtWj32ZhntKoG10Jl2zH9tB07RW6s1TbYgcxmMG6FSJN4aJx 98td2TnDmuuzv461MzNghIYaHn1nhBUcCm2NAMFo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Potnuri Bharat Teja , Jason Gunthorpe , Sasha Levin Subject: [PATCH 5.4 216/244] RDMA/cxgb4: add missing qpid increment Date: Wed, 12 May 2021 16:49:47 +0200 Message-Id: <20210512144749.909259806@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144743.039977287@linuxfoundation.org> References: <20210512144743.039977287@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Potnuri Bharat Teja [ 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 Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- drivers/infiniband/hw/cxgb4/resource.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/cxgb4/resource.c b/drivers/infiniband/hw/cxgb4/resource.c index 5c95c789f302..e800e8e8bed5 100644 --- a/drivers/infiniband/hw/cxgb4/resource.c +++ b/drivers/infiniband/hw/cxgb4/resource.c @@ -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; -- 2.30.2