mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
RDMA/netlink: Rename and remove redundant parameter from ibnl_unicast*
Netlink message header is not needed for unicast reply, hence remove it. Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Reviewed-by: Steve Wise <swise@opengridcomputing.com>
This commit is contained in:
parent
1a1c116f3d
commit
f00e646370
4 changed files with 11 additions and 17 deletions
|
@ -172,7 +172,7 @@ int iwpm_add_mapping(struct iwpm_sa_data *pm_msg, u8 nl_client)
|
||||||
goto add_mapping_error;
|
goto add_mapping_error;
|
||||||
nlmsg_request->req_buffer = pm_msg;
|
nlmsg_request->req_buffer = pm_msg;
|
||||||
|
|
||||||
ret = ibnl_unicast_wait(skb, nlh, iwpm_user_pid);
|
ret = rdma_nl_unicast_wait(skb, iwpm_user_pid);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
skb = NULL; /* skb is freed in the netlink send-op handling */
|
skb = NULL; /* skb is freed in the netlink send-op handling */
|
||||||
iwpm_user_pid = IWPM_PID_UNDEFINED;
|
iwpm_user_pid = IWPM_PID_UNDEFINED;
|
||||||
|
@ -248,7 +248,7 @@ int iwpm_add_and_query_mapping(struct iwpm_sa_data *pm_msg, u8 nl_client)
|
||||||
goto query_mapping_error;
|
goto query_mapping_error;
|
||||||
nlmsg_request->req_buffer = pm_msg;
|
nlmsg_request->req_buffer = pm_msg;
|
||||||
|
|
||||||
ret = ibnl_unicast_wait(skb, nlh, iwpm_user_pid);
|
ret = rdma_nl_unicast_wait(skb, iwpm_user_pid);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
skb = NULL; /* skb is freed in the netlink send-op handling */
|
skb = NULL; /* skb is freed in the netlink send-op handling */
|
||||||
err_str = "Unable to send a nlmsg";
|
err_str = "Unable to send a nlmsg";
|
||||||
|
@ -308,7 +308,7 @@ int iwpm_remove_mapping(struct sockaddr_storage *local_addr, u8 nl_client)
|
||||||
if (ret)
|
if (ret)
|
||||||
goto remove_mapping_error;
|
goto remove_mapping_error;
|
||||||
|
|
||||||
ret = ibnl_unicast_wait(skb, nlh, iwpm_user_pid);
|
ret = rdma_nl_unicast_wait(skb, iwpm_user_pid);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
skb = NULL; /* skb is freed in the netlink send-op handling */
|
skb = NULL; /* skb is freed in the netlink send-op handling */
|
||||||
iwpm_user_pid = IWPM_PID_UNDEFINED;
|
iwpm_user_pid = IWPM_PID_UNDEFINED;
|
||||||
|
|
|
@ -597,7 +597,7 @@ static int send_mapinfo_num(u32 mapping_num, u8 nl_client, int iwpm_pid)
|
||||||
&mapping_num, IWPM_NLA_MAPINFO_SEND_NUM);
|
&mapping_num, IWPM_NLA_MAPINFO_SEND_NUM);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto mapinfo_num_error;
|
goto mapinfo_num_error;
|
||||||
ret = ibnl_unicast(skb, nlh, iwpm_pid);
|
ret = rdma_nl_unicast(skb, iwpm_pid);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
skb = NULL;
|
skb = NULL;
|
||||||
err_str = "Unable to send a nlmsg";
|
err_str = "Unable to send a nlmsg";
|
||||||
|
@ -626,7 +626,7 @@ static int send_nlmsg_done(struct sk_buff *skb, u8 nl_client, int iwpm_pid)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
nlh->nlmsg_type = NLMSG_DONE;
|
nlh->nlmsg_type = NLMSG_DONE;
|
||||||
ret = ibnl_unicast(skb, (struct nlmsghdr *)skb->data, iwpm_pid);
|
ret = rdma_nl_unicast(skb, iwpm_pid);
|
||||||
if (ret)
|
if (ret)
|
||||||
pr_warn("%s Unable to send a nlmsg\n", __func__);
|
pr_warn("%s Unable to send a nlmsg\n", __func__);
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
@ -239,25 +239,23 @@ static void rdma_nl_rcv(struct sk_buff *skb)
|
||||||
mutex_unlock(&rdma_nl_mutex);
|
mutex_unlock(&rdma_nl_mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
int ibnl_unicast(struct sk_buff *skb, struct nlmsghdr *nlh,
|
int rdma_nl_unicast(struct sk_buff *skb, u32 pid)
|
||||||
__u32 pid)
|
|
||||||
{
|
{
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
err = netlink_unicast(nls, skb, pid, MSG_DONTWAIT);
|
err = netlink_unicast(nls, skb, pid, MSG_DONTWAIT);
|
||||||
return (err < 0) ? err : 0;
|
return (err < 0) ? err : 0;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(ibnl_unicast);
|
EXPORT_SYMBOL(rdma_nl_unicast);
|
||||||
|
|
||||||
int ibnl_unicast_wait(struct sk_buff *skb, struct nlmsghdr *nlh,
|
int rdma_nl_unicast_wait(struct sk_buff *skb, __u32 pid)
|
||||||
__u32 pid)
|
|
||||||
{
|
{
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
err = netlink_unicast(nls, skb, pid, 0);
|
err = netlink_unicast(nls, skb, pid, 0);
|
||||||
return (err < 0) ? err : 0;
|
return (err < 0) ? err : 0;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(ibnl_unicast_wait);
|
EXPORT_SYMBOL(rdma_nl_unicast_wait);
|
||||||
|
|
||||||
int ibnl_multicast(struct sk_buff *skb, struct nlmsghdr *nlh,
|
int ibnl_multicast(struct sk_buff *skb, struct nlmsghdr *nlh,
|
||||||
unsigned int group, gfp_t flags)
|
unsigned int group, gfp_t flags)
|
||||||
|
|
|
@ -56,22 +56,18 @@ int ibnl_put_attr(struct sk_buff *skb, struct nlmsghdr *nlh,
|
||||||
/**
|
/**
|
||||||
* Send the supplied skb to a specific userspace PID.
|
* Send the supplied skb to a specific userspace PID.
|
||||||
* @skb: The netlink skb
|
* @skb: The netlink skb
|
||||||
* @nlh: Header of the netlink message to send
|
|
||||||
* @pid: Userspace netlink process ID
|
* @pid: Userspace netlink process ID
|
||||||
* Returns 0 on success or a negative error code.
|
* Returns 0 on success or a negative error code.
|
||||||
*/
|
*/
|
||||||
int ibnl_unicast(struct sk_buff *skb, struct nlmsghdr *nlh,
|
int rdma_nl_unicast(struct sk_buff *skb, u32 pid);
|
||||||
__u32 pid);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send, with wait/1 retry, the supplied skb to a specific userspace PID.
|
* Send, with wait/1 retry, the supplied skb to a specific userspace PID.
|
||||||
* @skb: The netlink skb
|
* @skb: The netlink skb
|
||||||
* @nlh: Header of the netlink message to send
|
|
||||||
* @pid: Userspace netlink process ID
|
* @pid: Userspace netlink process ID
|
||||||
* Returns 0 on success or a negative error code.
|
* Returns 0 on success or a negative error code.
|
||||||
*/
|
*/
|
||||||
int ibnl_unicast_wait(struct sk_buff *skb, struct nlmsghdr *nlh,
|
int rdma_nl_unicast_wait(struct sk_buff *skb, __u32 pid);
|
||||||
__u32 pid);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send the supplied skb to a netlink group.
|
* Send the supplied skb to a netlink group.
|
||||||
|
|
Loading…
Add table
Reference in a new issue