All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pablo Neira <pablo@eurodev.net>
To: netdev@oss.sgi.com, "David S. Miller" <davem@redhat.com>
Subject: [NETLINK] netlink_ack takes gfp flag as parameter
Date: Fri, 24 Sep 2004 03:12:19 +0200	[thread overview]
Message-ID: <41537473.1090306@eurodev.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 275 bytes --]

Hi Davem,

AFAIK ip_queue, ip6_queue and dn_rtmsg use netlink_ack in interrupt 
context which calls alloc_skb with the GFP_KERNEL flag. This patch adds 
a new parameter to netlink_ack to set the gfp flag.

Signed-off-by: Pablo Neira Ayuso <pablo@eurodev.net>

regards,
Pablo

[-- Attachment #2: netlink_ack.patch --]
[-- Type: text/x-patch, Size: 1385 bytes --]

===== include/linux/netlink.h 1.19 vs edited =====
--- 1.19/include/linux/netlink.h	Sat Aug 28 02:13:43 2004
+++ edited/include/linux/netlink.h	Fri Sep 24 02:02:05 2004
@@ -119,7 +119,7 @@
 extern void netlink_detach(int unit);
 extern int netlink_post(int unit, struct sk_buff *skb);
 extern struct sock *netlink_kernel_create(int unit, void (*input)(struct sock *sk, int len));
-extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err);
+extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err, int gfp_mask);
 extern int netlink_unicast(struct sock *ssk, struct sk_buff *skb, __u32 pid, int nonblock);
 extern int netlink_broadcast(struct sock *ssk, struct sk_buff *skb, __u32 pid,
 			     __u32 group, int allocation);
===== net/netlink/af_netlink.c 1.56 vs edited =====
--- 1.56/net/netlink/af_netlink.c	Fri Sep 24 02:01:00 2004
+++ edited/net/netlink/af_netlink.c	Fri Sep 24 02:02:06 2004
@@ -957,7 +957,8 @@
 	return 0;
 }
 
-void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err)
+void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err, 
+		 int gfp_mask)
 {
 	struct sk_buff *skb;
 	struct nlmsghdr *rep;
@@ -969,7 +970,7 @@
 	else
 		size = NLMSG_SPACE(4 + NLMSG_ALIGN(nlh->nlmsg_len));
 
-	skb = alloc_skb(size, GFP_KERNEL);
+	skb = alloc_skb(size, gfp_mask);
 	if (!skb) {
 		struct sock *sk;
 

[-- Attachment #3: netlink_ack-audit.patch --]
[-- Type: text/x-patch, Size: 485 bytes --]

===== kernel/audit.c 1.3 vs edited =====
--- 1.3/kernel/audit.c	Tue Sep 14 02:23:21 2004
+++ edited/kernel/audit.c	Fri Sep 24 02:02:06 2004
@@ -419,9 +419,9 @@
 		if (rlen > skb->len)
 			rlen = skb->len;
 		if ((err = audit_receive_msg(skb, nlh))) {
-			netlink_ack(skb, nlh, -err);
+			netlink_ack(skb, nlh, -err, GFP_KERNEL);
 		} else if (nlh->nlmsg_flags & NLM_F_ACK)
-			netlink_ack(skb, nlh, 0);
+			netlink_ack(skb, nlh, 0, GFP_KERNEL);
 		skb_pull(skb, rlen);
 	}
 	return 0;

[-- Attachment #4: netlink_ack-dn_rtmsg.patch --]
[-- Type: text/x-patch, Size: 482 bytes --]

===== net/decnet/netfilter/dn_rtmsg.c 1.3 vs edited =====
--- 1.3/net/decnet/netfilter/dn_rtmsg.c	Thu Jun  5 02:57:08 2003
+++ edited/net/decnet/netfilter/dn_rtmsg.c	Fri Sep 24 02:14:31 2004
@@ -99,7 +99,9 @@
 }
 
 
-#define RCV_SKB_FAIL(err) do { netlink_ack(skb, nlh, (err)); return; } while (0)
+#define RCV_SKB_FAIL(err) do {					\
+	netlink_ack(skb, nlh, (err), GFP_ATOMIC); return; 	\
+	} while (0) 						\
 
 static inline void dnrmg_receive_user_skb(struct sk_buff *skb)
 {

[-- Attachment #5: netlink_ack-ip6_queue.patch --]
[-- Type: text/x-patch, Size: 506 bytes --]

===== net/ipv6/netfilter/ip6_queue.c 1.14 vs edited =====
--- 1.14/net/ipv6/netfilter/ip6_queue.c	Thu Jan 29 00:59:34 2004
+++ edited/net/ipv6/netfilter/ip6_queue.c	Fri Sep 24 02:19:58 2004
@@ -474,7 +474,9 @@
 		ipq_issue_verdict(entry, NF_DROP);
 }
 
-#define RCV_SKB_FAIL(err) do { netlink_ack(skb, nlh, (err)); return; } while (0)
+#define RCV_SKB_FAIL(err) do {					\
+	netlink_ack(skb, nlh, (err), GFP_ATOMIC); return; 	\
+	} while (0) 						\
 
 static inline void
 ipq_rcv_skb(struct sk_buff *skb)

[-- Attachment #6: netlink_ack-ip_queue.c --]
[-- Type: text/x-csrc, Size: 668 bytes --]

===== net/ipv4/netfilter/ip_queue.c 1.17 vs edited =====
--- 1.17/net/ipv4/netfilter/ip_queue.c	Tue Sep  7 23:18:28 2004
+++ edited/net/ipv4/netfilter/ip_queue.c	Fri Sep 24 02:15:45 2004
@@ -471,7 +471,9 @@
 		ipq_issue_verdict(entry, NF_DROP);
 }
 
-#define RCV_SKB_FAIL(err) do { netlink_ack(skb, nlh, (err)); return; } while (0)
+#define RCV_SKB_FAIL(err) do {					\
+	netlink_ack(skb, nlh, (err), GFP_ATOMIC); return; 	\
+	} while (0)						\
 
 static inline void
 ipq_rcv_skb(struct sk_buff *skb)
@@ -526,7 +528,7 @@
 		RCV_SKB_FAIL(status);
 		
 	if (flags & NLM_F_ACK)
-		netlink_ack(skb, nlh, 0);
+		netlink_ack(skb, nlh, 0, GFP_ATOMIC);
         return;
 }
 

[-- Attachment #7: netlink_ack-rtnetlink.patch --]
[-- Type: text/x-patch, Size: 442 bytes --]

===== net/core/rtnetlink.c 1.27 vs edited =====
--- 1.27/net/core/rtnetlink.c	Mon Sep 13 02:03:08 2004
+++ edited/net/core/rtnetlink.c	Fri Sep 24 02:02:05 2004
@@ -558,9 +558,9 @@
 			 */
 			if (err == 0)
 				return -1;
-			netlink_ack(skb, nlh, err);
+			netlink_ack(skb, nlh, err, GFP_KERNEL);
 		} else if (nlh->nlmsg_flags&NLM_F_ACK)
-			netlink_ack(skb, nlh, 0);
+			netlink_ack(skb, nlh, 0, GFP_KERNEL);
 		skb_pull(skb, rlen);
 	}
 

[-- Attachment #8: netlink_ack-tcp_diag.patch --]
[-- Type: text/x-patch, Size: 355 bytes --]

===== net/ipv4/tcp_diag.c 1.16 vs edited =====
--- 1.16/net/ipv4/tcp_diag.c	Tue Sep  7 18:18:04 2004
+++ edited/net/ipv4/tcp_diag.c	Fri Sep 24 02:02:05 2004
@@ -634,7 +634,7 @@
 			return;
 		err = tcpdiag_rcv_msg(skb, nlh);
 		if (err || nlh->nlmsg_flags & NLM_F_ACK) 
-			netlink_ack(skb, nlh, err);
+			netlink_ack(skb, nlh, err, GFP_KERNEL);
 	}
 }
 

[-- Attachment #9: netlink_ack-xfrm_user.patch --]
[-- Type: text/x-patch, Size: 436 bytes --]

===== net/xfrm/xfrm_user.c 1.48 vs edited =====
--- 1.48/net/xfrm/xfrm_user.c	Fri Sep 10 23:35:53 2004
+++ edited/net/xfrm/xfrm_user.c	Fri Sep 24 02:02:06 2004
@@ -995,7 +995,7 @@
 		if (xfrm_user_rcv_msg(skb, nlh, &err) < 0) {
 			if (err == 0)
 				return -1;
-			netlink_ack(skb, nlh, err);
+			netlink_ack(skb, nlh, err, GFP_KERNEL);
 		} else if (nlh->nlmsg_flags & NLM_F_ACK)
 			netlink_ack(skb, nlh, 0);
 		skb_pull(skb, rlen);

             reply	other threads:[~2004-09-24  1:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-24  1:12 Pablo Neira [this message]
2004-09-24  2:12 ` [NETLINK] netlink_ack takes gfp flag as parameter Herbert Xu

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=41537473.1090306@eurodev.net \
    --to=pablo@eurodev.net \
    --cc=davem@redhat.com \
    --cc=netdev@oss.sgi.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.