[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8d59994a-0c08-8c62-d23d-da3f74f57af5@gmail.com>
Date: Thu, 31 Dec 2020 09:18:52 -0700
From: David Ahern <dsahern@...il.com>
To: Leon Romanovsky <leon@...nel.org>
Cc: Patrisious Haddad <phaddad@...dia.com>,
Doug Ledford <dledford@...hat.com>,
Jason Gunthorpe <jgg@...dia.com>,
linux-netdev <netdev@...r.kernel.org>,
RDMA mailing list <linux-rdma@...r.kernel.org>
Subject: Re: [PATCH iproute2-next] rdma: Add support for the netlink extack
On 12/30/20 10:42 PM, Leon Romanovsky wrote:
> diff --git a/rdma/utils.c b/rdma/utils.c
> index 2a201aa4..927e2107 100644
> --- a/rdma/utils.c
> +++ b/rdma/utils.c
> @@ -664,7 +664,7 @@ void rd_prepare_msg(struct rd *rd, uint32_t cmd, uint32_t *seq, uint16_t flags)
>
> int rd_send_msg(struct rd *rd)
> {
> - int ret;
> + int ret, one;
>
> rd->nl = mnl_socket_open(NETLINK_RDMA);
> if (!rd->nl) {
> @@ -672,6 +672,12 @@ int rd_send_msg(struct rd *rd)
> return -ENODEV;
> }
>
> + ret = mnl_socket_setsockopt(rd->nl, NETLINK_EXT_ACK, &one, sizeof(one));
> + if (ret < 0) {
> + pr_err("Failed to set socket option with err %d\n", ret);
> + goto err;
> + }
> +
> ret = mnl_socket_bind(rd->nl, 0, MNL_SOCKET_AUTOPID);
> if (ret < 0) {
> pr_err("Failed to bind socket with err %d\n", ret);
you should be able to use mnlu_socket_open in ./lib/mnl_utils.c
Powered by blists - more mailing lists