sctp: make the max_burst min value to 1
Subsystems (3)
PATCH 1/1 sctp: make the max_burst min value to 1
From: Wang Weidong <[email protected]>
when I setted the max_burst to 0, do the lksctp-tools I got hang. I found sctp_transport_burst_limited would make the cwnd to 0. so I make the max_burst min value to 1.
--- net/sctp/sysctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/sctp/sysctl.c +1 -1
@@ -135,7 +135,7 @@ static struct ctl_table sctp_net_table[] = { .maxlen = sizeof(int), .mode = 0644, .proc_handler = proc_dointvec_minmax, - .extra1 = &zero, + .extra1 = &one, .extra2 = &int_max }, {
Signature · 1 line
1.7.12
Quoted 27 lines · Wang Weidong
From: Wang Weidong <[email protected]>
when I setted the
max_burstto 0, do the lksctp-tools I got hang. I foundsctp_transport_burst_limitedwould make the cwnd to 0. so I make themax_burstmin value to 1.Signed-off-by Wang Weidong <[email protected]>--- net/sctp/sysctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)net/sctp/sysctl.c +1
-1@@ -135,7 +135,7 @@ static struct ctl_table sctp_net_table[] = { .maxlen = sizeof(int), .mode = 0644, .proc_handler = proc_dointvec_minmax, - .extra1 = &zero, + .extra1 = &one, .extra2 = &int_max }, {Signature · 1 line
1.7.12
This seems like a band-aid to me. There are a few things wrong:
1) You can also set the the max_burst via setsockopt, and so this would need to be checked in that path as well.
2) I don't see how having a cwnd of zero would cause a hang. It looks like a cwnd of zero would perpetually place the association in a slow start state, which is silly but not illegal.
Please investigate the acutally root cause of the problem before just avoiding it like this.
Thanks!
Neil
Quoted 32 lines · Neil Horman
Quoted 27 lines · Wang Weidong
From: Wang Weidong <[email protected]>
when I setted the
max_burstto 0, do the lksctp-tools I got hang. I foundsctp_transport_burst_limitedwould make the cwnd to 0. so I make themax_burstmin value to 1.Signed-off-by Wang Weidong <[email protected]>--- net/sctp/sysctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)net/sctp/sysctl.c +1
-1@@ -135,7 +135,7 @@ static struct ctl_table sctp_net_table[] = { .maxlen = sizeof(int), .mode = 0644, .proc_handler = proc_dointvec_minmax, - .extra1 = &zero, + .extra1 = &one, .extra2 = &int_max }, {Signature · 1 line
1.7.12This seems like a band-aid to me. There are a few things wrong:
Quoted 7 lines
1) You can also set the the
max_burstvia setsockopt, and so this would need to be checked in that path as well.2) I don't see how having a cwnd of zero would cause a hang. It looks like a cwnd of zero would perpetually place the association in a slow start state, which is silly but not illegal.
Hm, Good suggestions. Ok, I will try it again and find the root cause. Thanks!
Quoted 12 lines
Please investigate the acutally root cause of the problem before just avoiding it like this.
Thanks!
Neil--
To unsubscribe from this list: send the line "unsubscribe linux-sctp" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 36 lines · Wang Weidong
Quoted 35 lines · Neil Horman
Quoted 27 lines · Wang Weidong
From: Wang Weidong <[email protected]>
when I setted the
max_burstto 0, do the lksctp-tools I got hang. I foundsctp_transport_burst_limitedwould make the cwnd to 0. so I make themax_burstmin value to 1.Signed-off-by Wang Weidong <[email protected]>--- net/sctp/sysctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)net/sctp/sysctl.c +1
-1@@ -135,7 +135,7 @@ static struct ctl_table sctp_net_table[] = { .maxlen = sizeof(int), .mode = 0644, .proc_handler = proc_dointvec_minmax, - .extra1 = &zero, + .extra1 = &one, .extra2 = &int_max }, {Signature · 1 line
1.7.12This seems like a band-aid to me. There are a few things wrong:
1) You can also set the the
max_burstvia setsockopt, and so this would need to be checked in that path as well.
Quoted 7 lines
Quoted 4 lines
2) I don't see how having a cwnd of zero would cause a hang. It looks like a cwnd of zero would perpetually place the association in a slow start state, which is silly but not illegal.
Hm, Good suggestions. Ok, I will try it again and find the root cause. Thanks!
It's really simple. sctp_transport_burst_limited() should simply do nothing if max_burst is 0, essentially allowing unlimited bursts.
-vlad
Quoted 15 lines
Quoted 13 lines
Please investigate the acutally root cause of the problem before just avoiding it like this.
Thanks!
Neil--
To unsubscribe from this list: send the line "unsubscribe linux-sctp" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 42 lines · Vlad Yasevich
Quoted 41 lines · Wang Weidong
Quoted 39 lines · Neil Horman
Quoted 27 lines · Wang Weidong
From: Wang Weidong <[email protected]>
when I setted the
max_burstto 0, do the lksctp-tools I got hang. I foundsctp_transport_burst_limitedwould make the cwnd to 0. so I make themax_burstmin value to 1.Signed-off-by Wang Weidong <[email protected]>--- net/sctp/sysctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)net/sctp/sysctl.c +1
-1@@ -135,7 +135,7 @@ static struct ctl_table sctp_net_table[] = { .maxlen = sizeof(int), .mode = 0644, .proc_handler = proc_dointvec_minmax, - .extra1 = &zero, + .extra1 = &one, .extra2 = &int_max }, {Signature · 1 line
1.7.12This seems like a band-aid to me. There are a few things wrong:
1) You can also set the the
max_burstvia setsockopt, and so this would need to be checked in that path as well.2) I don't see how having a cwnd of zero would cause a hang. It looks like a cwnd of zero would perpetually place the association in a slow start state, which is silly but not illegal.
Quoted 8 lines
Quoted 2 lines
Hm, Good suggestions. Ok, I will try it again and find the root cause. Thanks!
It's really simple.
sctp_transport_burst_limited()should simply do nothing ifmax_burstis 0, essentially allowing unlimited bursts.-vlad
I will add the a check of max_burst, if max_burst is 0, just do nothing. Michael point out that it just disable max_burst which declared in rfc6458#section-8.1.24 as well.
Thanks.
Quoted 22 lines
Quoted 7 lines
Quoted 7 lines
Please investigate the acutally root cause of the problem before just avoiding it like this.
Thanks!
NeilQuoted 8 lines
Quoted 6 lines
--
To unsubscribe from this list: send the line "unsubscribe linux-sctp" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html--
To unsubscribe from this list: send the line "unsubscribe linux-sctp" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 35 lines · Neil Horman
Quoted 27 lines · Wang Weidong
From: Wang Weidong <[email protected]>
when I setted the
max_burstto 0, do the lksctp-tools I got hang. I foundsctp_transport_burst_limitedwould make the cwnd to 0. so I make themax_burstmin value to 1.Signed-off-by Wang Weidong <[email protected]>---
net/sctp/sysctl.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)net/sctp/sysctl.c +1
-1@@ -135,7 +135,7 @@ static struct ctl_table sctp_net_table[] = { .maxlen = sizeof(int), .mode = 0644, .proc_handler = proc_dointvec_minmax, - .extra1 = &zero, + .extra1 = &one, .extra2 = &int_max }, {Signature · 1 line
1.7.12This seems like a band-aid to me. There are a few things wrong:
1) You can also set the the
max_burstvia setsockopt, and so this would need to be checked in that path as well.
Quoted 6 lines
2) I don't see how having a cwnd of zero would cause a hang. It looks like a cwnd of zero would perpetually place the association in a slow start state, which is silly but not illegal.
Please investigate the acutally root cause of the problem before just avoiding it like this.
I second this.
Please note the using max_burst of in the socket option means that you deactivate max_burst, not that you actually use the value 0. See
http://tools.ietf.org/html/rfc6458#section-8.1.24
I FreeBSD we use the sysctl variable as the default for sockets. Therefore max_burst is a valid value, it just disables max_burst.
Best regards
Michael
Quoted 9 lines
Thanks!
Neil--
To unsubscribe from this list: send the line "unsubscribe linux-sctp" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 1/1 sctp: disable max_burst when the max_burst is 0
As Michael pointed out that when max_burst is 0, it just disable max_burst. It declared in rfc6458#section-8.1.24. so add the check in sctp_transport_burst_limited, when it 0, just do nothing.
--- net/sctp/transport.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/sctp/transport.c +2 -1
@@ -573,7 +573,8 @@ void sctp_transport_burst_limited(struct sctp_transport *t)u32 old_cwnd = t->cwnd;u32 max_burst_bytes; -if (t->burst_limited) +/* if the max_burst is 0, do notihing */ +if (t->burst_limited || !asoc->max_burst)return ; max_burst_bytes = t->flight_size + (asoc->max_burst * asoc->pathmtu);
Signature · 1 line
1.7.12
Re: [PATCH] sctp: disable max_burst when the max_burst is 0
Quoted 16 lines · Wang Weidong
As Michael pointed out that when
max_burstis 0, it just disablemax_burst. It declared in rfc6458#section-8.1.24. so add the check insctp_transport_burst_limited, when it 0, just do nothing.Suggested-by Vlad Yasevich <[email protected]>Suggested-by Michael Tuexen <[email protected]>Signed-off-by Wang Weidong <[email protected]>--- net/sctp/transport.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)net/sctp/transport.c +0
-0
net/sctp/transport.c void sctp_transport_burst_limited(struct sctp_transport *t) · line 578
Quoted 7 lines
net/sctp/transport.c +2
-1@@ -573,7 +573,8 @@ void sctp_transport_burst_limited(struct sctp_transport *t)u32 old_cwnd = t->cwnd;u32 max_burst_bytes; -if (t->burst_limited) +/* if the max_burst is 0, do notihing */ +if (t->burst_limited || !asoc->max_burst)return ;
Minor nitpick ... you can remove the comment as it contains a typo and basically says what the code is doing anyway, so you could instead make the code a bit more clear for readers e.g. "asoc->max_burst = 0".
Quoted 2 lines
net/sctp/transport.c +0
-0max_burst_bytes = t->flight_size + (asoc->max_burst * asoc->pathmtu);
Re: [PATCH] sctp: disable max_burst when the max_burst is 0
Quoted 20 lines · Daniel Borkmann
Quoted 19 lines · Wang Weidong
As Michael pointed out that when
max_burstis 0, it just disablemax_burst. It declared in rfc6458#section-8.1.24. so add the check insctp_transport_burst_limited, when it 0, just do nothing.Suggested-by Vlad Yasevich <[email protected]>Suggested-by Michael Tuexen <[email protected]>Signed-off-by Wang Weidong <[email protected]>--- net/sctp/transport.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)net/sctp/transport.c +0
-0@@ -573,7 +573,8 @@ void sctp_transport_burst_limited(struct sctp_transport *t)u32 old_cwnd = t->cwnd;u32 max_burst_bytes;
Quoted 9 lines
net/sctp/transport.c void sctp_transport_burst_limited(struct sctp_transport *t) · line 578
Quoted 4 lines
net/sctp/transport.c +2
-1-if (t->burst_limited) +/* if the max_burst is 0, do notihing */ +if (t->burst_limited || !asoc->max_burst)return ;Minor nitpick ... you can remove the comment as it contains a typo and basically says what the code is doing anyway, so you could instead make the code a bit more clear for readers e.g. "
asoc->max_burst= 0".
Nice, Thanks for pointing it out for me. I will fix it in v2.
Regards.
Quoted 5 lines
net/sctp/transport.c void sctp_transport_burst_limited(struct sctp_transport *t) · line 580
Quoted 2 lines
net/sctp/transport.c +0
-0max_burst_bytes = t->flight_size + (asoc->max_burst * asoc->pathmtu);.
PATCH v2 1/1 sctp: disable max_burst when the max_burst is 0
In reply to Wang WeidongAs Michael pointed out that when max_burst is 0, it just disable max_burst. It declared in rfc6458#section-8.1.24. so add the check in sctp_transport_burst_limited, when it 0, just do nothing.
--- net/sctp/transport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/sctp/transport.c +1 -1
@@ -573,7 +573,7 @@ void sctp_transport_burst_limited(struct sctp_transport *t)u32 old_cwnd = t->cwnd;u32 max_burst_bytes; -if (t->burst_limited) +if (t->burst_limited || asoc->max_burst =0 )return ; max_burst_bytes = t->flight_size + (asoc->max_burst * asoc->pathmtu);
Signature · 1 line
1.7.12
Re: [PATCH v2] sctp: disable max_burst when the max_burst is 0
Quoted 31 lines · Wang Weidong
As Michael pointed out that when
max_burstis 0, it just disablemax_burst. It declared in rfc6458#section-8.1.24. so add the check insctp_transport_burst_limited, when it 0, just do nothing.Reviewed-by Daniel Borkmann <[email protected]>Suggested-by Vlad Yasevich <[email protected]>Suggested-by Michael Tuexen <[email protected]>Signed-off-by Wang Weidong <[email protected]>--- net/sctp/transport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)net/sctp/transport.c +1
-1@@ -573,7 +573,7 @@ void sctp_transport_burst_limited(struct sctp_transport *t)u32 old_cwnd = t->cwnd;u32 max_burst_bytes; -if (t->burst_limited) +if (t->burst_limited || asoc->max_burst =0 )return ; max_burst_bytes = t->flight_size + (asoc->max_burst * asoc->pathmtu);Signature · 1 line
1.7.12
Re: [PATCH v2] sctp: disable max_burst when the max_burst is 0
In reply to Wang WeidongQuoted 18 lines · Wang Weidong
As Michael pointed out that when
max_burstis 0, it just disablemax_burst. It declared in rfc6458#section-8.1.24. so add the check insctp_transport_burst_limited, when it 0, just do nothing.Reviewed-by Daniel Borkmann <[email protected]>Suggested-by Vlad Yasevich <[email protected]>Suggested-by Michael Tuexen <[email protected]>Signed-off-by Wang Weidong <[email protected]>--- net/sctp/transport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)net/sctp/transport.c +0
-0
net/sctp/transport.c void sctp_transport_burst_limited(struct sctp_transport *t) · line 579
Quoted 8 lines
net/sctp/transport.c +1
-1@@ -573,7 +573,7 @@ void sctp_transport_burst_limited(struct sctp_transport *t)u32 old_cwnd = t->cwnd;u32 max_burst_bytes; -if (t->burst_limited) +if (t->burst_limited || asoc->max_burst =0 )return ; max_burst_bytes = t->flight_size + (asoc->max_burst * asoc->pathmtu);
Thanks
-vlad
Re: [PATCH v2] sctp: disable max_burst when the max_burst is 0
In reply to Wang WeidongFrom: Wang Weidong <[email protected]>
Date: Wed, 4 Dec 2013 17:32:39 +0800
Quoted 8 lines
As Michael pointed out that when
max_burstis 0, it just disablemax_burst. It declared in rfc6458#section-8.1.24. so add the check insctp_transport_burst_limited, when it 0, just do nothing.Reviewed-by Daniel Borkmann <[email protected]>Suggested-by Vlad Yasevich <[email protected]>Suggested-by Michael Tuexen <[email protected]>Signed-off-by Wang Weidong <[email protected]>
Applied, thank you.