netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Emelyanov <xemul@openvz.org>
To: David Miller <davem@davemloft.net>
Cc: Linux Netdev List <netdev@vger.kernel.org>, Denis Lunev <den@openvz.org>
Subject: [PATCH net-next-2.6 1/4] MIB: add struct net to UDP_INC_STATS_USER
Date: Fri, 04 Jul 2008 16:00:14 +0400	[thread overview]
Message-ID: <486E10CE.7080902@openvz.org> (raw)
In-Reply-To: <486E1074.7040702@openvz.org>

Nothing special - all the places already have a struct sock
at hands, so use the sock_net() net.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Acked-by: Denis V. Lunev <den@openvz.org>

---
 include/net/udp.h |    2 +-
 net/ipv4/udp.c    |   11 +++++++----
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/include/net/udp.h b/include/net/udp.h
index 7a86848..1331909 100644
--- a/include/net/udp.h
+++ b/include/net/udp.h
@@ -158,7 +158,7 @@ DECLARE_SNMP_STAT(struct udp_mib, udplite_stats_in6);
 /*
  * 	SNMP statistics for UDP and UDP-Lite
  */
-#define UDP_INC_STATS_USER(field, is_udplite)			       do {   \
+#define UDP_INC_STATS_USER(net, field, is_udplite)	      do { (void)net; \
 	if (is_udplite) SNMP_INC_STATS_USER(udplite_statistics, field);       \
 	else		SNMP_INC_STATS_USER(udp_statistics, field);  }  while(0)
 #define UDP_INC_STATS_BH(field, is_udplite) 			       do  {  \
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 3bbf6fb..c97da53 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -526,7 +526,8 @@ out:
 	up->len = 0;
 	up->pending = 0;
 	if (!err)
-		UDP_INC_STATS_USER(UDP_MIB_OUTDATAGRAMS, is_udplite);
+		UDP_INC_STATS_USER(sock_net(sk),
+				UDP_MIB_OUTDATAGRAMS, is_udplite);
 	return err;
 }
 
@@ -725,7 +726,8 @@ out:
 	 * seems like overkill.
 	 */
 	if (err == -ENOBUFS || test_bit(SOCK_NOSPACE, &sk->sk_socket->flags)) {
-		UDP_INC_STATS_USER(UDP_MIB_SNDBUFERRORS, is_udplite);
+		UDP_INC_STATS_USER(sock_net(sk),
+				UDP_MIB_SNDBUFERRORS, is_udplite);
 	}
 	return err;
 
@@ -888,7 +890,8 @@ try_again:
 		goto out_free;
 
 	if (!peeked)
-		UDP_INC_STATS_USER(UDP_MIB_INDATAGRAMS, is_udplite);
+		UDP_INC_STATS_USER(sock_net(sk),
+				UDP_MIB_INDATAGRAMS, is_udplite);
 
 	sock_recv_timestamp(msg, sk, skb);
 
@@ -917,7 +920,7 @@ out:
 csum_copy_err:
 	lock_sock(sk);
 	if (!skb_kill_datagram(sk, skb, flags))
-		UDP_INC_STATS_USER(UDP_MIB_INERRORS, is_udplite);
+		UDP_INC_STATS_USER(sock_net(sk), UDP_MIB_INERRORS, is_udplite);
 	release_sock(sk);
 
 	if (noblock)
-- 
1.5.3.4


  reply	other threads:[~2008-07-04 12:02 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-04 11:58 [PATCH 0/4] MIB: add struct net to UDP accounting macros Pavel Emelyanov
2008-07-04 12:00 ` Pavel Emelyanov [this message]
2008-07-04 12:02 ` [PATCH 2/4] MIB: add struct net to UDP_INC_STATS_BH Pavel Emelyanov
2008-07-04 12:03 ` [PATCH net-next 3/4] MIB: add struct net to UDP6_INC_STATS_USER Pavel Emelyanov
2008-07-04 12:04 ` [PATCH 4/4] MIB: add struct net to UDP6_INC_STATS_BH Pavel Emelyanov
2008-07-06  4:21 ` [PATCH 0/4] MIB: add struct net to UDP accounting macros David Miller
2008-07-07  8:13   ` Pavel Emelyanov
2008-07-07  8:47     ` David Miller
2008-07-10 11:04       ` Thomas Graf
2008-07-07 10:19     ` Daniel Lezcano
2008-07-07 11:54       ` Global namespace naming, and monitoring Eric W. Biederman

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=486E10CE.7080902@openvz.org \
    --to=xemul@openvz.org \
    --cc=davem@davemloft.net \
    --cc=den@openvz.org \
    --cc=netdev@vger.kernel.org \
    /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).