netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] IPVS: Make "no destination available" message more consistent between schedulers
@ 2008-12-30  0:46 Simon Horman
  2008-12-30  2:37 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Simon Horman @ 2008-12-30  0:46 UTC (permalink / raw)
  To: lvs-devel, netdev
  Cc: David Miller, Joseph Mack, Graeme Fowler, Siim Põder

Cc: Joseph Mack <jmack@wm7d.net>
Cc: Siim Põder <windo@p6drad-teel.net>
Acked-by: Graeme Fowler <graeme@graemef.net>
Signed-off-by: Simon Horman <horms@verge.net.au>

--- 

 net/netfilter/ipvs/ip_vs_lblc.c  |    2 +-
 net/netfilter/ipvs/ip_vs_lblcr.c |    2 +-
 net/netfilter/ipvs/ip_vs_lc.c    |   14 +++++++++-----
 net/netfilter/ipvs/ip_vs_nq.c    |    4 +++-
 net/netfilter/ipvs/ip_vs_rr.c    |    1 +
 net/netfilter/ipvs/ip_vs_sed.c   |    1 +
 net/netfilter/ipvs/ip_vs_sh.c    |    1 +
 net/netfilter/ipvs/ip_vs_wlc.c   |    1 +
 net/netfilter/ipvs/ip_vs_wrr.c   |    8 ++++++--
 9 files changed, 24 insertions(+), 10 deletions(-)

Index: net-next-2.6/net/netfilter/ipvs/ip_vs_lblc.c
===================================================================
--- net-next-2.6.orig/net/netfilter/ipvs/ip_vs_lblc.c	2008-12-30 11:21:16.000000000 +1100
+++ net-next-2.6/net/netfilter/ipvs/ip_vs_lblc.c	2008-12-30 11:30:05.000000000 +1100
@@ -507,7 +507,7 @@ ip_vs_lblc_schedule(struct ip_vs_service
 	/* No cache entry or it is invalid, time to schedule */
 	dest = __ip_vs_lblc_schedule(svc);
 	if (!dest) {
-		IP_VS_DBG(1, "no destination available\n");
+		IP_VS_ERR_RL("LBLC: no destination available\n");
 		return NULL;
 	}
 
Index: net-next-2.6/net/netfilter/ipvs/ip_vs_lblcr.c
===================================================================
--- net-next-2.6.orig/net/netfilter/ipvs/ip_vs_lblcr.c	2008-12-30 11:21:16.000000000 +1100
+++ net-next-2.6/net/netfilter/ipvs/ip_vs_lblcr.c	2008-12-30 11:30:05.000000000 +1100
@@ -690,7 +690,7 @@ ip_vs_lblcr_schedule(struct ip_vs_servic
 		/* The cache entry is invalid, time to schedule */
 		dest = __ip_vs_lblcr_schedule(svc);
 		if (!dest) {
-			IP_VS_DBG(1, "no destination available\n");
+			IP_VS_ERR_RL("LBLCR: no destination available\n");
 			read_unlock(&svc->sched_lock);
 			return NULL;
 		}
Index: net-next-2.6/net/netfilter/ipvs/ip_vs_lc.c
===================================================================
--- net-next-2.6.orig/net/netfilter/ipvs/ip_vs_lc.c	2008-12-30 11:21:16.000000000 +1100
+++ net-next-2.6/net/netfilter/ipvs/ip_vs_lc.c	2008-12-30 11:30:05.000000000 +1100
@@ -66,11 +66,15 @@ ip_vs_lc_schedule(struct ip_vs_service *
 		}
 	}
 
-	if (least)
-	IP_VS_DBG_BUF(6, "LC: server %s:%u activeconns %d inactconns %d\n",
-		      IP_VS_DBG_ADDR(svc->af, &least->addr), ntohs(least->port),
-		      atomic_read(&least->activeconns),
-		      atomic_read(&least->inactconns));
+	if (!least)
+		IP_VS_ERR_RL("LC: no destination available\n");
+	else
+		IP_VS_DBG_BUF(6, "LC: server %s:%u activeconns %d "
+			      "inactconns %d\n",
+			      IP_VS_DBG_ADDR(svc->af, &least->addr),
+			      ntohs(least->port),
+			      atomic_read(&least->activeconns),
+			      atomic_read(&least->inactconns));
 
 	return least;
 }
Index: net-next-2.6/net/netfilter/ipvs/ip_vs_nq.c
===================================================================
--- net-next-2.6.orig/net/netfilter/ipvs/ip_vs_nq.c	2008-12-30 11:21:16.000000000 +1100
+++ net-next-2.6/net/netfilter/ipvs/ip_vs_nq.c	2008-12-30 11:30:05.000000000 +1100
@@ -95,8 +95,10 @@ ip_vs_nq_schedule(struct ip_vs_service *
 		}
 	}
 
-	if (!least)
+	if (!least) {
+		IP_VS_ERR_RL("NQ: no destination available\n");
 		return NULL;
+	}
 
   out:
 	IP_VS_DBG_BUF(6, "NQ: server %s:%u "
Index: net-next-2.6/net/netfilter/ipvs/ip_vs_rr.c
===================================================================
--- net-next-2.6.orig/net/netfilter/ipvs/ip_vs_rr.c	2008-12-30 11:21:16.000000000 +1100
+++ net-next-2.6/net/netfilter/ipvs/ip_vs_rr.c	2008-12-30 11:30:05.000000000 +1100
@@ -69,6 +69,7 @@ ip_vs_rr_schedule(struct ip_vs_service *
 		q = q->next;
 	} while (q != p);
 	write_unlock(&svc->sched_lock);
+	IP_VS_ERR_RL("RR: no destination available\n");
 	return NULL;
 
   out:
Index: net-next-2.6/net/netfilter/ipvs/ip_vs_sed.c
===================================================================
--- net-next-2.6.orig/net/netfilter/ipvs/ip_vs_sed.c	2008-12-30 11:21:16.000000000 +1100
+++ net-next-2.6/net/netfilter/ipvs/ip_vs_sed.c	2008-12-30 11:30:05.000000000 +1100
@@ -84,6 +84,7 @@ ip_vs_sed_schedule(struct ip_vs_service 
 			goto nextstage;
 		}
 	}
+	IP_VS_ERR_RL("SED: no destination available\n");
 	return NULL;
 
 	/*
Index: net-next-2.6/net/netfilter/ipvs/ip_vs_sh.c
===================================================================
--- net-next-2.6.orig/net/netfilter/ipvs/ip_vs_sh.c	2008-12-30 11:21:16.000000000 +1100
+++ net-next-2.6/net/netfilter/ipvs/ip_vs_sh.c	2008-12-30 11:30:05.000000000 +1100
@@ -219,6 +219,7 @@ ip_vs_sh_schedule(struct ip_vs_service *
 	    || !(dest->flags & IP_VS_DEST_F_AVAILABLE)
 	    || atomic_read(&dest->weight) <= 0
 	    || is_overloaded(dest)) {
+		IP_VS_ERR_RL("SH: no destination available\n");
 		return NULL;
 	}
 
Index: net-next-2.6/net/netfilter/ipvs/ip_vs_wlc.c
===================================================================
--- net-next-2.6.orig/net/netfilter/ipvs/ip_vs_wlc.c	2008-12-30 11:21:16.000000000 +1100
+++ net-next-2.6/net/netfilter/ipvs/ip_vs_wlc.c	2008-12-30 11:30:05.000000000 +1100
@@ -72,6 +72,7 @@ ip_vs_wlc_schedule(struct ip_vs_service 
 			goto nextstage;
 		}
 	}
+	IP_VS_ERR_RL("WLC: no destination available\n");
 	return NULL;
 
 	/*
Index: net-next-2.6/net/netfilter/ipvs/ip_vs_wrr.c
===================================================================
--- net-next-2.6.orig/net/netfilter/ipvs/ip_vs_wrr.c	2008-12-30 11:21:16.000000000 +1100
+++ net-next-2.6/net/netfilter/ipvs/ip_vs_wrr.c	2008-12-30 11:30:05.000000000 +1100
@@ -155,6 +155,8 @@ ip_vs_wrr_schedule(struct ip_vs_service 
 
 			if (mark->cl == mark->cl->next) {
 				/* no dest entry */
+				IP_VS_ERR_RL("WRR: no destination available: "
+					     "no destinations present\n");
 				dest = NULL;
 				goto out;
 			}
@@ -168,8 +170,8 @@ ip_vs_wrr_schedule(struct ip_vs_service 
 				 */
 				if (mark->cw == 0) {
 					mark->cl = &svc->destinations;
-					IP_VS_ERR_RL("ip_vs_wrr_schedule(): "
-						   "no available servers\n");
+					IP_VS_ERR_RL("WRR: no destination "
+						     "available\n");
 					dest = NULL;
 					goto out;
 				}
@@ -191,6 +193,8 @@ ip_vs_wrr_schedule(struct ip_vs_service 
 			/* back to the start, and no dest is found.
 			   It is only possible when all dests are OVERLOADED */
 			dest = NULL;
+			IP_VS_ERR_RL("WRR: no destination available: "
+				     "all destinations are overloaded\n");
 			goto out;
 		}
 	}

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

* Re: [patch] IPVS: Make "no destination available" message more consistent between schedulers
  2008-12-30  0:46 [patch] IPVS: Make "no destination available" message more consistent between schedulers Simon Horman
@ 2008-12-30  2:37 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2008-12-30  2:37 UTC (permalink / raw)
  To: horms; +Cc: lvs-devel, netdev, jmack, graeme, windo

From: Simon Horman <horms@verge.net.au>
Date: Tue, 30 Dec 2008 11:46:44 +1100

> Acked-by: Graeme Fowler <graeme@graemef.net>
> Signed-off-by: Simon Horman <horms@verge.net.au>

Applied, thanks a lot Simon.

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

end of thread, other threads:[~2008-12-30  2:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-30  0:46 [patch] IPVS: Make "no destination available" message more consistent between schedulers Simon Horman
2008-12-30  2:37 ` 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).