提交 459e9553 编写于 作者: C Christoph Hellwig 提交者: Zheng Zengkai

RDMA: Lift ibdev_to_node from rds to common code

stable inclusion
from stable-5.10.19
commit 225d207da2e1169aee30faaa71bd7cf70c7277a3
bugzilla: 50607

--------------------------------

commit 8ecfca68 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.deSigned-off-by: NChristoph Hellwig <hch@lst.de>
Signed-off-by: NJason Gunthorpe <jgg@nvidia.com>
Cc: Krishnamraju Eraparaju <krishna2@chelsio.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
上级 8e962b9b
......@@ -4642,6 +4642,19 @@ static inline struct ib_device *rdma_device_to_ibdev(struct device *device)
return coredev->owner;
}
/**
* 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.
......
......@@ -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 */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册