IPVS: Make "no destination available" message more consistent between schedulers
authorSimon Horman <horms@verge.net.au>
Tue, 30 Dec 2008 02:37:36 +0000 (18:37 -0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 30 Dec 2008 02:37:36 +0000 (18:37 -0800)
Acked-by: Graeme Fowler <graeme@graemef.net>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/netfilter/ipvs/ip_vs_lblc.c
net/netfilter/ipvs/ip_vs_lblcr.c
net/netfilter/ipvs/ip_vs_lc.c
net/netfilter/ipvs/ip_vs_nq.c
net/netfilter/ipvs/ip_vs_rr.c
net/netfilter/ipvs/ip_vs_sed.c
net/netfilter/ipvs/ip_vs_sh.c
net/netfilter/ipvs/ip_vs_wlc.c
net/netfilter/ipvs/ip_vs_wrr.c

index 9394f539966aea9f91dd37a6165969d31b5a8ee8..3eb5e2660c49265cf3bd1dc3533c263f53c5c650 100644 (file)
@@ -507,7 +507,7 @@ ip_vs_lblc_schedule(struct ip_vs_service *svc, const struct sk_buff *skb)
        /* 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 92dc76a6842cc101a1f14afed07ae65841d10440..c04ce56c7f0fca0d9e257cd5bef6d59b16d45655 100644 (file)
@@ -690,7 +690,7 @@ ip_vs_lblcr_schedule(struct ip_vs_service *svc, const struct sk_buff *skb)
                /* 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 51912cab777bb5349012709639c1efa1ff774005..d0dadc8a65fda50d8b26d1e64f66d8c1a854baa0 100644 (file)
@@ -66,11 +66,15 @@ ip_vs_lc_schedule(struct ip_vs_service *svc, const struct sk_buff *skb)
                }
        }
 
-       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 6758ad2ceaaf66130f881ff672cc0d9444d1416a..694952db502601156dbcd0ca8b02c72034b0ecbf 100644 (file)
@@ -95,8 +95,10 @@ ip_vs_nq_schedule(struct ip_vs_service *svc, const struct sk_buff *skb)
                }
        }
 
-       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 8fb51c169eb852daeb9e1117fde96f07a9d2b595..2d16ab7f8c1ec11ea2b284829036e57c2cbac8a8 100644 (file)
@@ -69,6 +69,7 @@ ip_vs_rr_schedule(struct ip_vs_service *svc, const struct sk_buff *skb)
                q = q->next;
        } while (q != p);
        write_unlock(&svc->sched_lock);
+       IP_VS_ERR_RL("RR: no destination available\n");
        return NULL;
 
   out:
index 691a6a0086e18c90f2b0548951b1218fc9a4958f..20e4657d2f3bb0e3ae2d902669baaf322f4d1b7d 100644 (file)
@@ -84,6 +84,7 @@ ip_vs_sed_schedule(struct ip_vs_service *svc, const struct sk_buff *skb)
                        goto nextstage;
                }
        }
+       IP_VS_ERR_RL("SED: no destination available\n");
        return NULL;
 
        /*
index 0e53955ef1396ec0d157163eb66ab00f2e590506..75709ebeb630384893fb56ef4c22d4df9b3a3eb0 100644 (file)
@@ -219,6 +219,7 @@ ip_vs_sh_schedule(struct ip_vs_service *svc, const struct sk_buff *skb)
            || !(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 57b452bbb4eab71f106e5e56f23259b3df7b18d8..8e942565b47de8ad75e994dac1525be4ccf617a1 100644 (file)
@@ -72,6 +72,7 @@ ip_vs_wlc_schedule(struct ip_vs_service *svc, const struct sk_buff *skb)
                        goto nextstage;
                }
        }
+       IP_VS_ERR_RL("WLC: no destination available\n");
        return NULL;
 
        /*
index 2f618dc29c5b69468b21ded446b13f18c1efebab..f7d74ef1ecf99a9735b2bfce87f00e2458a457b6 100644 (file)
@@ -155,6 +155,8 @@ ip_vs_wrr_schedule(struct ip_vs_service *svc, const struct sk_buff *skb)
 
                        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 *svc, const struct sk_buff *skb)
                                 */
                                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 *svc, const struct sk_buff *skb)
                        /* 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;
                }
        }