Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1247587pxa; Thu, 20 Aug 2020 06:42:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw+dzDvZKcpYRaDuq/ViZdF5wtVvQfO75jL67dcxEEDeOZKBId0ijb08qkmJ7SE7WpJIwud X-Received: by 2002:a05:6402:1a23:: with SMTP id be3mr3053663edb.138.1597930935527; Thu, 20 Aug 2020 06:42:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597930935; cv=none; d=google.com; s=arc-20160816; b=TY4dhGvHRl3SxNYW/BJNspS9AjHEMoH9Tq22hsL+3U2TVcvTl3HBLHeFOuFJ6Xs2EF BzSafN1rVp7xfMl0+bpO0b0ZXkcZaSkoq5t1gKmU5dzwLbAFWxLlugwr6IbIvx1AhstD yiXUPpITVbDd3wNAwg8u6dKC58yNL2EbwtABgj+y6wMpKYxlrn3XKJ26LlFnsaCLJ4sk 2AP7yYruCyJzWABDwMv237fs9VWn0kY4tbx31g8O7th+nexnBB6zVuVbt6WQk1ltzJAV JKz+Wn1OA7/1+yjoO/dkdLoi7fAqffJs73OayDixiTiAqmACdio9Ccb9W7EFUbN+VcHv 5aZw== 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=T/TJrsQVkcKoZpu3V+9oAZMuEmw46MEpzidQYLIb1vg=; b=OgICrz+B2IvHRjrj+4ke0qboz6kyt+YnZhIJRYrw44xeoqjJmZkAlvfnctV7cKkwYP IburBHiKS5ASSGy3byI2b8IGvDJP8pH3ftFoEZQdESuO1piBGJOvk5Ib5OOOVtL2kujr kWwUlNfDPGGJP30w8RERSgllRJZCDWkUZu33jUbR53QtgQmoSeB9EqfFAUFgnH+mmA8L bVa5F9xP8R6VUh64GXpXsgcaLKpXICl5dlr5ZvCFwpGLN/In8Gryw0EQbPCK/LvHD2N5 Zg1BUOZU24RxqsuKgKG+eEUBoXegcLZ1vm+E5VNsZZpz7627q58XvcMP9mtciAlfzk/N fVmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=VWI7xS5j; 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 z61si1277875ede.593.2020.08.20.06.41.51; Thu, 20 Aug 2020 06:42:15 -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=VWI7xS5j; 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 S1729602AbgHTNlR (ORCPT + 99 others); Thu, 20 Aug 2020 09:41:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:39106 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728131AbgHTJaF (ORCPT ); Thu, 20 Aug 2020 05:30:05 -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 7B92922CB1; Thu, 20 Aug 2020 09:30:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597915803; bh=xyDZYkyPG1JpMD3a/x9ITUBO7mLGiopl2omnRGsYpl0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VWI7xS5jfSbnsdYNFJKSZGPkUc1NIEHf0UXDleCqRkprE0+c4W/l0JR7sMceTE4Bw JcPWwa59qU96Eu1+fbydG87ODiMyqr2GB1XK1kYOJh89JW0ZMjOrAyEONekyI1+G4k zGJSyu1UIs4AtQQy2zsbPJYwhbzN7+A+AIAVFafQ= 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 140/232] RDMA/counter: Only bind user QPs in auto mode Date: Thu, 20 Aug 2020 11:19:51 +0200 Message-Id: <20200820091619.606650918@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 c9f557421e505f75da4234a6af8eff46bc08614b ] In auto mode only bind user QPs to a dynamic counter, since this feature is mainly used for system statistic and diagnostic purpose, while there's no need to counter kernel QPs so far. Fixes: 99fa331dc862 ("RDMA/counter: Add "auto" configuration mode support") Link: https://lore.kernel.org/r/20200702082933.424537-3-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 738d1faf4bba5..6deb1901fbd02 100644 --- a/drivers/infiniband/core/counters.c +++ b/drivers/infiniband/core/counters.c @@ -288,7 +288,7 @@ int rdma_counter_bind_qp_auto(struct ib_qp *qp, u8 port) struct rdma_counter *counter; int ret; - if (!qp->res.valid) + if (!qp->res.valid || rdma_is_kernel_res(&qp->res)) return 0; if (!rdma_is_port_valid(dev, port)) -- 2.25.1