From: Masashi Honma <masashi.honma@gmail.com>
To: netdev@vger.kernel.org, netfilter-devel@vger.kernel.org,
linux-wireless@vger.kernel.org, linux-rdma@vger.kernel.org,
linux-audit@redhat.com, cluster-devel@redhat.com
Cc: davem@davemloft.net, johannes@sipsolutions.net,
pablo@netfilter.org, kaber@trash.net, kadlec@blackhole.kfki.hu,
dledford@redhat.com, sean.hefty@intel.com,
hal.rosenstock@gmail.com, paul@paul-moore.com, eparis@redhat.com,
zbr@ioremap.net, pshelar@nicira.com, ccaulfie@redhat.com,
teigland@redhat.com, bsingharora@gmail.com,
Masashi Honma <masashi.honma@gmail.com>
Subject: [RFC 4/7] infiniband: Add allocation flag to ibnl_unicast()
Date: Wed, 6 Jul 2016 09:28:33 +0900 [thread overview]
Message-ID: <1467764916-4983-5-git-send-email-masashi.honma@gmail.com> (raw)
In-Reply-To: <1467764916-4983-1-git-send-email-masashi.honma@gmail.com>
Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
---
drivers/infiniband/core/iwpm_msg.c | 6 +++---
drivers/infiniband/core/iwpm_util.c | 5 +++--
drivers/infiniband/core/iwpm_util.h | 1 +
drivers/infiniband/core/netlink.c | 4 ++--
include/rdma/rdma_netlink.h | 3 ++-
5 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/drivers/infiniband/core/iwpm_msg.c b/drivers/infiniband/core/iwpm_msg.c
index 1c41b95..4307eab 100644
--- a/drivers/infiniband/core/iwpm_msg.c
+++ b/drivers/infiniband/core/iwpm_msg.c
@@ -174,7 +174,7 @@ int iwpm_add_mapping(struct iwpm_sa_data *pm_msg, u8 nl_client)
goto add_mapping_error;
nlmsg_request->req_buffer = pm_msg;
- ret = ibnl_unicast(skb, nlh, iwpm_user_pid);
+ ret = ibnl_unicast(skb, nlh, iwpm_user_pid, GFP_ATOMIC);
if (ret) {
skb = NULL; /* skb is freed in the netlink send-op handling */
iwpm_user_pid = IWPM_PID_UNDEFINED;
@@ -251,7 +251,7 @@ int iwpm_add_and_query_mapping(struct iwpm_sa_data *pm_msg, u8 nl_client)
goto query_mapping_error;
nlmsg_request->req_buffer = pm_msg;
- ret = ibnl_unicast(skb, nlh, iwpm_user_pid);
+ ret = ibnl_unicast(skb, nlh, iwpm_user_pid, GFP_ATOMIC);
if (ret) {
skb = NULL; /* skb is freed in the netlink send-op handling */
err_str = "Unable to send a nlmsg";
@@ -312,7 +312,7 @@ int iwpm_remove_mapping(struct sockaddr_storage *local_addr, u8 nl_client)
if (ret)
goto remove_mapping_error;
- ret = ibnl_unicast(skb, nlh, iwpm_user_pid);
+ ret = ibnl_unicast(skb, nlh, iwpm_user_pid, GFP_ATOMIC);
if (ret) {
skb = NULL; /* skb is freed in the netlink send-op handling */
iwpm_user_pid = IWPM_PID_UNDEFINED;
diff --git a/drivers/infiniband/core/iwpm_util.c b/drivers/infiniband/core/iwpm_util.c
index b65e06c..6dcbb2d 100644
--- a/drivers/infiniband/core/iwpm_util.c
+++ b/drivers/infiniband/core/iwpm_util.c
@@ -609,7 +609,7 @@ static int send_mapinfo_num(u32 mapping_num, u8 nl_client, int iwpm_pid)
&mapping_num, IWPM_NLA_MAPINFO_SEND_NUM);
if (ret)
goto mapinfo_num_error;
- ret = ibnl_unicast(skb, nlh, iwpm_pid);
+ ret = ibnl_unicast(skb, nlh, iwpm_pid, GFP_ATOMIC);
if (ret) {
skb = NULL;
err_str = "Unable to send a nlmsg";
@@ -638,7 +638,8 @@ static int send_nlmsg_done(struct sk_buff *skb, u8 nl_client, int iwpm_pid)
return -ENOMEM;
}
nlh->nlmsg_type = NLMSG_DONE;
- ret = ibnl_unicast(skb, (struct nlmsghdr *)skb->data, iwpm_pid);
+ ret = ibnl_unicast(skb, (struct nlmsghdr *)skb->data, iwpm_pid,
+ GFP_ATOMIC);
if (ret)
pr_warn("%s Unable to send a nlmsg\n", __func__);
return ret;
diff --git a/drivers/infiniband/core/iwpm_util.h b/drivers/infiniband/core/iwpm_util.h
index af1fc14..0ced7f4 100644
--- a/drivers/infiniband/core/iwpm_util.h
+++ b/drivers/infiniband/core/iwpm_util.h
@@ -46,6 +46,7 @@
#include <linux/jhash.h>
#include <linux/kref.h>
#include <net/netlink.h>
+#include <net/sock.h>
#include <linux/errno.h>
#include <rdma/iw_portmap.h>
#include <rdma/rdma_netlink.h>
diff --git a/drivers/infiniband/core/netlink.c b/drivers/infiniband/core/netlink.c
index 09037a9..1451238 100644
--- a/drivers/infiniband/core/netlink.c
+++ b/drivers/infiniband/core/netlink.c
@@ -227,9 +227,9 @@ static void ibnl_rcv(struct sk_buff *skb)
}
int ibnl_unicast(struct sk_buff *skb, struct nlmsghdr *nlh,
- __u32 pid)
+ __u32 pid, gfp_t flags)
{
- return nlmsg_unicast(nls, skb, pid, gfp_any());
+ return nlmsg_unicast(nls, skb, pid, flags);
}
EXPORT_SYMBOL(ibnl_unicast);
diff --git a/include/rdma/rdma_netlink.h b/include/rdma/rdma_netlink.h
index 5852661..0bb3010 100644
--- a/include/rdma/rdma_netlink.h
+++ b/include/rdma/rdma_netlink.h
@@ -61,10 +61,11 @@ int ibnl_put_attr(struct sk_buff *skb, struct nlmsghdr *nlh,
* @skb: The netlink skb
* @nlh: Header of the netlink message to send
* @pid: Userspace netlink process ID
+ * @flags: allocation flags
* Returns 0 on success or a negative error code.
*/
int ibnl_unicast(struct sk_buff *skb, struct nlmsghdr *nlh,
- __u32 pid);
+ __u32 pid, gfp_t flags);
/**
* Send the supplied skb to a netlink group.
--
2.7.4
next prev parent reply other threads:[~2016-07-06 0:28 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-06 0:28 [RFC 0/7] netlink: Add allocation flag to netlink_unicast() Masashi Honma
2016-07-06 0:28 ` [RFC 1/7] " Masashi Honma
2016-07-06 0:28 ` [RFC 2/7] netfilter: Add allocation flag to nfnetlink_unicast() Masashi Honma
2016-07-06 0:28 ` [RFC 3/7] netlink: Add allocation flag to nlmsg_unicast() Masashi Honma
2016-07-06 0:28 ` Masashi Honma [this message]
2016-07-06 0:28 ` [RFC 5/7] net: Add allocation flag to rtnl_unicast() Masashi Honma
2016-07-08 2:56 ` Eric Dumazet
2016-07-08 3:15 ` Masashi Honma
[not found] ` <577F1AD7.8040800-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-07-08 4:00 ` Eric Dumazet
2016-07-08 3:18 ` [PATCH net-next] ipv4: do not abuse GFP_ATOMIC in inet_netconf_notify_devconf() Eric Dumazet
2016-07-08 3:46 ` [PATCH net-next] ipv6: do not abuse GFP_ATOMIC in inet6_netconf_notify_devconf() Eric Dumazet
2016-07-08 7:58 ` Nicolas Dichtel
2016-07-09 22:14 ` David Miller
2016-07-08 7:54 ` [PATCH net-next] ipv4: do not abuse GFP_ATOMIC in inet_netconf_notify_devconf() Nicolas Dichtel
2016-07-09 22:12 ` David Miller
[not found] ` <1467764916-4983-1-git-send-email-masashi.honma-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-07-06 0:28 ` [RFC 6/7] genetlink: Add allocation flag to genlmsg_unicast() Masashi Honma
2016-07-06 0:28 ` [RFC 7/7] genetlink: Add allocation flag to genlmsg_reply() Masashi Honma
2016-07-06 3:22 ` [RFC 0/7] netlink: Add allocation flag to netlink_unicast() David Miller
2016-07-09 3:54 ` Masashi Honma
2016-07-07 0:35 ` Masashi Honma
[not found] ` <20160708160821.GA2048@redhat.com>
[not found] ` <20160708160821.GA2048-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-07-09 3:52 ` Masashi Honma
2016-07-09 3:59 ` [PATCH v2 net-next] rtnl: Add GFP flag argument to rtnl_unicast() Masashi Honma
2016-07-11 20:01 ` David Miller
2016-07-12 4:23 ` Masashi Honma
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=1467764916-4983-5-git-send-email-masashi.honma@gmail.com \
--to=masashi.honma@gmail.com \
--cc=bsingharora@gmail.com \
--cc=ccaulfie@redhat.com \
--cc=cluster-devel@redhat.com \
--cc=davem@davemloft.net \
--cc=dledford@redhat.com \
--cc=eparis@redhat.com \
--cc=hal.rosenstock@gmail.com \
--cc=johannes@sipsolutions.net \
--cc=kaber@trash.net \
--cc=kadlec@blackhole.kfki.hu \
--cc=linux-audit@redhat.com \
--cc=linux-rdma@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
--cc=paul@paul-moore.com \
--cc=pshelar@nicira.com \
--cc=sean.hefty@intel.com \
--cc=teigland@redhat.com \
--cc=zbr@ioremap.net \
/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).