From: Hans Schillstrom <hans@schillstrom.com>
To: ja@ssi.bg, horms@verge.net.au, ebiederm@xmission.com,
lvs-devel@vger.kernel.org, netdev@vger.kernel.org,
netfilter-devel@vger.kernel.org
Cc: hans.schillstrom@ericsson.com, Hans Schillstrom <hans@schillstrom.com>
Subject: [v4 PATCH 6/6] IPVS: add debug functions
Date: Sun, 1 May 2011 18:50:18 +0200 [thread overview]
Message-ID: <1304268618-18103-7-git-send-email-hans@schillstrom.com> (raw)
In-Reply-To: <1304268618-18103-1-git-send-email-hans@schillstrom.com>
Optional patch, but it is nice to have.
Signed-off-by: Hans Schillstrom <hans.schillstrom@ericsson.com>
Signed-off-by: Hans Schillstrom <hans@schillstrom.com>
---
net/netfilter/ipvs/ip_vs_ctl.c | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
index 9074c5d..a1fab5b 100644
--- a/net/netfilter/ipvs/ip_vs_ctl.c
+++ b/net/netfilter/ipvs/ip_vs_ctl.c
@@ -351,8 +351,11 @@ static int ip_vs_svc_unhash(struct ip_vs_service *svc)
svc->flags &= ~IP_VS_SVC_F_HASHED;
atomic_dec(&svc->refcnt);
/* No more services, no need for input */
- if (atomic_read(&svc->refcnt) == 0)
+ if (atomic_read(&svc->refcnt) == 0) {
net_ipvs(svc->net)->enable = 0;
+ IP_VS_DBG(2, "Last service removed in net(%d) input disabled\n",
+ net_ipvs(svc->net)->gen);
+ }
return 1;
}
@@ -1222,6 +1225,10 @@ ip_vs_add_service(struct net *net, struct ip_vs_service_user_kern *u,
write_unlock_bh(&__ip_vs_svc_lock);
*svc_p = svc;
+ if (!ipvs->enable)
+ pr_info("netns(%d) enabled, first service added\n",
+ ipvs->gen);
+
/* Now there is a service - full throttle */
ipvs->enable = 1;
return 0;
@@ -3685,6 +3692,7 @@ int __net_init ip_vs_control_net_init(struct net *net)
int idx;
struct netns_ipvs *ipvs = net_ipvs(net);
+ EnterFunction(2);
ipvs->rs_lock = __RW_LOCK_UNLOCKED(ipvs->rs_lock);
/* Initialize rs_table */
@@ -3711,6 +3719,7 @@ int __net_init ip_vs_control_net_init(struct net *net)
if (ip_vs_control_net_init_sysctl(net))
goto err;
+ LeaveFunction(2);
return 0;
err:
@@ -3722,6 +3731,7 @@ void __net_exit ip_vs_control_net_cleanup(struct net *net)
{
struct netns_ipvs *ipvs = net_ipvs(net);
+ EnterFunction(2);
ip_vs_trash_cleanup(net);
ip_vs_stop_estimator(net, &ipvs->tot_stats);
ip_vs_control_net_cleanup_sysctl(net);
@@ -3729,6 +3739,7 @@ void __net_exit ip_vs_control_net_cleanup(struct net *net)
proc_net_remove(net, "ip_vs_stats");
proc_net_remove(net, "ip_vs");
free_percpu(ipvs->tot_stats.cpustats);
+ LeaveFunction(2);
}
int __init ip_vs_control_init(void)
--
1.7.2.3
next prev parent reply other threads:[~2011-05-01 16:50 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-01 16:50 [v2 PATCH 0/6] IPVS: init and cleanup Hans Schillstrom
2011-05-01 16:50 ` [v4 PATCH 1/6] IPVS: Change of socket usage to enable name space exit Hans Schillstrom
2011-05-02 11:03 ` Simon Horman
2011-05-01 16:50 ` [v4 PATCH 2/6] IPVS: labels at pos 0 Hans Schillstrom
2011-05-01 16:50 ` [v4 PATCH 3/6] IPVS: init and cleanup restructuring Hans Schillstrom
2011-05-01 16:50 ` [v4 PATCH 4/6] IPVS: rename of netns init and cleanup functions Hans Schillstrom
2011-05-01 16:50 ` [v4 PATCH 5/6] IPVS: remove unused " Hans Schillstrom
2011-05-01 16:50 ` Hans Schillstrom [this message]
2011-05-01 17:48 ` [v2 PATCH 0/6] IPVS: init and cleanup Julian Anastasov
2011-06-13 8:18 ` Simon Horman
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=1304268618-18103-7-git-send-email-hans@schillstrom.com \
--to=hans@schillstrom.com \
--cc=ebiederm@xmission.com \
--cc=hans.schillstrom@ericsson.com \
--cc=horms@verge.net.au \
--cc=ja@ssi.bg \
--cc=lvs-devel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@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).