netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] ipv6: make unsolicited report intervals configurable for mld
@ 2013-08-12  1:48 Hannes Frederic Sowa
  2013-08-12  2:23 ` Cong Wang
  2013-08-12 10:16 ` [PATCH net-next] ipv6: make unsolicited report intervals configurable for mld William Manley
  0 siblings, 2 replies; 6+ messages in thread
From: Hannes Frederic Sowa @ 2013-08-12  1:48 UTC (permalink / raw)
  To: netdev; +Cc: william.manley, bcrl, yoshfuji

Commit cab70040dfd95ee32144f02fade64f0cb94f31a0 ("net: igmp:
Reduce Unsolicited report interval to 1s when using IGMPv3") and
2690048c01f32bf45d1c1e1ab3079bc10ad2aea7 ("net: igmp: Allow user-space
configuration of igmp unsolicited report interval") by William Manley made
igmp unsolicited report intervals configurable per interface and corrected
the interval of unsolicited igmpv3 report messages resendings to 1s.

Same needs to be done for IPv6:

MLDv1 (RFC2710 7.10.): 10 seconds
MLDv2 (RFC3810 9.11.): 1 second

Both intervals are configurable via new procfs knobs
mldv1_unsolicited_report_interval and mldv2_unsolicited_report_interval.

Cc: William Manley <william.manley@youview.com>
Cc: Benjamin LaHaise <bcrl@kvack.org>
Cc: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
---
 include/linux/ipv6.h      |  2 ++
 include/uapi/linux/ipv6.h |  2 ++
 net/ipv6/addrconf.c       | 25 +++++++++++++++++++++++++
 net/ipv6/mcast.c          | 17 ++++++++++++++---
 4 files changed, 43 insertions(+), 3 deletions(-)

diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index 850e95b..77a4784 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -19,6 +19,8 @@ struct ipv6_devconf {
 	__s32		rtr_solicit_interval;
 	__s32		rtr_solicit_delay;
 	__s32		force_mld_version;
+	__s32		mldv1_unsolicited_report_interval;
+	__s32		mldv2_unsolicited_report_interval;
 #ifdef CONFIG_IPV6_PRIVACY
 	__s32		use_tempaddr;
 	__s32		temp_valid_lft;
diff --git a/include/uapi/linux/ipv6.h b/include/uapi/linux/ipv6.h
index 4bda4cf..315f133 100644
--- a/include/uapi/linux/ipv6.h
+++ b/include/uapi/linux/ipv6.h
@@ -147,6 +147,8 @@ enum {
 	DEVCONF_MAX_DESYNC_FACTOR,
 	DEVCONF_MAX_ADDRESSES,
 	DEVCONF_FORCE_MLD_VERSION,
+	DEVCONF_MLDV1_UNSOLICITED_REPORT_INTERVAL,
+	DEVCONF_MLDV2_UNSOLICITED_REPORT_INTERVAL,
 	DEVCONF_ACCEPT_RA_DEFRTR,
 	DEVCONF_ACCEPT_RA_PINFO,
 	DEVCONF_ACCEPT_RA_RTR_PREF,
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 7fd8572..158c5e1 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -177,6 +177,8 @@ static struct ipv6_devconf ipv6_devconf __read_mostly = {
 	.accept_redirects	= 1,
 	.autoconf		= 1,
 	.force_mld_version	= 0,
+	.mldv1_unsolicited_report_interval = 10*HZ,
+	.mldv2_unsolicited_report_interval = HZ,
 	.dad_transmits		= 1,
 	.rtr_solicits		= MAX_RTR_SOLICITATIONS,
 	.rtr_solicit_interval	= RTR_SOLICITATION_INTERVAL,
@@ -211,6 +213,9 @@ static struct ipv6_devconf ipv6_devconf_dflt __read_mostly = {
 	.accept_ra		= 1,
 	.accept_redirects	= 1,
 	.autoconf		= 1,
+	.force_mld_version	= 0,
+	.mldv1_unsolicited_report_interval = 10*HZ,
+	.mldv2_unsolicited_report_interval = HZ,
 	.dad_transmits		= 1,
 	.rtr_solicits		= MAX_RTR_SOLICITATIONS,
 	.rtr_solicit_interval	= RTR_SOLICITATION_INTERVAL,
@@ -4179,6 +4184,10 @@ static inline void ipv6_store_devconf(struct ipv6_devconf *cnf,
 	array[DEVCONF_RTR_SOLICIT_DELAY] =
 		jiffies_to_msecs(cnf->rtr_solicit_delay);
 	array[DEVCONF_FORCE_MLD_VERSION] = cnf->force_mld_version;
+	array[DEVCONF_MLDV1_UNSOLICITED_REPORT_INTERVAL] =
+		jiffies_to_msecs(cnf->mldv1_unsolicited_report_interval);
+	array[DEVCONF_MLDV2_UNSOLICITED_REPORT_INTERVAL] =
+		jiffies_to_msecs(cnf->mldv2_unsolicited_report_interval);
 #ifdef CONFIG_IPV6_PRIVACY
 	array[DEVCONF_USE_TEMPADDR] = cnf->use_tempaddr;
 	array[DEVCONF_TEMP_VALID_LFT] = cnf->temp_valid_lft;
@@ -4862,6 +4871,22 @@ static struct addrconf_sysctl_table
 			.mode		= 0644,
 			.proc_handler	= proc_dointvec,
 		},
+		{
+			.procname	= "mldv1_unsolicited_report_interval",
+			.data		=
+				&ipv6_devconf.mldv1_unsolicited_report_interval,
+			.maxlen		= sizeof(int),
+			.mode		= 0644,
+			.proc_handler	= proc_dointvec_ms_jiffies,
+		},
+		{
+			.procname	= "mldv2_unsolicited_report_interval",
+			.data		=
+				&ipv6_devconf.mldv2_unsolicited_report_interval,
+			.maxlen		= sizeof(int),
+			.mode		= 0644,
+			.proc_handler	= proc_dointvec_ms_jiffies,
+		},
 #ifdef CONFIG_IPV6_PRIVACY
 		{
 			.procname	= "use_tempaddr",
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index db25b8e..6c76df9 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -108,7 +108,6 @@ static int ip6_mc_leave_src(struct sock *sk, struct ipv6_mc_socklist *iml,
 			    struct inet6_dev *idev);
 
 
-#define IGMP6_UNSOLICITED_IVAL	(10*HZ)
 #define MLD_QRV_DEFAULT		2
 
 #define MLD_V1_SEEN(idev) (dev_net((idev)->dev)->ipv6.devconf_all->force_mld_version == 1 || \
@@ -129,6 +128,18 @@ int sysctl_mld_max_msf __read_mostly = IPV6_MLD_MAX_MSF;
 	     pmc != NULL;					\
 	     pmc = rcu_dereference(pmc->next))
 
+static int unsolicited_report_interval(struct inet6_dev *idev)
+{
+	int iv;
+
+	if (MLD_V1_SEEN(idev))
+		iv = idev->cnf.mldv1_unsolicited_report_interval;
+	else
+		iv = idev->cnf.mldv2_unsolicited_report_interval;
+
+	return iv > 0 ? iv : 1;
+}
+
 int ipv6_sock_mc_join(struct sock *sk, int ifindex, const struct in6_addr *addr)
 {
 	struct net_device *dev = NULL;
@@ -2158,7 +2169,7 @@ static void igmp6_join_group(struct ifmcaddr6 *ma)
 
 	igmp6_send(&ma->mca_addr, ma->idev->dev, ICMPV6_MGM_REPORT);
 
-	delay = net_random() % IGMP6_UNSOLICITED_IVAL;
+	delay = net_random() % unsolicited_report_interval(ma->idev);
 
 	spin_lock_bh(&ma->mca_lock);
 	if (del_timer(&ma->mca_timer)) {
@@ -2325,7 +2336,7 @@ void ipv6_mc_init_dev(struct inet6_dev *idev)
 	setup_timer(&idev->mc_dad_timer, mld_dad_timer_expire,
 		    (unsigned long)idev);
 	idev->mc_qrv = MLD_QRV_DEFAULT;
-	idev->mc_maxdelay = IGMP6_UNSOLICITED_IVAL;
+	idev->mc_maxdelay = unsolicited_report_interval(idev);
 	idev->mc_v1_seen = 0;
 	write_unlock_bh(&idev->lock);
 }
-- 
1.8.3.1

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

* Re: [PATCH net-next] ipv6: make unsolicited report intervals configurable for mld
  2013-08-12  1:48 [PATCH net-next] ipv6: make unsolicited report intervals configurable for mld Hannes Frederic Sowa
@ 2013-08-12  2:23 ` Cong Wang
  2013-08-12  3:33   ` [PATCH net-next] net: documentation update for IGMP/MLD unsolicited report interval knobs Hannes Frederic Sowa
  2013-08-12 10:16 ` [PATCH net-next] ipv6: make unsolicited report intervals configurable for mld William Manley
  1 sibling, 1 reply; 6+ messages in thread
From: Cong Wang @ 2013-08-12  2:23 UTC (permalink / raw)
  To: netdev

On Mon, 12 Aug 2013 at 01:48 GMT, Hannes Frederic Sowa <hannes@stressinduktion.org> wrote:
> Commit cab70040dfd95ee32144f02fade64f0cb94f31a0 ("net: igmp:
> Reduce Unsolicited report interval to 1s when using IGMPv3") and
> 2690048c01f32bf45d1c1e1ab3079bc10ad2aea7 ("net: igmp: Allow user-space
> configuration of igmp unsolicited report interval") by William Manley made
> igmp unsolicited report intervals configurable per interface and corrected
> the interval of unsolicited igmpv3 report messages resendings to 1s.
>
> Same needs to be done for IPv6:
>
> MLDv1 (RFC2710 7.10.): 10 seconds
> MLDv2 (RFC3810 9.11.): 1 second
>
> Both intervals are configurable via new procfs knobs
> mldv1_unsolicited_report_interval and mldv2_unsolicited_report_interval.
>

Please update the doc as well.

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

* [PATCH net-next] net: documentation update for IGMP/MLD unsolicited report interval knobs
  2013-08-12  2:23 ` Cong Wang
@ 2013-08-12  3:33   ` Hannes Frederic Sowa
  2013-08-12  4:08     ` David Miller
  0 siblings, 1 reply; 6+ messages in thread
From: Hannes Frederic Sowa @ 2013-08-12  3:33 UTC (permalink / raw)
  To: Cong Wang; +Cc: netdev, william.manley, bcrl

Joined documentation update for IPv4 and IPv6 MLD/IGMP
unsolicited_report_interval procfs knobs.

Cc: Cong Wang <xiyou.wangcong@gmail.com>
Cc: William Manley <william.manley@youview.com>
Cc: Benjamin LaHaise <bcrl@kvack.org>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
---
 Documentation/networking/ip-sysctl.txt | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt
index 36be26b..debfe85 100644
--- a/Documentation/networking/ip-sysctl.txt
+++ b/Documentation/networking/ip-sysctl.txt
@@ -1039,7 +1039,15 @@ disable_policy - BOOLEAN
 disable_xfrm - BOOLEAN
 	Disable IPSEC encryption on this interface, whatever the policy
 
+igmpv2_unsolicited_report_interval - INTEGER
+	The interval in milliseconds in which the next unsolicited
+	IGMPv1 or IGMPv2 report retransmit will take place.
+	Default: 10000 (10 seconds)
 
+igmpv3_unsolicited_report_interval - INTEGER
+	The interval in milliseconds in which the next unsolicited
+	IGMPv3 report retransmit will take place.
+	Default: 1000 (1 seconds)
 
 tag - INTEGER
 	Allows you to write a number, which can be used as required.
@@ -1331,6 +1339,16 @@ ndisc_notify - BOOLEAN
 	1 - Generate unsolicited neighbour advertisements when device is brought
 	    up or hardware address changes.
 
+mldv1_unsolicited_report_interval - INTEGER
+	The interval in milliseconds in which the next unsolicited
+	MLDv1 report retransmit will take place.
+	Default: 10000 (10 seconds)
+
+mldv2_unsolicited_report_interval - INTEGER
+	The interval in milliseconds in which the next unsolicited
+	MLDv2 report retransmit will take place.
+	Default: 1000 (1 second)
+
 icmp/*:
 ratelimit - INTEGER
 	Limit the maximal rates for sending ICMPv6 packets.
-- 
1.8.3.1

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

* Re: [PATCH net-next] net: documentation update for IGMP/MLD unsolicited report interval knobs
  2013-08-12  3:33   ` [PATCH net-next] net: documentation update for IGMP/MLD unsolicited report interval knobs Hannes Frederic Sowa
@ 2013-08-12  4:08     ` David Miller
  0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2013-08-12  4:08 UTC (permalink / raw)
  To: hannes; +Cc: xiyou.wangcong, netdev, william.manley, bcrl

From: Hannes Frederic Sowa <hannes@stressinduktion.org>
Date: Mon, 12 Aug 2013 05:33:58 +0200

> Joined documentation update for IPv4 and IPv6 MLD/IGMP
> unsolicited_report_interval procfs knobs.
> 
> Cc: Cong Wang <xiyou.wangcong@gmail.com>
> Cc: William Manley <william.manley@youview.com>
> Cc: Benjamin LaHaise <bcrl@kvack.org>
> Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>

Update your ipv6 patch to include these changes, don't make them
seperately.

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

* Re: [PATCH net-next] ipv6: make unsolicited report intervals configurable for mld
  2013-08-12  1:48 [PATCH net-next] ipv6: make unsolicited report intervals configurable for mld Hannes Frederic Sowa
  2013-08-12  2:23 ` Cong Wang
@ 2013-08-12 10:16 ` William Manley
  2013-08-12 11:09   ` Hannes Frederic Sowa
  1 sibling, 1 reply; 6+ messages in thread
From: William Manley @ 2013-08-12 10:16 UTC (permalink / raw)
  To: netdev, bcrl, yoshfuji

On 12/08/13 02:48, Hannes Frederic Sowa wrote:
> Commit cab70040dfd95ee32144f02fade64f0cb94f31a0 ("net: igmp:
> Reduce Unsolicited report interval to 1s when using IGMPv3") and
> 2690048c01f32bf45d1c1e1ab3079bc10ad2aea7 ("net: igmp: Allow user-space
> configuration of igmp unsolicited report interval") by William Manley made
> igmp unsolicited report intervals configurable per interface and corrected
> the interval of unsolicited igmpv3 report messages resendings to 1s.
>
> Same needs to be done for IPv6:
>
> MLDv1 (RFC2710 7.10.): 10 seconds
> MLDv2 (RFC3810 9.11.): 1 second
>
> Both intervals are configurable via new procfs knobs
> mldv1_unsolicited_report_interval and mldv2_unsolicited_report_interval.
>
> Cc: William Manley<william.manley@youview.com>
> Cc: Benjamin LaHaise<bcrl@kvack.org>
> Cc: YOSHIFUJI Hideaki<yoshfuji@linux-ipv6.org>
> Signed-off-by: Hannes Frederic Sowa<hannes@stressinduktion.org>

Thanks for this.  I'd meant to save you the bother.

> diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
> index 7fd8572..158c5e1 100644
> --- a/net/ipv6/addrconf.c
> +++ b/net/ipv6/addrconf.c
> @@ -177,6 +177,8 @@ static struct ipv6_devconf ipv6_devconf __read_mostly = {
>   	.accept_redirects	= 1,
>   	.autoconf		= 1,
>   	.force_mld_version	= 0,
> +	.mldv1_unsolicited_report_interval = 10*HZ,

I think you want spaces around that * operator.

> +	.mldv2_unsolicited_report_interval = HZ,
>   	.dad_transmits		= 1,
>   	.rtr_solicits		= MAX_RTR_SOLICITATIONS,
>   	.rtr_solicit_interval	= RTR_SOLICITATION_INTERVAL,
> @@ -211,6 +213,9 @@ static struct ipv6_devconf ipv6_devconf_dflt __read_mostly = {
>   	.accept_ra		= 1,
>   	.accept_redirects	= 1,
>   	.autoconf		= 1,
> +	.force_mld_version	= 0,

Is this a tidyup or does it make a functional difference to this patch? 
  I suspect the former but I thought I'd check for my own understanding.

> +	.mldv1_unsolicited_report_interval = 10*HZ,

Spaces here as well

Thanks

Will

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

* Re: [PATCH net-next] ipv6: make unsolicited report intervals configurable for mld
  2013-08-12 10:16 ` [PATCH net-next] ipv6: make unsolicited report intervals configurable for mld William Manley
@ 2013-08-12 11:09   ` Hannes Frederic Sowa
  0 siblings, 0 replies; 6+ messages in thread
From: Hannes Frederic Sowa @ 2013-08-12 11:09 UTC (permalink / raw)
  To: William Manley; +Cc: netdev, bcrl, yoshfuji

On Mon, Aug 12, 2013 at 11:16:34AM +0100, William Manley wrote:
> On 12/08/13 02:48, Hannes Frederic Sowa wrote:
> >Commit cab70040dfd95ee32144f02fade64f0cb94f31a0 ("net: igmp:
> >Reduce Unsolicited report interval to 1s when using IGMPv3") and
> >2690048c01f32bf45d1c1e1ab3079bc10ad2aea7 ("net: igmp: Allow user-space
> >configuration of igmp unsolicited report interval") by William Manley made
> >igmp unsolicited report intervals configurable per interface and corrected
> >the interval of unsolicited igmpv3 report messages resendings to 1s.
> >
> >Same needs to be done for IPv6:
> >
> >MLDv1 (RFC2710 7.10.): 10 seconds
> >MLDv2 (RFC3810 9.11.): 1 second
> >
> >Both intervals are configurable via new procfs knobs
> >mldv1_unsolicited_report_interval and mldv2_unsolicited_report_interval.
> >
> >Cc: William Manley<william.manley@youview.com>
> >Cc: Benjamin LaHaise<bcrl@kvack.org>
> >Cc: YOSHIFUJI Hideaki<yoshfuji@linux-ipv6.org>
> >Signed-off-by: Hannes Frederic Sowa<hannes@stressinduktion.org>
> 
> Thanks for this.  I'd meant to save you the bother.

I am very sorry if you already started with this. I feared it might already be
forgotten.

> >diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
> >index 7fd8572..158c5e1 100644
> >--- a/net/ipv6/addrconf.c
> >+++ b/net/ipv6/addrconf.c
> >@@ -177,6 +177,8 @@ static struct ipv6_devconf ipv6_devconf __read_mostly 
> >= {
> >  	.accept_redirects	= 1,
> >  	.autoconf		= 1,
> >  	.force_mld_version	= 0,
> >+	.mldv1_unsolicited_report_interval = 10*HZ,
> 
> I think you want spaces around that * operator.
> 
> >+	.mldv2_unsolicited_report_interval = HZ,
> >  	.dad_transmits		= 1,
> >  	.rtr_solicits		= MAX_RTR_SOLICITATIONS,
> >  	.rtr_solicit_interval	= RTR_SOLICITATION_INTERVAL,
> >@@ -211,6 +213,9 @@ static struct ipv6_devconf ipv6_devconf_dflt 
> >__read_mostly = {
> >  	.accept_ra		= 1,
> >  	.accept_redirects	= 1,
> >  	.autoconf		= 1,
> >+	.force_mld_version	= 0,
> 
> Is this a tidyup or does it make a functional difference to this patch? 
>  I suspect the former but I thought I'd check for my own understanding.

Yes, It is solely a small tidy up to bring both structs in line. I will
mention it in the commit message.

> 
> >+	.mldv1_unsolicited_report_interval = 10*HZ,
> 
> Spaces here as well
> 
I will incorporate your other feedback in my next patch.

Thanks you,

  Hannes

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

end of thread, other threads:[~2013-08-12 11:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-12  1:48 [PATCH net-next] ipv6: make unsolicited report intervals configurable for mld Hannes Frederic Sowa
2013-08-12  2:23 ` Cong Wang
2013-08-12  3:33   ` [PATCH net-next] net: documentation update for IGMP/MLD unsolicited report interval knobs Hannes Frederic Sowa
2013-08-12  4:08     ` David Miller
2013-08-12 10:16 ` [PATCH net-next] ipv6: make unsolicited report intervals configurable for mld William Manley
2013-08-12 11:09   ` Hannes Frederic Sowa

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).