Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 237534
b: refs/heads/master
c: 41ac51e
h: refs/heads/master
v: v3
  • Loading branch information
Patrick Schaaf authored and Simon Horman committed Feb 16, 2011
1 parent a6f1e42 commit 63e215e
Show file tree
Hide file tree
Showing 12 changed files with 44 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6cb90db502c5f276c8d6256762cc3acde4d3bd9d
refs/heads/master: 41ac51eeda58a85b8a06d748cce7035cc77deebd
2 changes: 2 additions & 0 deletions trunk/include/net/ip_vs.h
Original file line number Diff line number Diff line change
Expand Up @@ -1019,6 +1019,8 @@ ip_vs_schedule(struct ip_vs_service *svc, struct sk_buff *skb,
extern int ip_vs_leave(struct ip_vs_service *svc, struct sk_buff *skb,
struct ip_vs_proto_data *pd);

extern void ip_vs_scheduler_err(struct ip_vs_service *svc, const char *msg);


/*
* IPVS control data and functions (from ip_vs_ctl.c)
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/netfilter/ipvs/ip_vs_lblc.c
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,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_ERR_RL("LBLC: no destination available\n");
ip_vs_scheduler_err(svc, "no destination available");
return NULL;
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/net/netfilter/ipvs/ip_vs_lblcr.c
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,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_ERR_RL("LBLCR: no destination available\n");
ip_vs_scheduler_err(svc, "no destination available");
read_unlock(&svc->sched_lock);
return NULL;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/netfilter/ipvs/ip_vs_lc.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ ip_vs_lc_schedule(struct ip_vs_service *svc, const struct sk_buff *skb)
}

if (!least)
IP_VS_ERR_RL("LC: no destination available\n");
ip_vs_scheduler_err(svc, "no destination available");
else
IP_VS_DBG_BUF(6, "LC: server %s:%u activeconns %d "
"inactconns %d\n",
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/netfilter/ipvs/ip_vs_nq.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ ip_vs_nq_schedule(struct ip_vs_service *svc, const struct sk_buff *skb)
}

if (!least) {
IP_VS_ERR_RL("NQ: no destination available\n");
ip_vs_scheduler_err(svc, "no destination available");
return NULL;
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/net/netfilter/ipvs/ip_vs_rr.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,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");
ip_vs_scheduler_err(svc, "no destination available");
return NULL;

out:
Expand Down
25 changes: 25 additions & 0 deletions trunk/net/netfilter/ipvs/ip_vs_sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

#include <net/ip_vs.h>

EXPORT_SYMBOL(ip_vs_scheduler_err);
/*
* IPVS scheduler list
*/
Expand Down Expand Up @@ -146,6 +147,30 @@ void ip_vs_scheduler_put(struct ip_vs_scheduler *scheduler)
module_put(scheduler->module);
}

/*
* Common error output helper for schedulers
*/

void ip_vs_scheduler_err(struct ip_vs_service *svc, const char *msg)
{
if (svc->fwmark) {
IP_VS_ERR_RL("%s: FWM %u 0x%08X - %s\n",
svc->scheduler->name, svc->fwmark,
svc->fwmark, msg);
#ifdef CONFIG_IP_VS_IPV6
} else if (svc->af == AF_INET6) {
IP_VS_ERR_RL("%s: %s [%pI6]:%d - %s\n",
svc->scheduler->name,
ip_vs_proto_name(svc->protocol),
&svc->addr.in6, ntohs(svc->port), msg);
#endif
} else {
IP_VS_ERR_RL("%s: %s %pI4:%d - %s\n",
svc->scheduler->name,
ip_vs_proto_name(svc->protocol),
&svc->addr.ip, ntohs(svc->port), msg);
}
}

/*
* Register a scheduler in the scheduler list
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/netfilter/ipvs/ip_vs_sed.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,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");
ip_vs_scheduler_err(svc, "no destination available");
return NULL;

/*
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/netfilter/ipvs/ip_vs_sh.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,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");
ip_vs_scheduler_err(svc, "no destination available");
return NULL;
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/net/netfilter/ipvs/ip_vs_wlc.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,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");
ip_vs_scheduler_err(svc, "no destination available");
return NULL;

/*
Expand Down
14 changes: 8 additions & 6 deletions trunk/net/netfilter/ipvs/ip_vs_wrr.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,9 @@ 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");
ip_vs_scheduler_err(svc,
"no destination available: "
"no destinations present");
dest = NULL;
goto out;
}
Expand All @@ -162,8 +163,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("WRR: no destination "
"available\n");
ip_vs_scheduler_err(svc,
"no destination available");
dest = NULL;
goto out;
}
Expand All @@ -185,8 +186,9 @@ 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");
ip_vs_scheduler_err(svc,
"no destination available: "
"all destinations are overloaded");
goto out;
}
}
Expand Down

0 comments on commit 63e215e

Please sign in to comment.