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

Commit b14198f6 authored by Julius Volz's avatar Julius Volz Committed by Simon Horman
Browse files

IPVS: Add IPv6 support flag to schedulers



Add 'supports_ipv6' flag to struct ip_vs_scheduler to indicate whether a
scheduler supports IPv6. Set the flag to 1 in schedulers that work with
IPv6, 0 otherwise. This flag is checked in a later patch while trying to
add a service with a specific scheduler. Adjust debug in v6-supporting
schedulers to work with both address families.

Signed-off-by: default avatarJulius Volz <juliusv@google.com>
Signed-off-by: default avatarSimon Horman <horms@verge.net.au>
parent 3c2e0505
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -516,6 +516,9 @@ struct ip_vs_scheduler {
	char			*name;		/* scheduler name */
	atomic_t		refcnt;		/* reference counter */
	struct module		*module;	/* THIS_MODULE/NULL */
#ifdef CONFIG_IP_VS_IPV6
	int			supports_ipv6;	/* scheduler has IPv6 support */
#endif

	/* scheduler initializing service */
	int (*init_service)(struct ip_vs_service *svc);
+3 −0
Original line number Diff line number Diff line
@@ -234,6 +234,9 @@ static struct ip_vs_scheduler ip_vs_dh_scheduler =
	.refcnt =		ATOMIC_INIT(0),
	.module =		THIS_MODULE,
	.n_list =		LIST_HEAD_INIT(ip_vs_dh_scheduler.n_list),
#ifdef CONFIG_IP_VS_IPV6
	.supports_ipv6 =	0,
#endif
	.init_service =		ip_vs_dh_init_svc,
	.done_service =		ip_vs_dh_done_svc,
	.update_service =	ip_vs_dh_update_svc,
+3 −0
Original line number Diff line number Diff line
@@ -522,6 +522,9 @@ static struct ip_vs_scheduler ip_vs_lblc_scheduler =
	.refcnt =		ATOMIC_INIT(0),
	.module =		THIS_MODULE,
	.n_list =		LIST_HEAD_INIT(ip_vs_lblc_scheduler.n_list),
#ifdef CONFIG_IP_VS_IPV6
	.supports_ipv6 =	0,
#endif
	.init_service =		ip_vs_lblc_init_svc,
	.done_service =		ip_vs_lblc_done_svc,
	.schedule =		ip_vs_lblc_schedule,
+3 −0
Original line number Diff line number Diff line
@@ -722,6 +722,9 @@ static struct ip_vs_scheduler ip_vs_lblcr_scheduler =
	.refcnt =		ATOMIC_INIT(0),
	.module =		THIS_MODULE,
	.n_list =		LIST_HEAD_INIT(ip_vs_lblcr_scheduler.n_list),
#ifdef CONFIG_IP_VS_IPV6
	.supports_ipv6 =	0,
#endif
	.init_service =		ip_vs_lblcr_init_svc,
	.done_service =		ip_vs_lblcr_done_svc,
	.schedule =		ip_vs_lblcr_schedule,
+7 −4
Original line number Diff line number Diff line
@@ -67,8 +67,8 @@ ip_vs_lc_schedule(struct ip_vs_service *svc, const struct sk_buff *skb)
	}

	if (least)
	IP_VS_DBG(6, "LC: server %u.%u.%u.%u:%u activeconns %d inactconns %d\n",
		  NIPQUAD(least->addr.ip), ntohs(least->port),
	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));

@@ -81,6 +81,9 @@ static struct ip_vs_scheduler ip_vs_lc_scheduler = {
	.refcnt =		ATOMIC_INIT(0),
	.module =		THIS_MODULE,
	.n_list =		LIST_HEAD_INIT(ip_vs_lc_scheduler.n_list),
#ifdef CONFIG_IP_VS_IPV6
	.supports_ipv6 =	1,
#endif
	.schedule =		ip_vs_lc_schedule,
};

Loading