netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/7] MIB: add struct net to ICMP accounting macros
@ 2008-07-07 10:41 Pavel Emelyanov
  2008-07-07 10:44 ` [PATCH net-next 1/7] ICMP: add struct net argument to icmp_out_count Pavel Emelyanov
                   ` (6 more replies)
  0 siblings, 7 replies; 15+ messages in thread
From: Pavel Emelyanov @ 2008-07-07 10:41 UTC (permalink / raw)
  To: David Miller; +Cc: Linux Netdev List

Step #2. This is almost as easy as the UDP case, but requires
some preparation to have a struct net at hands in some places.

David, there are (mainly) NET, TCP and IP(6) stats left and I
planned to send them step-by-step with small series (and plus the
closing one with SNMP_XXX macros, etc). But if you prefer seeing
one large set instead of several small ones just let me know ;)

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH net-next 1/7] ICMP: add struct net argument to icmp_out_count
  2008-07-07 10:41 [PATCH net-next 0/7] MIB: add struct net to ICMP accounting macros Pavel Emelyanov
@ 2008-07-07 10:44 ` Pavel Emelyanov
  2008-07-15  6:01   ` David Miller
  2008-07-07 10:47 ` [PATCH net-next 2/7] INET: toss struct net initialization around Pavel Emelyanov
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 15+ messages in thread
From: Pavel Emelyanov @ 2008-07-07 10:44 UTC (permalink / raw)
  To: David Miller; +Cc: Linux Netdev List

This routine deals with ICMP statistics, but doesn't have a
struct net at hands, so add one.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>

---
 include/net/icmp.h   |    3 ++-
 net/ipv4/icmp.c      |    2 +-
 net/ipv4/ip_output.c |    3 ++-
 net/ipv4/raw.c       |    3 ++-
 4 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/include/net/icmp.h b/include/net/icmp.h
index dddb839..38ca2f3 100644
--- a/include/net/icmp.h
+++ b/include/net/icmp.h
@@ -44,12 +44,13 @@ DECLARE_SNMP_STAT(struct icmpmsg_mib, icmpmsg_statistics);
 struct dst_entry;
 struct net_proto_family;
 struct sk_buff;
+struct net;
 
 extern void	icmp_send(struct sk_buff *skb_in,  int type, int code, __be32 info);
 extern int	icmp_rcv(struct sk_buff *skb);
 extern int	icmp_ioctl(struct sock *sk, int cmd, unsigned long arg);
 extern int	icmp_init(void);
-extern void	icmp_out_count(unsigned char type);
+extern void	icmp_out_count(struct net *net, unsigned char type);
 
 /* Move into dst.h ? */
 extern int 	xrlim_allow(struct dst_entry *dst, int timeout);
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
index aa7cf46..1ffe7ad 100644
--- a/net/ipv4/icmp.c
+++ b/net/ipv4/icmp.c
@@ -296,7 +296,7 @@ out:
 /*
  *	Maintain the counters used in the SNMP statistics for outgoing ICMP
  */
-void icmp_out_count(unsigned char type)
+void icmp_out_count(struct net *net, unsigned char type)
 {
 	ICMPMSGOUT_INC_STATS(type);
 	ICMP_INC_STATS(ICMP_MIB_OUTMSGS);
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index f1278ee..f003186 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -1211,6 +1211,7 @@ int ip_push_pending_frames(struct sock *sk)
 	struct sk_buff *skb, *tmp_skb;
 	struct sk_buff **tail_skb;
 	struct inet_sock *inet = inet_sk(sk);
+	struct net *net = sock_net(sk);
 	struct ip_options *opt = NULL;
 	struct rtable *rt = (struct rtable *)inet->cork.dst;
 	struct iphdr *iph;
@@ -1280,7 +1281,7 @@ int ip_push_pending_frames(struct sock *sk)
 	skb->dst = dst_clone(&rt->u.dst);
 
 	if (iph->protocol == IPPROTO_ICMP)
-		icmp_out_count(((struct icmphdr *)
+		icmp_out_count(net, ((struct icmphdr *)
 			skb_transport_header(skb))->type);
 
 	/* Netfilter gets whole the not fragmented skb. */
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c
index 925fdf1..7f39ea4 100644
--- a/net/ipv4/raw.c
+++ b/net/ipv4/raw.c
@@ -320,6 +320,7 @@ static int raw_send_hdrinc(struct sock *sk, void *from, size_t length,
 			unsigned int flags)
 {
 	struct inet_sock *inet = inet_sk(sk);
+	struct net *net = sock_net(sk);
 	struct iphdr *iph;
 	struct sk_buff *skb;
 	unsigned int iphlen;
@@ -368,7 +369,7 @@ static int raw_send_hdrinc(struct sock *sk, void *from, size_t length,
 		iph->check = ip_fast_csum((unsigned char *)iph, iph->ihl);
 	}
 	if (iph->protocol == IPPROTO_ICMP)
-		icmp_out_count(((struct icmphdr *)
+		icmp_out_count(net, ((struct icmphdr *)
 			skb_transport_header(skb))->type);
 
 	err = NF_HOOK(PF_INET, NF_INET_LOCAL_OUT, skb, NULL, rt->u.dst.dev,
-- 
1.5.3.4


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH net-next 2/7] INET: toss struct net initialization around
  2008-07-07 10:41 [PATCH net-next 0/7] MIB: add struct net to ICMP accounting macros Pavel Emelyanov
  2008-07-07 10:44 ` [PATCH net-next 1/7] ICMP: add struct net argument to icmp_out_count Pavel Emelyanov
@ 2008-07-07 10:47 ` Pavel Emelyanov
  2008-07-15  6:01   ` David Miller
  2008-07-07 10:50 ` [PATCH net-next 3/7] ICMP: drop unused MIB accounting wrappers Pavel Emelyanov
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 15+ messages in thread
From: Pavel Emelyanov @ 2008-07-07 10:47 UTC (permalink / raw)
  To: David Miller; +Cc: Linux Netdev List

Some places, that deal with ICMP statistics already have where
to get a struct net from, but use it directly, without declaring
a separate variable on the stack.

Since I will need this net soon, I declare a struct net on the 
stack and use it in the existing places in a separate patch not 
to spoil the future ones.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>

---
 net/dccp/ipv4.c     |    3 ++-
 net/ipv4/icmp.c     |    4 +---
 net/ipv4/tcp_ipv4.c |    3 ++-
 net/ipv4/udp.c      |    3 ++-
 4 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c
index 37d27bc..cc4f334 100644
--- a/net/dccp/ipv4.c
+++ b/net/dccp/ipv4.c
@@ -205,13 +205,14 @@ static void dccp_v4_err(struct sk_buff *skb, u32 info)
 	struct sock *sk;
 	__u64 seq;
 	int err;
+	struct net *net = dev_net(skb->dev);
 
 	if (skb->len < (iph->ihl << 2) + 8) {
 		ICMP_INC_STATS_BH(ICMP_MIB_INERRORS);
 		return;
 	}
 
-	sk = inet_lookup(dev_net(skb->dev), &dccp_hashinfo,
+	sk = inet_lookup(net, &dccp_hashinfo,
 			iph->daddr, dh->dccph_dport,
 			iph->saddr, dh->dccph_sport, inet_iif(skb));
 	if (sk == NULL) {
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
index 1ffe7ad..56d6b94 100644
--- a/net/ipv4/icmp.c
+++ b/net/ipv4/icmp.c
@@ -973,6 +973,7 @@ int icmp_rcv(struct sk_buff *skb)
 {
 	struct icmphdr *icmph;
 	struct rtable *rt = skb->rtable;
+	struct net *net = dev_net(rt->u.dst.dev);
 
 	if (!xfrm4_policy_check(NULL, XFRM_POLICY_IN, skb)) {
 		int nh;
@@ -1027,9 +1028,6 @@ int icmp_rcv(struct sk_buff *skb)
 	 */
 
 	if (rt->rt_flags & (RTCF_BROADCAST | RTCF_MULTICAST)) {
-		struct net *net;
-
-		net = dev_net(rt->u.dst.dev);
 		/*
 		 *	RFC 1122: 3.2.2.6 An ICMP_ECHO to broadcast MAY be
 		 *	  silently ignored (we let user decide with a sysctl).
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 4300bcf..ca41b77 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -343,13 +343,14 @@ void tcp_v4_err(struct sk_buff *skb, u32 info)
 	struct sock *sk;
 	__u32 seq;
 	int err;
+	struct net *net = dev_net(skb->dev);
 
 	if (skb->len < (iph->ihl << 2) + 8) {
 		ICMP_INC_STATS_BH(ICMP_MIB_INERRORS);
 		return;
 	}
 
-	sk = inet_lookup(dev_net(skb->dev), &tcp_hashinfo, iph->daddr, th->dest,
+	sk = inet_lookup(net, &tcp_hashinfo, iph->daddr, th->dest,
 			iph->saddr, th->source, inet_iif(skb));
 	if (!sk) {
 		ICMP_INC_STATS_BH(ICMP_MIB_INERRORS);
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 7187121..9342cfd 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -354,8 +354,9 @@ void __udp4_lib_err(struct sk_buff *skb, u32 info, struct hlist_head udptable[])
 	struct sock *sk;
 	int harderr;
 	int err;
+	struct net *net = dev_net(skb->dev);
 
-	sk = __udp4_lib_lookup(dev_net(skb->dev), iph->daddr, uh->dest,
+	sk = __udp4_lib_lookup(net, iph->daddr, uh->dest,
 			iph->saddr, uh->source, skb->dev->ifindex, udptable);
 	if (sk == NULL) {
 		ICMP_INC_STATS_BH(ICMP_MIB_INERRORS);
-- 
1.5.3.4


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH net-next 3/7] ICMP: drop unused MIB accounting wrappers
  2008-07-07 10:41 [PATCH net-next 0/7] MIB: add struct net to ICMP accounting macros Pavel Emelyanov
  2008-07-07 10:44 ` [PATCH net-next 1/7] ICMP: add struct net argument to icmp_out_count Pavel Emelyanov
  2008-07-07 10:47 ` [PATCH net-next 2/7] INET: toss struct net initialization around Pavel Emelyanov
@ 2008-07-07 10:50 ` Pavel Emelyanov
  2008-07-15  6:02   ` David Miller
  2008-07-07 10:51 ` [PATCH net-next 4/7] MIB: add struct net to ICMP_INC_STATS Pavel Emelyanov
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 15+ messages in thread
From: Pavel Emelyanov @ 2008-07-07 10:50 UTC (permalink / raw)
  To: David Miller; +Cc: Linux Netdev List

There are ICMP_XXX_STATS that are not used in the kernel, so I remove
them, not to "just patch" them later. But if there's some sense in 
keeping them, kick me - I will remake this set keeping them.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>

---
 include/net/icmp.h |    5 -----
 1 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/include/net/icmp.h b/include/net/icmp.h
index 38ca2f3..e34e981 100644
--- a/include/net/icmp.h
+++ b/include/net/icmp.h
@@ -33,13 +33,8 @@ DECLARE_SNMP_STAT(struct icmp_mib, icmp_statistics);
 DECLARE_SNMP_STAT(struct icmpmsg_mib, icmpmsg_statistics);
 #define ICMP_INC_STATS(field)		SNMP_INC_STATS(icmp_statistics, field)
 #define ICMP_INC_STATS_BH(field)	SNMP_INC_STATS_BH(icmp_statistics, field)
-#define ICMP_INC_STATS_USER(field) 	SNMP_INC_STATS_USER(icmp_statistics, field)
 #define ICMPMSGOUT_INC_STATS(field)	SNMP_INC_STATS(icmpmsg_statistics, field+256)
-#define ICMPMSGOUT_INC_STATS_BH(field)	SNMP_INC_STATS_BH(icmpmsg_statistics, field+256)
-#define ICMPMSGOUT_INC_STATS_USER(field) 	SNMP_INC_STATS_USER(icmpmsg_statistics, field+256)
-#define ICMPMSGIN_INC_STATS(field)	SNMP_INC_STATS(icmpmsg_statistics, field)
 #define ICMPMSGIN_INC_STATS_BH(field)	SNMP_INC_STATS_BH(icmpmsg_statistics, field)
-#define ICMPMSGIN_INC_STATS_USER(field) SNMP_INC_STATS_USER(icmpmsg_statistics, field)
 
 struct dst_entry;
 struct net_proto_family;
-- 
1.5.3.4


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH net-next 4/7] MIB: add struct net to ICMP_INC_STATS
  2008-07-07 10:41 [PATCH net-next 0/7] MIB: add struct net to ICMP accounting macros Pavel Emelyanov
                   ` (2 preceding siblings ...)
  2008-07-07 10:50 ` [PATCH net-next 3/7] ICMP: drop unused MIB accounting wrappers Pavel Emelyanov
@ 2008-07-07 10:51 ` Pavel Emelyanov
  2008-07-15  6:02   ` David Miller
  2008-07-07 10:52 ` [PATCH net-next 5/7] MIB: add struct net to ICMP_INC_STATS_BH Pavel Emelyanov
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 15+ messages in thread
From: Pavel Emelyanov @ 2008-07-07 10:51 UTC (permalink / raw)
  To: David Miller; +Cc: Linux Netdev List

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>

---
 include/net/icmp.h |    2 +-
 net/ipv4/icmp.c    |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/net/icmp.h b/include/net/icmp.h
index e34e981..c86fef8 100644
--- a/include/net/icmp.h
+++ b/include/net/icmp.h
@@ -31,7 +31,7 @@ struct icmp_err {
 extern struct icmp_err icmp_err_convert[];
 DECLARE_SNMP_STAT(struct icmp_mib, icmp_statistics);
 DECLARE_SNMP_STAT(struct icmpmsg_mib, icmpmsg_statistics);
-#define ICMP_INC_STATS(field)		SNMP_INC_STATS(icmp_statistics, field)
+#define ICMP_INC_STATS(net, field)	SNMP_INC_STATS(icmp_statistics, field)
 #define ICMP_INC_STATS_BH(field)	SNMP_INC_STATS_BH(icmp_statistics, field)
 #define ICMPMSGOUT_INC_STATS(field)	SNMP_INC_STATS(icmpmsg_statistics, field+256)
 #define ICMPMSGIN_INC_STATS_BH(field)	SNMP_INC_STATS_BH(icmpmsg_statistics, field)
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
index 56d6b94..e94de41 100644
--- a/net/ipv4/icmp.c
+++ b/net/ipv4/icmp.c
@@ -299,7 +299,7 @@ out:
 void icmp_out_count(struct net *net, unsigned char type)
 {
 	ICMPMSGOUT_INC_STATS(type);
-	ICMP_INC_STATS(ICMP_MIB_OUTMSGS);
+	ICMP_INC_STATS(net, ICMP_MIB_OUTMSGS);
 }
 
 /*
-- 
1.5.3.4


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH net-next 5/7] MIB: add struct net to ICMP_INC_STATS_BH
  2008-07-07 10:41 [PATCH net-next 0/7] MIB: add struct net to ICMP accounting macros Pavel Emelyanov
                   ` (3 preceding siblings ...)
  2008-07-07 10:51 ` [PATCH net-next 4/7] MIB: add struct net to ICMP_INC_STATS Pavel Emelyanov
@ 2008-07-07 10:52 ` Pavel Emelyanov
  2008-07-15  6:03   ` David Miller
  2008-07-07 10:53 ` [PATCH net-next 6/7] MIB: add struct net to ICMPMSGOUT_INC_STATS Pavel Emelyanov
  2008-07-07 10:53 ` [PATCH net-next 7/7] MIB: add struct net to ICMPMSGIN_INC_STATS_BH Pavel Emelyanov
  6 siblings, 1 reply; 15+ messages in thread
From: Pavel Emelyanov @ 2008-07-07 10:52 UTC (permalink / raw)
  To: David Miller; +Cc: Linux Netdev List

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>

---
 include/net/icmp.h  |    2 +-
 net/dccp/ipv4.c     |    4 ++--
 net/ipv4/icmp.c     |   10 +++++-----
 net/ipv4/tcp_ipv4.c |    4 ++--
 net/ipv4/udp.c      |    2 +-
 net/sctp/input.c    |    5 +++--
 6 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/include/net/icmp.h b/include/net/icmp.h
index c86fef8..e2ae640 100644
--- a/include/net/icmp.h
+++ b/include/net/icmp.h
@@ -32,7 +32,7 @@ extern struct icmp_err icmp_err_convert[];
 DECLARE_SNMP_STAT(struct icmp_mib, icmp_statistics);
 DECLARE_SNMP_STAT(struct icmpmsg_mib, icmpmsg_statistics);
 #define ICMP_INC_STATS(net, field)	SNMP_INC_STATS(icmp_statistics, field)
-#define ICMP_INC_STATS_BH(field)	SNMP_INC_STATS_BH(icmp_statistics, field)
+#define ICMP_INC_STATS_BH(net, field)	SNMP_INC_STATS_BH(icmp_statistics, field)
 #define ICMPMSGOUT_INC_STATS(field)	SNMP_INC_STATS(icmpmsg_statistics, field+256)
 #define ICMPMSGIN_INC_STATS_BH(field)	SNMP_INC_STATS_BH(icmpmsg_statistics, field)
 
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c
index cc4f334..2b03c47 100644
--- a/net/dccp/ipv4.c
+++ b/net/dccp/ipv4.c
@@ -208,7 +208,7 @@ static void dccp_v4_err(struct sk_buff *skb, u32 info)
 	struct net *net = dev_net(skb->dev);
 
 	if (skb->len < (iph->ihl << 2) + 8) {
-		ICMP_INC_STATS_BH(ICMP_MIB_INERRORS);
+		ICMP_INC_STATS_BH(net, ICMP_MIB_INERRORS);
 		return;
 	}
 
@@ -216,7 +216,7 @@ static void dccp_v4_err(struct sk_buff *skb, u32 info)
 			iph->daddr, dh->dccph_dport,
 			iph->saddr, dh->dccph_sport, inet_iif(skb));
 	if (sk == NULL) {
-		ICMP_INC_STATS_BH(ICMP_MIB_INERRORS);
+		ICMP_INC_STATS_BH(net, ICMP_MIB_INERRORS);
 		return;
 	}
 
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
index e94de41..56a7bbc 100644
--- a/net/ipv4/icmp.c
+++ b/net/ipv4/icmp.c
@@ -763,7 +763,7 @@ static void icmp_unreach(struct sk_buff *skb)
 out:
 	return;
 out_err:
-	ICMP_INC_STATS_BH(ICMP_MIB_INERRORS);
+	ICMP_INC_STATS_BH(net, ICMP_MIB_INERRORS);
 	goto out;
 }
 
@@ -803,7 +803,7 @@ static void icmp_redirect(struct sk_buff *skb)
 out:
 	return;
 out_err:
-	ICMP_INC_STATS_BH(ICMP_MIB_INERRORS);
+	ICMP_INC_STATS_BH(dev_net(skb->dev), ICMP_MIB_INERRORS);
 	goto out;
 }
 
@@ -874,7 +874,7 @@ static void icmp_timestamp(struct sk_buff *skb)
 out:
 	return;
 out_err:
-	ICMP_INC_STATS_BH(ICMP_MIB_INERRORS);
+	ICMP_INC_STATS_BH(dev_net(skb->dst->dev), ICMP_MIB_INERRORS);
 	goto out;
 }
 
@@ -994,7 +994,7 @@ int icmp_rcv(struct sk_buff *skb)
 		skb_set_network_header(skb, nh);
 	}
 
-	ICMP_INC_STATS_BH(ICMP_MIB_INMSGS);
+	ICMP_INC_STATS_BH(net, ICMP_MIB_INMSGS);
 
 	switch (skb->ip_summed) {
 	case CHECKSUM_COMPLETE:
@@ -1053,7 +1053,7 @@ drop:
 	kfree_skb(skb);
 	return 0;
 error:
-	ICMP_INC_STATS_BH(ICMP_MIB_INERRORS);
+	ICMP_INC_STATS_BH(net, ICMP_MIB_INERRORS);
 	goto drop;
 }
 
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index ca41b77..0fefd44 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -346,14 +346,14 @@ void tcp_v4_err(struct sk_buff *skb, u32 info)
 	struct net *net = dev_net(skb->dev);
 
 	if (skb->len < (iph->ihl << 2) + 8) {
-		ICMP_INC_STATS_BH(ICMP_MIB_INERRORS);
+		ICMP_INC_STATS_BH(net, ICMP_MIB_INERRORS);
 		return;
 	}
 
 	sk = inet_lookup(net, &tcp_hashinfo, iph->daddr, th->dest,
 			iph->saddr, th->source, inet_iif(skb));
 	if (!sk) {
-		ICMP_INC_STATS_BH(ICMP_MIB_INERRORS);
+		ICMP_INC_STATS_BH(net, ICMP_MIB_INERRORS);
 		return;
 	}
 	if (sk->sk_state == TCP_TIME_WAIT) {
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 9342cfd..fdd4faa 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -359,7 +359,7 @@ void __udp4_lib_err(struct sk_buff *skb, u32 info, struct hlist_head udptable[])
 	sk = __udp4_lib_lookup(net, iph->daddr, uh->dest,
 			iph->saddr, uh->source, skb->dev->ifindex, udptable);
 	if (sk == NULL) {
-		ICMP_INC_STATS_BH(ICMP_MIB_INERRORS);
+		ICMP_INC_STATS_BH(net, ICMP_MIB_INERRORS);
 		return;	/* No socket for error */
 	}
 
diff --git a/net/sctp/input.c b/net/sctp/input.c
index d354a23..ed8834e 100644
--- a/net/sctp/input.c
+++ b/net/sctp/input.c
@@ -61,6 +61,7 @@
 #include <net/sctp/sctp.h>
 #include <net/sctp/sm.h>
 #include <net/sctp/checksum.h>
+#include <net/net_namespace.h>
 
 /* Forward declarations for internal helpers. */
 static int sctp_rcv_ootb(struct sk_buff *);
@@ -534,7 +535,7 @@ void sctp_v4_err(struct sk_buff *skb, __u32 info)
 	int err;
 
 	if (skb->len < ihlen + 8) {
-		ICMP_INC_STATS_BH(ICMP_MIB_INERRORS);
+		ICMP_INC_STATS_BH(&init_net, ICMP_MIB_INERRORS);
 		return;
 	}
 
@@ -548,7 +549,7 @@ void sctp_v4_err(struct sk_buff *skb, __u32 info)
 	skb->network_header = saveip;
 	skb->transport_header = savesctp;
 	if (!sk) {
-		ICMP_INC_STATS_BH(ICMP_MIB_INERRORS);
+		ICMP_INC_STATS_BH(&init_net, ICMP_MIB_INERRORS);
 		return;
 	}
 	/* Warning:  The sock lock is held.  Remember to call
-- 
1.5.3.4


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH net-next 6/7] MIB: add struct net to ICMPMSGOUT_INC_STATS
  2008-07-07 10:41 [PATCH net-next 0/7] MIB: add struct net to ICMP accounting macros Pavel Emelyanov
                   ` (4 preceding siblings ...)
  2008-07-07 10:52 ` [PATCH net-next 5/7] MIB: add struct net to ICMP_INC_STATS_BH Pavel Emelyanov
@ 2008-07-07 10:53 ` Pavel Emelyanov
  2008-07-15  6:03   ` David Miller
  2008-07-07 10:53 ` [PATCH net-next 7/7] MIB: add struct net to ICMPMSGIN_INC_STATS_BH Pavel Emelyanov
  6 siblings, 1 reply; 15+ messages in thread
From: Pavel Emelyanov @ 2008-07-07 10:53 UTC (permalink / raw)
  To: David Miller; +Cc: Linux Netdev List

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>

---
 include/net/icmp.h |    2 +-
 net/ipv4/icmp.c    |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/net/icmp.h b/include/net/icmp.h
index e2ae640..ee9c8d4 100644
--- a/include/net/icmp.h
+++ b/include/net/icmp.h
@@ -33,7 +33,7 @@ DECLARE_SNMP_STAT(struct icmp_mib, icmp_statistics);
 DECLARE_SNMP_STAT(struct icmpmsg_mib, icmpmsg_statistics);
 #define ICMP_INC_STATS(net, field)	SNMP_INC_STATS(icmp_statistics, field)
 #define ICMP_INC_STATS_BH(net, field)	SNMP_INC_STATS_BH(icmp_statistics, field)
-#define ICMPMSGOUT_INC_STATS(field)	SNMP_INC_STATS(icmpmsg_statistics, field+256)
+#define ICMPMSGOUT_INC_STATS(net, field)	SNMP_INC_STATS(icmpmsg_statistics, field+256)
 #define ICMPMSGIN_INC_STATS_BH(field)	SNMP_INC_STATS_BH(icmpmsg_statistics, field)
 
 struct dst_entry;
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
index 56a7bbc..6f4c65b 100644
--- a/net/ipv4/icmp.c
+++ b/net/ipv4/icmp.c
@@ -298,7 +298,7 @@ out:
  */
 void icmp_out_count(struct net *net, unsigned char type)
 {
-	ICMPMSGOUT_INC_STATS(type);
+	ICMPMSGOUT_INC_STATS(net, type);
 	ICMP_INC_STATS(net, ICMP_MIB_OUTMSGS);
 }
 
-- 
1.5.3.4


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH net-next 7/7] MIB: add struct net to ICMPMSGIN_INC_STATS_BH
  2008-07-07 10:41 [PATCH net-next 0/7] MIB: add struct net to ICMP accounting macros Pavel Emelyanov
                   ` (5 preceding siblings ...)
  2008-07-07 10:53 ` [PATCH net-next 6/7] MIB: add struct net to ICMPMSGOUT_INC_STATS Pavel Emelyanov
@ 2008-07-07 10:53 ` Pavel Emelyanov
  2008-07-15  6:04   ` David Miller
  6 siblings, 1 reply; 15+ messages in thread
From: Pavel Emelyanov @ 2008-07-07 10:53 UTC (permalink / raw)
  To: David Miller; +Cc: Linux Netdev List

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>

---
 include/net/icmp.h |    2 +-
 net/ipv4/icmp.c    |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/net/icmp.h b/include/net/icmp.h
index ee9c8d4..03b9972 100644
--- a/include/net/icmp.h
+++ b/include/net/icmp.h
@@ -34,7 +34,7 @@ DECLARE_SNMP_STAT(struct icmpmsg_mib, icmpmsg_statistics);
 #define ICMP_INC_STATS(net, field)	SNMP_INC_STATS(icmp_statistics, field)
 #define ICMP_INC_STATS_BH(net, field)	SNMP_INC_STATS_BH(icmp_statistics, field)
 #define ICMPMSGOUT_INC_STATS(net, field)	SNMP_INC_STATS(icmpmsg_statistics, field+256)
-#define ICMPMSGIN_INC_STATS_BH(field)	SNMP_INC_STATS_BH(icmpmsg_statistics, field)
+#define ICMPMSGIN_INC_STATS_BH(net, field)	SNMP_INC_STATS_BH(icmpmsg_statistics, field)
 
 struct dst_entry;
 struct net_proto_family;
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
index 6f4c65b..ea60ad4 100644
--- a/net/ipv4/icmp.c
+++ b/net/ipv4/icmp.c
@@ -1012,7 +1012,7 @@ int icmp_rcv(struct sk_buff *skb)
 
 	icmph = icmp_hdr(skb);
 
-	ICMPMSGIN_INC_STATS_BH(icmph->type);
+	ICMPMSGIN_INC_STATS_BH(net, icmph->type);
 	/*
 	 *	18 is the highest 'known' ICMP type. Anything else is a mystery
 	 *
-- 
1.5.3.4


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH net-next 1/7] ICMP: add struct net argument to icmp_out_count
  2008-07-07 10:44 ` [PATCH net-next 1/7] ICMP: add struct net argument to icmp_out_count Pavel Emelyanov
@ 2008-07-15  6:01   ` David Miller
  0 siblings, 0 replies; 15+ messages in thread
From: David Miller @ 2008-07-15  6:01 UTC (permalink / raw)
  To: xemul; +Cc: netdev

From: Pavel Emelyanov <xemul@openvz.org>
Date: Mon, 07 Jul 2008 14:44:06 +0400

> This routine deals with ICMP statistics, but doesn't have a
> struct net at hands, so add one.
> 
> Signed-off-by: Pavel Emelyanov <xemul@openvz.org>

Applied.

Please use lowercase subsystem names in commit header lines
in the future, I fixed it up this time.

Thanks!

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH net-next 2/7] INET: toss struct net initialization around
  2008-07-07 10:47 ` [PATCH net-next 2/7] INET: toss struct net initialization around Pavel Emelyanov
@ 2008-07-15  6:01   ` David Miller
  0 siblings, 0 replies; 15+ messages in thread
From: David Miller @ 2008-07-15  6:01 UTC (permalink / raw)
  To: xemul; +Cc: netdev

From: Pavel Emelyanov <xemul@openvz.org>
Date: Mon, 07 Jul 2008 14:47:16 +0400

> Some places, that deal with ICMP statistics already have where
> to get a struct net from, but use it directly, without declaring
> a separate variable on the stack.
> 
> Since I will need this net soon, I declare a struct net on the 
> stack and use it in the existing places in a separate patch not 
> to spoil the future ones.
> 
> Signed-off-by: Pavel Emelyanov <xemul@openvz.org>

Applied.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH net-next 3/7] ICMP: drop unused MIB accounting wrappers
  2008-07-07 10:50 ` [PATCH net-next 3/7] ICMP: drop unused MIB accounting wrappers Pavel Emelyanov
@ 2008-07-15  6:02   ` David Miller
  0 siblings, 0 replies; 15+ messages in thread
From: David Miller @ 2008-07-15  6:02 UTC (permalink / raw)
  To: xemul; +Cc: netdev

From: Pavel Emelyanov <xemul@openvz.org>
Date: Mon, 07 Jul 2008 14:50:38 +0400

> There are ICMP_XXX_STATS that are not used in the kernel, so I remove
> them, not to "just patch" them later. But if there's some sense in 
> keeping them, kick me - I will remake this set keeping them.
> 
> Signed-off-by: Pavel Emelyanov <xemul@openvz.org>

Applied.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH net-next 4/7] MIB: add struct net to ICMP_INC_STATS
  2008-07-07 10:51 ` [PATCH net-next 4/7] MIB: add struct net to ICMP_INC_STATS Pavel Emelyanov
@ 2008-07-15  6:02   ` David Miller
  0 siblings, 0 replies; 15+ messages in thread
From: David Miller @ 2008-07-15  6:02 UTC (permalink / raw)
  To: xemul; +Cc: netdev

From: Pavel Emelyanov <xemul@openvz.org>
Date: Mon, 07 Jul 2008 14:51:24 +0400

> Signed-off-by: Pavel Emelyanov <xemul@openvz.org>

Applied.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH net-next 5/7] MIB: add struct net to ICMP_INC_STATS_BH
  2008-07-07 10:52 ` [PATCH net-next 5/7] MIB: add struct net to ICMP_INC_STATS_BH Pavel Emelyanov
@ 2008-07-15  6:03   ` David Miller
  0 siblings, 0 replies; 15+ messages in thread
From: David Miller @ 2008-07-15  6:03 UTC (permalink / raw)
  To: xemul; +Cc: netdev

From: Pavel Emelyanov <xemul@openvz.org>
Date: Mon, 07 Jul 2008 14:52:19 +0400

> Signed-off-by: Pavel Emelyanov <xemul@openvz.org>

Applied.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH net-next 6/7] MIB: add struct net to ICMPMSGOUT_INC_STATS
  2008-07-07 10:53 ` [PATCH net-next 6/7] MIB: add struct net to ICMPMSGOUT_INC_STATS Pavel Emelyanov
@ 2008-07-15  6:03   ` David Miller
  0 siblings, 0 replies; 15+ messages in thread
From: David Miller @ 2008-07-15  6:03 UTC (permalink / raw)
  To: xemul; +Cc: netdev

From: Pavel Emelyanov <xemul@openvz.org>
Date: Mon, 07 Jul 2008 14:53:02 +0400

> Signed-off-by: Pavel Emelyanov <xemul@openvz.org>

Applied.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH net-next 7/7] MIB: add struct net to ICMPMSGIN_INC_STATS_BH
  2008-07-07 10:53 ` [PATCH net-next 7/7] MIB: add struct net to ICMPMSGIN_INC_STATS_BH Pavel Emelyanov
@ 2008-07-15  6:04   ` David Miller
  0 siblings, 0 replies; 15+ messages in thread
From: David Miller @ 2008-07-15  6:04 UTC (permalink / raw)
  To: xemul; +Cc: netdev

From: Pavel Emelyanov <xemul@openvz.org>
Date: Mon, 07 Jul 2008 14:53:44 +0400

> Signed-off-by: Pavel Emelyanov <xemul@openvz.org>

Also applied, thanks a lot.

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2008-07-15  6:04 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-07 10:41 [PATCH net-next 0/7] MIB: add struct net to ICMP accounting macros Pavel Emelyanov
2008-07-07 10:44 ` [PATCH net-next 1/7] ICMP: add struct net argument to icmp_out_count Pavel Emelyanov
2008-07-15  6:01   ` David Miller
2008-07-07 10:47 ` [PATCH net-next 2/7] INET: toss struct net initialization around Pavel Emelyanov
2008-07-15  6:01   ` David Miller
2008-07-07 10:50 ` [PATCH net-next 3/7] ICMP: drop unused MIB accounting wrappers Pavel Emelyanov
2008-07-15  6:02   ` David Miller
2008-07-07 10:51 ` [PATCH net-next 4/7] MIB: add struct net to ICMP_INC_STATS Pavel Emelyanov
2008-07-15  6:02   ` David Miller
2008-07-07 10:52 ` [PATCH net-next 5/7] MIB: add struct net to ICMP_INC_STATS_BH Pavel Emelyanov
2008-07-15  6:03   ` David Miller
2008-07-07 10:53 ` [PATCH net-next 6/7] MIB: add struct net to ICMPMSGOUT_INC_STATS Pavel Emelyanov
2008-07-15  6:03   ` David Miller
2008-07-07 10:53 ` [PATCH net-next 7/7] MIB: add struct net to ICMPMSGIN_INC_STATS_BH Pavel Emelyanov
2008-07-15  6:04   ` David Miller

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).