From: Wei Yongjun <yjwei@cn.fujitsu.com>
To: linux-sctp@vger.kernel.org
Subject: Re: [RFC PATCH v3] sctp: fix the sendmsg() flag SCTP_EOF to comply
Date: Fri, 04 Jun 2010 00:34:16 +0000 [thread overview]
Message-ID: <4C084A08.3020208@cn.fujitsu.com> (raw)
In-Reply-To: <4C05C996.5060708@cn.fujitsu.com>
> Wei Yongjun wrote:
>
>>> Wei Yongjun wrote:
>>>
>>>
>>> Interesting approach and I applaud for creativity, but it doesn't work if there is
>>> data loss.
>>>
>>> I see only one way out of this mess and that's to remove the SHUTDOWN_PENDING
>>> state and make that a modifier/flag that can be set on other states <= ESTABLISHED.
>>>
>>>
>> Do you mean we should support multi send() with EOF flag?
>>
>> send(msg, SCTP_EOF);
>> send(msg, SCTP_EOF);
>> ...
>>
> As long as they are for different associations. SCTP_EOF is a way to do
> shutdown() for 1-to-many sockets. If the second send() is for the same
> association, it should fail.
>
> I just realized that this might actually work.... Autoclose timer isn't started
> until association is up, so that takes care of any INIT retransmissions.
> And the autoclose will do the right thing by entering SHUTDOWN_PENDING and
> retransmitting DATA as needed.
>
> The only thing still missing is something that prevents the above multiple send
> scenario.
>
> That's why I though that removing the SHUTDOWN_PENDING state and changing it into
> a bit/flag would work. This way, sends would return failure because even though
> we may be in COOKIE_WAIT, if the SHUTDOWN_PENDING flag is set, further writes are
> disallowed.
>
> With this code, multiple writes with EOF for the same association will work,
> if the init process takes a long time (due to retransmissions or long rto).
>
I got it, thank you very much.
Wei Yongjun
> -vlad
>
>
>>
>>> In other words, if the user has queued up data to the association, even if it is
>>> not established, we should exhaust all retransmits before failing.
>>>
>>>
>> shutdown after all the outdata is acked?
>>
>>
>>> -vlad
>>>
>>>
>>>
>>>> /* If we are already past ASSOCIATE, the lower
>>>> * layers are responsible for association cleanup.
>>>> */
>>>>
>>>>
>>>
>>>
>>
>
>
prev parent reply other threads:[~2010-06-04 0:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-02 3:01 [RFC PATCH v3] sctp: fix the sendmsg() flag SCTP_EOF to comply to Wei Yongjun
2010-06-02 21:37 ` [RFC PATCH v3] sctp: fix the sendmsg() flag SCTP_EOF to comply Vlad Yasevich
2010-06-03 9:36 ` Wei Yongjun
2010-06-03 13:37 ` Vlad Yasevich
2010-06-04 0:34 ` Wei Yongjun [this message]
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=4C084A08.3020208@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.