diff mbox

sctp: disable max_burst when the max_burst is 0

Message ID 529D7A82.3070207@huawei.com
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

wangweidong Dec. 3, 2013, 6:30 a.m. UTC
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.

Suggested-by: Vlad Yasevich <vyasevich@gmail.com>
Suggested-by: Michael Tuexen <Michael.Tuexen@lurchi.franken.de>
Signed-off-by: Wang Weidong <wangweidong1@huawei.com>
---
 net/sctp/transport.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Daniel Borkmann Dec. 4, 2013, 8:57 a.m. UTC | #1
On 12/03/2013 07:30 AM, Wang Weidong wrote:
> 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.
>
> Suggested-by: Vlad Yasevich <vyasevich@gmail.com>
> Suggested-by: Michael Tuexen <Michael.Tuexen@lurchi.franken.de>
> Signed-off-by: Wang Weidong <wangweidong1@huawei.com>
> ---
>   net/sctp/transport.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/net/sctp/transport.c b/net/sctp/transport.c
> index e332efb..e580e34 100644
> --- a/net/sctp/transport.c
> +++ b/net/sctp/transport.c
> @@ -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".

>   	max_burst_bytes = t->flight_size + (asoc->max_burst * asoc->pathmtu);
>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
wangweidong Dec. 4, 2013, 9:16 a.m. UTC | #2
On 2013/12/4 16:57, Daniel Borkmann wrote:
> On 12/03/2013 07:30 AM, Wang Weidong wrote:
>> 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.
>>
>> Suggested-by: Vlad Yasevich <vyasevich@gmail.com>
>> Suggested-by: Michael Tuexen <Michael.Tuexen@lurchi.franken.de>
>> Signed-off-by: Wang Weidong <wangweidong1@huawei.com>
>> ---
>>   net/sctp/transport.c | 3 ++-
>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/net/sctp/transport.c b/net/sctp/transport.c
>> index e332efb..e580e34 100644
>> --- a/net/sctp/transport.c
>> +++ b/net/sctp/transport.c
>> @@ -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".
> 
Nice, Thanks for pointing it out for me. I will fix it in v2.

Regards.

>>       max_burst_bytes = t->flight_size + (asoc->max_burst * asoc->pathmtu);
>>
> 
> .
> 


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/sctp/transport.c b/net/sctp/transport.c
index e332efb..e580e34 100644
--- a/net/sctp/transport.c
+++ b/net/sctp/transport.c
@@ -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);