Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4636808pxj; Wed, 12 May 2021 09:45:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzBbcxtbqqcJkYmZgRi05Kg8brQK9+eTvfSiVNnqzCg9pdmf+r/dBqMth/qZ70hL3MWn7VP X-Received: by 2002:a05:6830:18f3:: with SMTP id d19mr18389636otf.369.1620837955451; Wed, 12 May 2021 09:45:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620837955; cv=none; d=google.com; s=arc-20160816; b=efieTpWBVGoNqpNQAdtf9NW7VijQTZBtxYIwX2awDkFgAxMREKreQDbjyWbI1/gV09 pH/iEbjBCe+8qv2RsRlylXhhiYlxKfam60YUB9XlYWfpEeFz9afLpU+0tdaHZEw1C3Ed MLhB0SRFyJ6fOL9mZ6ZENfeUKBEwBEpw3tH2xSKQDcucCPihlbbeDWZ0ZbGkKSAGVp97 i8uDAP83D9LooWQqCtF15XEW5J7hHnnnQBVYXzVnZrqftB+rJUI8n3DZFkRvqUDV6N25 xFDHMddozv9iQ5OfWyC9CBOtJPluOnSgZAcCBCOPqiR8ezFNGqKwInnajEvM1aDlfgXK 4s8Q== 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=rrXfov6hMUiukDtAtj9FLLWZE10D+yx5b9A0BMNCVonCqQIin9HAxxksuQY4cXw+4X aoAr6hEX1oRpirOLS60JXrghGg9xffWBszE43OIcXD2/Y68Ro2123EluImKU+/YTYZ1J IEgcyiRdGrm3hNceMr3tgq8k1qa1g9Ld79V/9Tv1l/m01tTl6yWLxeaJK2Wa8NqYGyzP jCTjSOi4pVEP9Nvio1UScuqmdmGje+jBVc2cMF1mPQQ1xRNebSJlq8Q5/tlcV3azf1M3 +zZ8T6SUlJVBGn4LacezRkp6CNdhJFIhm1R8j8QbAIY6/TckuRghrpLayXXoFmb1RVEk 5dQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Af2nKqjT; 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 q5si429036ook.33.2021.05.12.09.45.41; Wed, 12 May 2021 09:45:55 -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=Af2nKqjT; 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 S238878AbhELQpC (ORCPT + 99 others); Wed, 12 May 2021 12:45:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:56786 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234910AbhELPmI (ORCPT ); Wed, 12 May 2021 11:42:08 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9BD7761C7F; Wed, 12 May 2021 15:21:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620832908; bh=SNDeB7Z6P2MY6QJujyykjpUFebnKf0w2LNOHf3T2JXw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Af2nKqjTnG0aWFswibCat5q6LPFcQuz5GCwnSs8dPwT2HF28x98xdVcc/MRwXEtMB XB2PzzlbUKkK+cryvEM7PxZyMhYSXKb3m2iDaiO97ieedTDudxcELlGc1ZUksCwPZh RfYrfFp1o2H4KQjS8mjcXjNTlwOm127nfjlin+ws= 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.10 470/530] RDMA/cxgb4: add missing qpid increment Date: Wed, 12 May 2021 16:49:40 +0200 Message-Id: <20210512144835.209877155@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144819.664462530@linuxfoundation.org> References: <20210512144819.664462530@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