Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1247742pxa; Thu, 20 Aug 2020 06:42:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxkTy3Wsh4tg7DOgCPinfmTTgCQmKIR7jQIDawT337aUbKoWC8Y0b24/BvEQRA+BhbdyNxy X-Received: by 2002:aa7:dd91:: with SMTP id g17mr3068607edv.186.1597930949992; Thu, 20 Aug 2020 06:42:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597930949; cv=none; d=google.com; s=arc-20160816; b=QsMgNWoknftXBr/nHNXCo0QzytHNAJVQBHQL0+DbEX4dWCche7Vms9Z9dB2TvmEN0I qtlQPROX774R26MHLDB1zoH94luZKxypbogyTCCsBY7kV6ZSt6bcKwAQcV3KJG0N56CC vp/c0Bla24HsCZkG82w23DpWYZPV0x3nf3ifP3/3jkl6dRRolsl4R311lvRUAZuOSsV6 0e+W8GbUxG8ZzEwF8CCm8GM96PvLBISd+tYv/5DZHU1XoGeI0xKmf63gjNYOvl0ygviX xjoU52rkr1fJbZVtxWgqTJ7ej1tEpWdHuiLIa0UNKm1DGFeTWMlkowJgFoMFr+m36CGH cNFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=TriyTwig/DWQcHyG9mEu4FZPweI8ZbfYhlxsIrGRDpI=; b=KY54GgbH43rw9yZGWCr/LmycmhpoQQ96GQ2M6f9KW0c4mJ1n1NNcBc+NkvwyfJoALt s30TRtJhWiJ+odnrWeBQjcGtwlwS5igRwGNaMUBpCqw/rM8TW8XdgX7JGhPZ4eRDLKmt 7z017LeVhl+YKRQyTcdndSQW93o5l0QQINbxA8TwZxBpDhapZ+dNY+f1zqS1EmXtbVmV nUpGioObZJrQFM0XL5Nkj+YEWKXOjNKTAekfhzfEa78qDGQQAQXUXJqTzDKVipQhonzf +KFKBw3RQxUw+insWGHig2lG5NvEiX0rLCBzhk0ilEvLgJeWbzn8L01/yhUKltHMvYG3 +ivA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=soBzjiq+; 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=fail (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 cq22si1327115edb.609.2020.08.20.06.42.05; Thu, 20 Aug 2020 06:42:29 -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=@kernel.org header.s=default header.b=soBzjiq+; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729468AbgHTNl0 (ORCPT + 99 others); Thu, 20 Aug 2020 09:41:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:40204 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727030AbgHTJaG (ORCPT ); Thu, 20 Aug 2020 05:30:06 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F419A22CB2; Thu, 20 Aug 2020 09:30:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597915806; bh=ATlZv6UUf8gC4J7JiJhspjarlU5BxTsDmslsrQf6BAo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=soBzjiq+aD5tG9K/qeEWv0MrOBkLupP+GwA9aWW4TryXR17KGJkEmEDtxpFLgtlRC w9gdn8RUBVZW6RQCE9lCLws2vjUrNRH+sCM1DlXU9qt7WOJadf3whxU4thH4dEcUc7 NIJSM99idF2SHA1nFrcN+dbE5Mz9d5stB9hQtfo8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mark Zhang , Maor Gottlieb , Leon Romanovsky , Jason Gunthorpe , Sasha Levin Subject: [PATCH 5.8 141/232] RDMA/counter: Allow manually bind QPs with different pids to same counter Date: Thu, 20 Aug 2020 11:19:52 +0200 Message-Id: <20200820091619.657415014@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200820091612.692383444@linuxfoundation.org> References: <20200820091612.692383444@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mark Zhang [ 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 Reviewed-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- drivers/infiniband/core/counters.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/core/counters.c b/drivers/infiniband/core/counters.c index 6deb1901fbd02..417ebf4d8ba9b 100644 --- a/drivers/infiniband/core/counters.c +++ b/drivers/infiniband/core/counters.c @@ -483,7 +483,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; } -- 2.25.1