Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp278327pxb; Thu, 25 Feb 2021 02:11:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJyv8Ptz096uJrps8C707Zx8OEKNDQ64OM6eqMHsDnx6lVA4XOba7hkYa+sW2Yp54jqkcQuR X-Received: by 2002:aa7:c80e:: with SMTP id a14mr2119122edt.295.1614247892356; Thu, 25 Feb 2021 02:11:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614247892; cv=none; d=google.com; s=arc-20160816; b=HEK/kXvKiAHVClPNm/iV8IvUgBHAQdfg/Hz+kcR1cvSKHg5kn1A/r5yUz8LZQwzjtX AJBMFGs23QNw0901MieohD5MsQJ5qDOBJ4C8JRcAiKZOqjf7zt3ofMLISdmfawtnwmoa gU8iJkvzSQ3jXY3QTvYbXm3KdmUV6nJ1OZQfevQkRixYR4mm247kYgsWkS2wbMuVnxP2 jiMVxO4lOQCrvriyg992jWK0IpS/Ws7immgmGGfckgqt1Qeqq7BbGwUUZl658tFo4TV1 3Mv9qIzuomTJZeF6oTLaqbCSl1N4UI9nJqULkNijalM3ypEwWCLQb/ap++BCTwDp2xxv LPug== 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=ekL+smMJXaPiS4whd4EpmI3tyg2RH1/F19+9Xmg3c9k=; b=vBO/Rd1ZxQoP/ouPZKnahzBY90P7GtW/XxENO8Y2BuIKGfTU5pHlKsEpv3apPvDgVR rfJVTEtcoggI4aFDLkofbOsuaGI1e8/PEW+ptE2Fen5Bh7XSbb7aThj4TS9IcBo/7ifs Je99EXBBJKPuTf5BQBJTQnDMbTdc6Cv12VQh2rrsQ6aY52Yq9AVJLI0vihyip9590J76 5pTgBuevu3IGN0d+4sgWJ0bbPToxHpUm2or2vYE79Q4fBemrV+p6CMjjA+KR1cKQfLJR RzWlkgeEKBdFqZBthXIdFvDmx8frqExC9+y+a8MOSEUPuFae80kwmp9FaOXn2mnvW8Ys oU0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fKNeXq3V; 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 w13si2824769edd.262.2021.02.25.02.11.09; Thu, 25 Feb 2021 02:11:32 -0800 (PST) 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=fKNeXq3V; 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 S233902AbhBYKKS (ORCPT + 99 others); Thu, 25 Feb 2021 05:10:18 -0500 Received: from mail.kernel.org ([198.145.29.99]:34816 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229952AbhBYJ63 (ORCPT ); Thu, 25 Feb 2021 04:58:29 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6917364F15; Thu, 25 Feb 2021 09:54:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614246886; bh=F5dNUQCQPjvQKHYZpDY8N1PxUf0xDdf6dfwdaTei5fM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fKNeXq3VyRnGWl1N/MfEDf3f1WV7K8fCyKYpOm+v9c5iZW2Th3DeNQk8UfvQPjwJ/ +rMC2IGF9iZMVO62WmQytOwOj4GxPjklQnKjLJl7R+1j6+LyNtNi80JkJAqeCSE/vy z2QmrsAFDuSYKY1M6Mw4E87MUzxln+eMGssvcVdw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christoph Hellwig , Jason Gunthorpe , Krishnamraju Eraparaju Subject: [PATCH 5.10 03/23] RDMA: Lift ibdev_to_node from rds to common code Date: Thu, 25 Feb 2021 10:53:34 +0100 Message-Id: <20210225092516.697889791@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210225092516.531932232@linuxfoundation.org> References: <20210225092516.531932232@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: Christoph Hellwig commit 8ecfca68dc4cbee1272a0161e3f2fb9387dc6930 upstream. Lift the ibdev_to_node from rds to common code and document it. Link: https://lore.kernel.org/r/20201106181941.1878556-4-hch@lst.de Signed-off-by: Christoph Hellwig Signed-off-by: Jason Gunthorpe Cc: Krishnamraju Eraparaju Signed-off-by: Greg Kroah-Hartman --- include/rdma/ib_verbs.h | 13 +++++++++++++ net/rds/ib.h | 7 ------- 2 files changed, 13 insertions(+), 7 deletions(-) --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h @@ -4643,6 +4643,19 @@ static inline struct ib_device *rdma_dev } /** + * ibdev_to_node - return the NUMA node for a given ib_device + * @dev: device to get the NUMA node for. + */ +static inline int ibdev_to_node(struct ib_device *ibdev) +{ + struct device *parent = ibdev->dev.parent; + + if (!parent) + return NUMA_NO_NODE; + return dev_to_node(parent); +} + +/** * rdma_device_to_drv_device - Helper macro to reach back to driver's * ib_device holder structure from device pointer. * --- a/net/rds/ib.h +++ b/net/rds/ib.h @@ -264,13 +264,6 @@ struct rds_ib_device { int *vector_load; }; -static inline int ibdev_to_node(struct ib_device *ibdev) -{ - struct device *parent; - - parent = ibdev->dev.parent; - return parent ? dev_to_node(parent) : NUMA_NO_NODE; -} #define rdsibdev_to_node(rdsibdev) ibdev_to_node(rdsibdev->dev) /* bits for i_ack_flags */