All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Yongjun <yjwei@cn.fujitsu.com>
To: linux-sctp@vger.kernel.org
Subject: Re: [PATCHv2] sctp: Do not create SACK chunk if the final packet
Date: Tue, 04 Aug 2009 03:08:58 +0000	[thread overview]
Message-ID: <4A77A64A.1010805@cn.fujitsu.com> (raw)
In-Reply-To: <4A72C518.20200@cn.fujitsu.com>

Doug Graham wrote:
> Hi Vlad,
>
>> The only thing that I find slightly odd about this behavior is that
>> the bundling
>> occurs at the end of message and so I asked myself why aren't we
>> accounting
>> for SACK chunk at segmentation time?
>>
>> We could simply do something like this (completely not tested):
>>
>> diff --git a/net/sctp/chunk.c b/net/sctp/chunk.c
>> index 1748ef9..3bca0a2 100644
>> --- a/net/sctp/chunk.c
>> +++ b/net/sctp/chunk.c
>> @@ -193,6 +193,15 @@ struct sctp_datamsg *sctp_datamsg_from_user(struct
>> sctp_association *asoc,
>>                                             hmac_desc->hmac_len);
>>         }
>>
>> +       /* Check to see if we have a pending SACK and try to let it
>> be bundled
>> +        * with this message.  Do this if we don't have any data to
>> send.  To
>> +        * check that, look at out_qlen and retransmit list.
>> +        */
>> +       if (timer_pending(&asoc->timers[SCTP_EVENT_TIMEOUT_SACK]) &&
>> +           asoc->outqueue.out_qlen = 0 &&
>> +           list_empty(&asoc->outqueue.retransmit))
>> +               max -= WORD_ROUND(sizeof(sctp_sack_chunk_t));
>> +
>>         whole = 0;
>>         first_len = max;
>>
>>   
> Doesn't this reduce the  size of all chunks in a message?  You've
> descremented "max", which I think
> is the maximum size of all chunks in the message.  I could see maybe
> doing this to leave space
> in only the first chunk (ie: just decrement first_len by
> sizeof(sctp_sack_chunk_t), but even that
> doesn't buy much I think.  It wouldn't reduce the number of packets
> sent, it would only mean
> that the SACK is bundled with the first fragment, and then an extra
> DATA fragment would need
> to be created to send the last sizeof(sctp_sack_chunk_t) bytes of
> DATA.   Example:
>
> Assume that the PMTU is 1000, that the user is sending a message of
> 1990 bytes,  and
> that sizeof(sctp_sack_chunk_t) is 16.  With my scheme, we'd send this:
>
>  DATA (1000 bytes)
>  SACK
>  DATA (990 bytes)
>
> with your scheme exactly as you propose it, we'd send
>
>  SACK + DATA (1000 - 16 = 984 bytes)
>  DATA  (984 bytes)
>  DATA  (22 bytes)
>
> If the scheme is modified to only reduce the size of the first
> fragment, we'd send:
>
>  SACK + DATA (984 bytes)
>  DATA  (1000 bytes)
>  DATA  (6 bytes)
>
> The main point being that if a SACK won't fit in the last chunk of a
> message, then your scheme
> would just push all the data down so that a new DATA chunk has to be
> sent to send the last
> few bytes of data,
>
> I don't think there's any real advantage in sending the SACK in the
> first packet rather than the
> last one, but I agree that  it seems to make more sense.  It does seem
> to complicate the
> code a bit though.  At the moment, all the code related to
> piggybacking SACKs is in
> one place, whereas with this patch it'd be spread out to seemingly
> unrelated code.

I think Vlad's patch should be like this:

        whole = 0;
        first_len = max;
        ~~~~~~~~~~~~~~~~~~~~

+       /* Check to see if we have a pending SACK and try to let it be bundled
+        * with this message.  Do this if we don't have any data to send.  To
+        * check that, look at out_qlen and retransmit list.
+        */
+       if (timer_pending(&asoc->timers[SCTP_EVENT_TIMEOUT_SACK]) &&
+           asoc->outqueue.out_qlen = 0 &&
+           list_empty(&asoc->outqueue.retransmit))
+               first_len -= WORD_ROUND(sizeof(sctp_sack_chunk_t));
                ~~~~~~~~~~~~~~
......




  parent reply	other threads:[~2009-08-04  3:08 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-31 10:19 [PATCHv2] sctp: Do not create SACK chunk if the final packet size Wei Yongjun
2009-07-31 14:01 ` [PATCHv2] sctp: Do not create SACK chunk if the final packet Vlad Yasevich
2009-07-31 16:02 ` [PATCHv2] sctp: Do not create SACK chunk if the final packet size exceed current MTU Doug Graham
2009-07-31 16:49 ` [PATCHv2] sctp: Do not create SACK chunk if the final packet Wei Yongjun
2009-07-31 17:04 ` Vlad Yasevich
2009-07-31 17:09 ` Doug Graham
2009-08-02  3:03 ` [PATCHv2] sctp: Do not create SACK chunk if the final packet size exceed current MTU Doug Graham
2009-08-03 17:19 ` [PATCHv2] sctp: Do not create SACK chunk if the final packet Vlad Yasevich
2009-08-04  2:45 ` Doug Graham
2009-08-04  3:08 ` Wei Yongjun [this message]
2009-08-04 14:16 ` Vlad Yasevich
2009-08-04 16:54 ` [PATCHv2] sctp: Do not create SACK chunk if the final packet size exceed current MTU Doug Graham
2009-08-04 17:08 ` [PATCHv2] sctp: Do not create SACK chunk if the final packet Vlad Yasevich
2009-08-04 17:33 ` [PATCHv2] sctp: Do not create SACK chunk if the final packet size exceed current MTU Doug Graham

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A77A64A.1010805@cn.fujitsu.com \
    --to=yjwei@cn.fujitsu.com \
    --cc=linux-sctp@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.