From patchwork Wed Jul 6 00:28:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masashi Honma X-Patchwork-Id: 9215257 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9282860572 for ; Wed, 6 Jul 2016 00:29:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 83230284F7 for ; Wed, 6 Jul 2016 00:29:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 75332284FB; Wed, 6 Jul 2016 00:29:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F0B06284F7 for ; Wed, 6 Jul 2016 00:29:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752127AbcGFA3X (ORCPT ); Tue, 5 Jul 2016 20:29:23 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:33807 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751986AbcGFA3R (ORCPT ); Tue, 5 Jul 2016 20:29:17 -0400 Received: by mail-pf0-f194.google.com with SMTP id 66so20279227pfy.1; Tue, 05 Jul 2016 17:29:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=bn/KrnIGFmg3BwLy5Cs7OyC69PICoBhnecJzZK88CQI=; b=UUB/mhTc6kVG0qriOkPSRcJIbcEwxSbhqQKkYdr3wTQk/hHPfyauObOQd496DYFyXw ieLV3vc0k7M52R7s1oPqCK4QHaki1houAt0MbIoQRcpnyZhgNclzWiuY4d2XmLdHI+DZ s0O7zmj1I4eBA8nv+RZCjnTvi8Fv7/g8dzPq7zDwQthxNdd2sxTpp6OGbEEMUxorqO7J 5StZqV/MqfBA20d7UnfBm7U86kqdG2BI4rQ3OX5RDspOQNYZWNTENP+91/tmvI6g3vJV /rK1DtUyz3J2P0tfrkG4ikXYoqOzj0m4xYpZSElpezPFFfUPobm0hDOwL4KO4YkxSE4i M4mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=bn/KrnIGFmg3BwLy5Cs7OyC69PICoBhnecJzZK88CQI=; b=FcuOHTrSuzTbAMhRt5uj8QmOM1QcPtSrhjT0VGvJZRURBTVahrd7h3zQkWxElymonZ KNCH+YHBMi2QZYxwSXSIbbc3jWzE3TVDl1ELvMM4ypYHgTWZzJQ7ibpiZRbY+W30Ld+M imcs3nj9eBk18JuqzI5v+wh5E7cNsH6m/dXky8Ogyn3tlJ0ZRLZCf0ZvV4LhexxqEWZj 8Xp9mH5CL5lzZnVAlyANLhjs/YIXsCsOIrrWMnL9KzXO4oVm3uKU4v3KjwN6I6vxi3Xp bzsz+hI2F1po/hlUwrjHFPptpDi70h6zrLSxSg/d/UUVq+KQGbWBX8S1NqJK7OBFh3Bm T7oQ== X-Gm-Message-State: ALyK8tK0RylJ9KGQAcPGiNGxE20N/serE9gAFvcunkZhHAr3DkdoFA5/qJasBHATvIZGlA== X-Received: by 10.98.32.65 with SMTP id g62mr36914177pfg.12.1467764956888; Tue, 05 Jul 2016 17:29:16 -0700 (PDT) Received: from localhost.localdomain (p0347f3.kngwnt01.ap.so-net.ne.jp. [121.3.71.243]) by smtp.gmail.com with ESMTPSA id d65sm7612283pfa.45.2016.07.05.17.29.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 05 Jul 2016 17:29:16 -0700 (PDT) From: Masashi Honma 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 Subject: [RFC 4/7] infiniband: Add allocation flag to ibnl_unicast() Date: Wed, 6 Jul 2016 09:28:33 +0900 Message-Id: <1467764916-4983-5-git-send-email-masashi.honma@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1467764916-4983-1-git-send-email-masashi.honma@gmail.com> References: <1467764916-4983-1-git-send-email-masashi.honma@gmail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Masashi Honma --- 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 #include #include +#include #include #include #include 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.