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 6/7] genetlink: Add allocation flag to genlmsg_unicast()
Date: Wed, 6 Jul 2016 09:28:35 +0900 [thread overview]
Message-ID: <1467764916-4983-7-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/net/gtp.c | 3 ++-
drivers/net/team/team.c | 5 +++--
drivers/net/wireless/mac80211_hwsim.c | 2 +-
fs/dlm/netlink.c | 2 +-
include/net/genetlink.h | 8 +++++---
kernel/taskstats.c | 2 +-
net/hsr/hsr_netlink.c | 6 ++++--
net/l2tp/l2tp_netlink.c | 8 +++++---
net/openvswitch/datapath.c | 3 ++-
net/tipc/netlink_compat.c | 2 +-
net/wireless/nl80211.c | 9 +++++----
11 files changed, 30 insertions(+), 20 deletions(-)
diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c
index 97e0cbc..0156abb 100644
--- a/drivers/net/gtp.c
+++ b/drivers/net/gtp.c
@@ -1210,7 +1210,8 @@ static int gtp_genl_get_pdp(struct sk_buff *skb, struct genl_info *info)
goto err_unlock_free;
rcu_read_unlock();
- return genlmsg_unicast(genl_info_net(info), skb2, info->snd_portid);
+ return genlmsg_unicast(genl_info_net(info), skb2, info->snd_portid,
+ GFP_ATOMIC);
err_unlock_free:
kfree_skb(skb2);
diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
index f9eebea..3d40b55 100644
--- a/drivers/net/team/team.c
+++ b/drivers/net/team/team.c
@@ -2194,7 +2194,8 @@ static int team_nl_cmd_noop(struct sk_buff *skb, struct genl_info *info)
genlmsg_end(msg, hdr);
- return genlmsg_unicast(genl_info_net(info), msg, info->snd_portid);
+ return genlmsg_unicast(genl_info_net(info), msg, info->snd_portid,
+ GFP_KERNEL);
err_msg_put:
nlmsg_free(msg);
@@ -2240,7 +2241,7 @@ typedef int team_nl_send_func_t(struct sk_buff *skb,
static int team_nl_send_unicast(struct sk_buff *skb, struct team *team, u32 portid)
{
- return genlmsg_unicast(dev_net(team->dev), skb, portid);
+ return genlmsg_unicast(dev_net(team->dev), skb, portid, gfp_any());
}
static int team_nl_fill_one_option_get(struct sk_buff *skb, struct team *team,
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index 382109bb..5c7bf77 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -1008,7 +1008,7 @@ static int hwsim_unicast_netgroup(struct mac80211_hwsim_data *data,
rcu_read_lock();
for_each_net_rcu(net) {
if (data->netgroup == hwsim_net_get_netgroup(net)) {
- res = genlmsg_unicast(net, skb, portid);
+ res = genlmsg_unicast(net, skb, portid, GFP_ATOMIC);
found = true;
break;
}
diff --git a/fs/dlm/netlink.c b/fs/dlm/netlink.c
index 1e6e227..c498616 100644
--- a/fs/dlm/netlink.c
+++ b/fs/dlm/netlink.c
@@ -59,7 +59,7 @@ static int send_data(struct sk_buff *skb)
genlmsg_end(skb, data);
- return genlmsg_unicast(&init_net, skb, listener_nlportid);
+ return genlmsg_unicast(&init_net, skb, listener_nlportid, GFP_NOFS);
}
static int user_cmd(struct sk_buff *skb, struct genl_info *info)
diff --git a/include/net/genetlink.h b/include/net/genetlink.h
index b107a35..5f0f2ff 100644
--- a/include/net/genetlink.h
+++ b/include/net/genetlink.h
@@ -331,10 +331,12 @@ int genlmsg_multicast_allns(struct genl_family *family,
* genlmsg_unicast - unicast a netlink message
* @skb: netlink message as socket buffer
* @portid: netlink portid of the destination socket
+ * @flags: allocation flags
*/
-static inline int genlmsg_unicast(struct net *net, struct sk_buff *skb, u32 portid)
+static inline int genlmsg_unicast(struct net *net, struct sk_buff *skb,
+ u32 portid, gfp_t flags)
{
- return nlmsg_unicast(net->genl_sock, skb, portid, 0);
+ return nlmsg_unicast(net->genl_sock, skb, portid, flags);
}
/**
@@ -344,7 +346,7 @@ static inline int genlmsg_unicast(struct net *net, struct sk_buff *skb, u32 port
*/
static inline int genlmsg_reply(struct sk_buff *skb, struct genl_info *info)
{
- return genlmsg_unicast(genl_info_net(info), skb, info->snd_portid);
+ return genlmsg_unicast(genl_info_net(info), skb, info->snd_portid, 0);
}
/**
diff --git a/kernel/taskstats.c b/kernel/taskstats.c
index b3f05ee..ecfcaff 100644
--- a/kernel/taskstats.c
+++ b/kernel/taskstats.c
@@ -140,7 +140,7 @@ static void send_cpu_listeners(struct sk_buff *skb,
if (!skb_next)
break;
}
- rc = genlmsg_unicast(&init_net, skb_cur, s->pid);
+ rc = genlmsg_unicast(&init_net, skb_cur, s->pid, GFP_KERNEL);
if (rc == -ECONNREFUSED) {
s->valid = 0;
delcount++;
diff --git a/net/hsr/hsr_netlink.c b/net/hsr/hsr_netlink.c
index d4d1617..dcc674f 100644
--- a/net/hsr/hsr_netlink.c
+++ b/net/hsr/hsr_netlink.c
@@ -351,7 +351,8 @@ static int hsr_get_node_status(struct sk_buff *skb_in, struct genl_info *info)
goto nla_put_failure;
genlmsg_end(skb_out, msg_head);
- genlmsg_unicast(genl_info_net(info), skb_out, info->snd_portid);
+ genlmsg_unicast(genl_info_net(info), skb_out, info->snd_portid,
+ GFP_KERNEL);
return 0;
@@ -433,7 +434,8 @@ static int hsr_get_node_list(struct sk_buff *skb_in, struct genl_info *info)
rcu_read_unlock();
genlmsg_end(skb_out, msg_head);
- genlmsg_unicast(genl_info_net(info), skb_out, info->snd_portid);
+ genlmsg_unicast(genl_info_net(info), skb_out, info->snd_portid,
+ GFP_KERNEL);
return 0;
diff --git a/net/l2tp/l2tp_netlink.c b/net/l2tp/l2tp_netlink.c
index 1d02e8d..5a3cc56 100644
--- a/net/l2tp/l2tp_netlink.c
+++ b/net/l2tp/l2tp_netlink.c
@@ -100,7 +100,8 @@ static int l2tp_nl_cmd_noop(struct sk_buff *skb, struct genl_info *info)
genlmsg_end(msg, hdr);
- return genlmsg_unicast(genl_info_net(info), msg, info->snd_portid);
+ return genlmsg_unicast(genl_info_net(info), msg, info->snd_portid,
+ GFP_KERNEL);
err_out:
nlmsg_free(msg);
@@ -450,7 +451,7 @@ static int l2tp_nl_cmd_tunnel_get(struct sk_buff *skb, struct genl_info *info)
if (ret < 0)
goto err_out;
- return genlmsg_unicast(net, msg, info->snd_portid);
+ return genlmsg_unicast(net, msg, info->snd_portid, GFP_KERNEL);
err_out:
nlmsg_free(msg);
@@ -820,7 +821,8 @@ static int l2tp_nl_cmd_session_get(struct sk_buff *skb, struct genl_info *info)
if (ret < 0)
goto err_out;
- return genlmsg_unicast(genl_info_net(info), msg, info->snd_portid);
+ return genlmsg_unicast(genl_info_net(info), msg, info->snd_portid,
+ GFP_KERNEL);
err_out:
nlmsg_free(msg);
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c
index 524c0fd..374e0ec 100644
--- a/net/openvswitch/datapath.c
+++ b/net/openvswitch/datapath.c
@@ -542,7 +542,8 @@ static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb,
((struct nlmsghdr *) user_skb->data)->nlmsg_len = user_skb->len;
- err = genlmsg_unicast(ovs_dp_get_net(dp), user_skb, upcall_info->portid);
+ err = genlmsg_unicast(ovs_dp_get_net(dp), user_skb, upcall_info->portid,
+ GFP_ATOMIC);
user_skb = NULL;
out:
if (err)
diff --git a/net/tipc/netlink_compat.c b/net/tipc/netlink_compat.c
index 3ad9fab..205577c 100644
--- a/net/tipc/netlink_compat.c
+++ b/net/tipc/netlink_compat.c
@@ -1210,7 +1210,7 @@ send:
rep_nlh = nlmsg_hdr(msg.rep);
memcpy(rep_nlh, info->nlhdr, len);
rep_nlh->nlmsg_len = msg.rep->len;
- genlmsg_unicast(msg.net, msg.rep, NETLINK_CB(skb).portid);
+ genlmsg_unicast(msg.net, msg.rep, NETLINK_CB(skb).portid, GFP_KERNEL);
return err;
}
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 244d552..e608937 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -12648,7 +12648,7 @@ static bool __nl80211_unexpected_frame(struct net_device *dev, u8 cmd,
goto nla_put_failure;
genlmsg_end(msg, hdr);
- genlmsg_unicast(wiphy_net(&rdev->wiphy), msg, nlportid);
+ genlmsg_unicast(wiphy_net(&rdev->wiphy), msg, nlportid, gfp);
return true;
nla_put_failure:
@@ -12733,7 +12733,7 @@ int nl80211_send_mgmt(struct cfg80211_registered_device *rdev,
genlmsg_end(msg, hdr);
- return genlmsg_unicast(wiphy_net(&rdev->wiphy), msg, nlportid);
+ return genlmsg_unicast(wiphy_net(&rdev->wiphy), msg, nlportid, gfp);
nla_put_failure:
genlmsg_cancel(msg, hdr);
@@ -13245,7 +13245,8 @@ void cfg80211_report_obss_beacon(struct wiphy *wiphy,
genlmsg_end(msg, hdr);
- genlmsg_unicast(wiphy_net(&rdev->wiphy), msg, reg->nlportid);
+ genlmsg_unicast(wiphy_net(&rdev->wiphy), msg, reg->nlportid,
+ GFP_ATOMIC);
}
spin_unlock_bh(&rdev->beacon_registrations_lock);
return;
@@ -13623,7 +13624,7 @@ void cfg80211_crit_proto_stopped(struct wireless_dev *wdev, gfp_t gfp)
genlmsg_end(msg, hdr);
- genlmsg_unicast(wiphy_net(&rdev->wiphy), msg, nlportid);
+ genlmsg_unicast(wiphy_net(&rdev->wiphy), msg, nlportid, gfp);
return;
nla_put_failure:
--
2.7.4
next prev parent reply other threads:[~2016-07-06 0:29 UTC|newest]
Thread overview: 15+ 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 ` [RFC 4/7] infiniband: Add allocation flag to ibnl_unicast() Masashi Honma
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
2016-07-08 4:00 ` Eric Dumazet
2016-07-06 0:28 ` Masashi Honma [this message]
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-07 0:35 ` Masashi Honma
[not found] ` <20160708160821.GA2048@redhat.com>
2016-07-09 3:52 ` Masashi Honma
2016-07-09 3:54 ` 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-7-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).