netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Liu Jian <liujian56@huawei.com>
To: <linux-rdma@vger.kernel.org>, <linux-s390@vger.kernel.org>,
	<netdev@vger.kernel.org>
Cc: <jgg@ziepe.ca>, <leon@kernel.org>, <zyjzyj2000@gmail.com>,
	<wenjia@linux.ibm.com>, <jaka@linux.ibm.com>,
	<alibuda@linux.alibaba.com>, <tonylu@linux.alibaba.com>,
	<guwen@linux.alibaba.com>, <davem@davemloft.net>,
	<edumazet@google.com>, <kuba@kernel.org>, <pabeni@redhat.com>,
	<liujian56@huawei.com>
Subject: [PATCH net-next 1/4] rdma/device: export ib_device_get_netdev()
Date: Fri, 9 Aug 2024 16:31:45 +0800	[thread overview]
Message-ID: <20240809083148.1989912-2-liujian56@huawei.com> (raw)
In-Reply-To: <20240809083148.1989912-1-liujian56@huawei.com>

Many drivers do not implement the ib_device_ops.get_netdev callback
function; for them, use the generic helper function ib_device_get_netdev()
enough. Therefore, this patch exports ib_device_get_netdev() helper allows
it to be used in other modules.

Signed-off-by: Liu Jian <liujian56@huawei.com>
---
 drivers/infiniband/core/core_priv.h | 3 ---
 drivers/infiniband/core/device.c    | 1 +
 include/rdma/ib_verbs.h             | 2 ++
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/infiniband/core/core_priv.h b/drivers/infiniband/core/core_priv.h
index dd7715ba9fd1..693b3ded69e1 100644
--- a/drivers/infiniband/core/core_priv.h
+++ b/drivers/infiniband/core/core_priv.h
@@ -87,9 +87,6 @@ typedef void (*roce_netdev_callback)(struct ib_device *device, u32 port,
 typedef bool (*roce_netdev_filter)(struct ib_device *device, u32 port,
 				   struct net_device *idev, void *cookie);
 
-struct net_device *ib_device_get_netdev(struct ib_device *ib_dev,
-					u32 port);
-
 void ib_enum_roce_netdev(struct ib_device *ib_dev,
 			 roce_netdev_filter filter,
 			 void *filter_cookie,
diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c
index 0290aca18d26..d25923285447 100644
--- a/drivers/infiniband/core/device.c
+++ b/drivers/infiniband/core/device.c
@@ -2263,6 +2263,7 @@ struct net_device *ib_device_get_netdev(struct ib_device *ib_dev,
 
 	return res;
 }
+EXPORT_SYMBOL(ib_device_get_netdev);
 
 /**
  * ib_device_get_by_netdev - Find an IB device associated with a netdev
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index 6c5712ae559d..0fe252c32d60 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -4453,6 +4453,8 @@ struct net_device *ib_get_net_dev_by_params(struct ib_device *dev, u32 port,
 					    const struct sockaddr *addr);
 int ib_device_set_netdev(struct ib_device *ib_dev, struct net_device *ndev,
 			 unsigned int port);
+struct net_device *ib_device_get_netdev(struct ib_device *ib_dev,
+					u32 port);
 struct ib_wq *ib_create_wq(struct ib_pd *pd,
 			   struct ib_wq_init_attr *init_attr);
 int ib_destroy_wq_user(struct ib_wq *wq, struct ib_udata *udata);
-- 
2.34.1


  reply	other threads:[~2024-08-09  8:34 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-09  8:31 [PATCH net-next 0/4] Make SMC-R can work with rxe devices Liu Jian
2024-08-09  8:31 ` Liu Jian [this message]
2024-08-09  8:31 ` [PATCH net-next 2/4] net/smc: use ib_device_get_netdev() helper to get netdev info Liu Jian
2024-08-09 14:59   ` Dust Li
2024-08-12  2:07     ` liujian (CE)
2024-08-12  2:43       ` Dust Li
2024-08-09  8:31 ` [PATCH net-next 3/4] net/smc: fix one NULL pointer dereference in smc_ib_is_sg_need_sync() Liu Jian
2024-08-09 10:01   ` Wen Gu
2024-08-09 14:59   ` Dust Li
2024-08-12  3:30   ` D. Wythe
2024-08-09  8:31 ` [PATCH net-next 4/4] RDMA/rxe: Set queue pair cur_qp_state when being queried Liu Jian
2024-08-09 11:06   ` Zhu Yanjun
2024-08-11  8:31     ` Leon Romanovsky
     [not found]       ` <bb0a5de8-f2d3-4276-ada4-f788f574b798@linux.dev>
2024-08-11 10:24         ` Zhu Yanjun
2024-08-11  6:05 ` [PATCH net-next 0/4] Make SMC-R can work with rxe devices Jan Karcher
2024-08-20 13:16 ` Jan Karcher
2024-08-21  1:03   ` Dust Li
2024-08-24 10:04     ` liujian (CE)
2024-08-26 19:04       ` Jan Karcher
2024-08-28 10:29         ` liujian (CE)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240809083148.1989912-2-liujian56@huawei.com \
    --to=liujian56@huawei.com \
    --cc=alibuda@linux.alibaba.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=guwen@linux.alibaba.com \
    --cc=jaka@linux.ibm.com \
    --cc=jgg@ziepe.ca \
    --cc=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=tonylu@linux.alibaba.com \
    --cc=wenjia@linux.ibm.com \
    --cc=zyjzyj2000@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).