Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 41ac51ee authored by Patrick Schaaf's avatar Patrick Schaaf Committed by Simon Horman
Browse files

ipvs: make "no destination available" message more informative



When IP_VS schedulers do not find a destination, they output a terse
"WLC: no destination available" message through kernel syslog, which I
can not only make sense of because syslog puts them in a logfile
together with keepalived checker results.

This patch makes the output a bit more informative, by telling you which
virtual service failed to find a destination.

Example output:

kernel: [1539214.552233] IPVS: wlc: TCP 192.168.8.30:22 - no destination available
kernel: [1539299.674418] IPVS: wlc: FWM 22 0x00000016 - no destination available

I have tested the code for IPv4 and FWM services, as you can see from
the example; I do not have an IPv6 setup to test the third code path
with.

To avoid code duplication, I put a new function ip_vs_scheduler_err()
into ip_vs_sched.c, and use that from the schedulers instead of calling
IP_VS_ERR_RL directly.

Signed-off-by: default avatarPatrick Schaaf <netdev@bof.de>
Signed-off-by: default avatarSimon Horman <horms@verge.net.au>
parent 6cb90db5
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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)
+1 −1
Original line number Diff line number Diff line
@@ -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;
	}

+1 −1
Original line number Diff line number Diff line
@@ -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;
		}
+1 −1
Original line number Diff line number Diff line
@@ -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",
+1 −1
Original line number Diff line number Diff line
@@ -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;
	}

Loading