From: Mat Martineau <mathewm@codeaurora.org>
To: Gustavo Padovan <gustavo@padovan.org>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH 4/4] Bluetooth: add a timer to L2CAP MSG_MORE code
Date: Fri, 11 May 2012 15:29:23 -0700 (PDT) [thread overview]
Message-ID: <alpine.DEB.2.02.1205111456230.17554@mathewm-linux> (raw)
In-Reply-To: <20120511192333.GC7620@joana>
On Fri, 11 May 2012, Gustavo Padovan wrote:
> * Mat Martineau <mathewm@codeaurora.org> [2012-05-11 11:38:15 -0700]:
>
>>
>> On Fri, 11 May 2012, Gustavo Padovan wrote:
>>
>>> There is now a 200 milliseconds limit for which L2CAP will wait for
>>> which L2CAP will wait before send the already queued data to the
>>> controller.
>>>
>>> Signed-off-by: Gustavo Padovan <gustavo@padovan.org>
>>
>> A timeout like this makes sense with a streaming protocol, but not
>> with a datagram protocol like L2CAP. The application could be
>> waiting on file I/O (especially on a flash filesystem), be waiting
>> for another blocking call to return, or another resource-intensive
>> application could be hogging the processor for a short time. If an
>> incomplete SDU gets sent out because of a timeout like this, the
>> profile on the other side will see it as corrupt. Better to keep
>> the queued data indefinitely.
>
> I don't think this would case problems, before this gets to the
> profile the ACL frame needs to be built and it won't be until we get
> the all pieces of the L2CAP frame.
This doesn't have anything to do with ACL fragments. When the timeout
expires, you're sending an L2CAP frame that will get passed up to the
remote profile right away. The remote L2CAP protocol will not wait
for any more data before passing the frame up to the profile, because
L2CAP doesn't know any more data is coming.
> I'm following the TCP behaviour with MSG_MORE here.
TCP is a stream, like RFCOMM. UDP and L2CAP are based on datagrams.
The 200ms timeout makes sense for a stream, because message boundaries
have no meaning in a stream like TCP. Splitting up an L2CAP PDU like
this breaks all kinds of profiles that depend on message boundaries.
--
Mat Martineau
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum
next prev parent reply other threads:[~2012-05-11 22:29 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-11 16:16 [PATCH 1/4] Bluetooth: Fix packet size provided to the controller Gustavo Padovan
2012-05-11 16:16 ` [PATCH 2/4] Bluetooth: Fix skb length calculation Gustavo Padovan
2012-05-11 16:16 ` [PATCH 3/4] Bluetooth: Add MSG_MORE support to L2CAP sockets Gustavo Padovan
2012-05-11 16:16 ` [PATCH 4/4] Bluetooth: add a timer to L2CAP MSG_MORE code Gustavo Padovan
2012-05-11 18:38 ` Mat Martineau
2012-05-11 19:23 ` Gustavo Padovan
2012-05-11 22:29 ` Mat Martineau [this message]
2012-05-11 18:31 ` [PATCH 3/4] Bluetooth: Add MSG_MORE support to L2CAP sockets Mat Martineau
2012-05-11 18:41 ` Mat Martineau
2012-05-11 19:15 ` Gustavo Padovan
2012-05-11 21:55 ` Mat Martineau
2012-05-16 7:49 ` [PATCH 1/4] Bluetooth: Fix packet size provided to the controller Johan Hedberg
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=alpine.DEB.2.02.1205111456230.17554@mathewm-linux \
--to=mathewm@codeaurora.org \
--cc=gustavo@padovan.org \
--cc=linux-bluetooth@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 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).