[<prev] [next>] [day] [month] [year] [list]
Message-ID: <22cff730-f1f1-8352-03a2-2180aadec88d@linux.dev>
Date: Thu, 23 Feb 2023 21:11:45 +0800
From: Zhu Yanjun <yanjun.zhu@...ux.dev>
To: Zhu Yanjun <yanjun.zhu@...el.com>, jgg@...pe.ca, leon@...nel.org,
zyjzyj2000@...il.com, linux-rdma@...r.kernel.org, parav@...dia.com,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Cc: Zhu Yanjun <yanjun.zhu@...ux.dev>
Subject: Re: [PATCHv3 3/8] RDMA/nldev: Add dellink function pointer
在 2023/2/14 14:06, Zhu Yanjun 写道:
> From: Zhu Yanjun <yanjun.zhu@...ux.dev>
>
> The newlink function pointer is added. And the sock listening on port 4791
> is added in the newlink function. So the dellink function is needed to
> remove the sock.
>
> Signed-off-by: Zhu Yanjun <yanjun.zhu@...ux.dev>
Add netdev@...r.kernel.org.
Zhu Yanjun
> ---
> drivers/infiniband/core/nldev.c | 6 ++++++
> include/rdma/rdma_netlink.h | 2 ++
> 2 files changed, 8 insertions(+)
>
> diff --git a/drivers/infiniband/core/nldev.c b/drivers/infiniband/core/nldev.c
> index d5d3e4f0de77..97a62685ed5b 100644
> --- a/drivers/infiniband/core/nldev.c
> +++ b/drivers/infiniband/core/nldev.c
> @@ -1758,6 +1758,12 @@ static int nldev_dellink(struct sk_buff *skb, struct nlmsghdr *nlh,
> return -EINVAL;
> }
>
> + if (device->link_ops) {
> + err = device->link_ops->dellink(device);
> + if (err)
> + return err;
> + }
> +
> ib_unregister_device_and_put(device);
> return 0;
> }
> diff --git a/include/rdma/rdma_netlink.h b/include/rdma/rdma_netlink.h
> index c2a79aeee113..bf9df004061f 100644
> --- a/include/rdma/rdma_netlink.h
> +++ b/include/rdma/rdma_netlink.h
> @@ -5,6 +5,7 @@
>
> #include <linux/netlink.h>
> #include <uapi/rdma/rdma_netlink.h>
> +#include <rdma/ib_verbs.h>
>
> enum {
> RDMA_NLDEV_ATTR_EMPTY_STRING = 1,
> @@ -114,6 +115,7 @@ struct rdma_link_ops {
> struct list_head list;
> const char *type;
> int (*newlink)(const char *ibdev_name, struct net_device *ndev);
> + int (*dellink)(struct ib_device *dev);
> };
>
> void rdma_link_register(struct rdma_link_ops *ops);
Powered by blists - more mailing lists