linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Gustavo F. Padovan" <padovan@profusion.mobi>
To: Mat Martineau <mathewm@codeaurora.org>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH 3/4] Bluetooth: Limit depth of the HCI TX queue with ERTM mode
Date: Tue, 14 Jun 2011 20:53:13 -0300	[thread overview]
Message-ID: <20110614235313.GE2613@joana> (raw)
In-Reply-To: <alpine.DEB.2.02.1106091610040.18748@mathewm-linux>

Hi Mat,

* Mat Martineau <mathewm@codeaurora.org> [2011-06-09 16:36:29 -0700]:

> 
> Gustavo,
> 
> On Wed, 8 Jun 2011, Gustavo F. Padovan wrote:
> 
> >Hi Mat,
> >
> >* Mat Martineau <mathewm@codeaurora.org> [2011-06-03 16:21:09 -0700]:
> >
> >>In order to provide timely responses to REJ, SREJ, and poll input from
> >>the remote device, it helps to reduce the number of ERTM data frames
> >>in the HCI TX queue at one time. If a full TX window of data is in the
> >>HCI TX queue, any responses to REJ, SREJ, or polls must wait in line
> >>behind all previously queued data. This latency leads to disconnects,
> >>and will be more severe with extended window sizes.
> >
> >I prefer if we go with a hci_send_acl_prio() implementation. It will have much
> >less overhead using a workqueue. As it will be filled only by S-frames with a
> >few bytes each I don't think we will have problems. So lets go with this
> >approach and see what we can get.
> 
> I considered that approach too, but it breaks some major assumptions
> and I don't think it complies with the ERTM spec.  I-frames contain
> reqseq fields and a final bit, so if S-frames and I-frames are
> delivered out-of-sequence, you can easily end up with a confusing
> series of reqseq values at the receiver.
> 
> Suppose the HCI tx queue is full of I-frames, and the oldest I-frame
> has reqseq set to 1.  Since that I-frame has been queued, other
> incoming I-frames have been processed, so the last recieved I-frame
> had txseq 20.  The remote device sends a poll, and we reply with an
> RR (reqseq 21) using the priority queue.  HCI sends that RR first,
> then an I-frame from the normal queue with reqseq 1.  Now the remote
> side thinks it missed all of the frames from 21 to 1 (having wrapped
> around).  The remote side then has to send REJ or SREJ frames, even
> though nothing is actually missing.

Good point. That will be a problem indeed.

> 
> So, I think we have two options:
> 
>  * Use the skb_destructor mechanism to pull data for ERTM (which is
> what my patch does), and leave queuing for other modes alone
>  * Rearchitect HCI & L2CAP so that data is pulled from the L2CAP
> layer as num_comp_pkts events are received

I prefer the rearchitect HCI and L2CAP approach, but I still don't have too
much idea on how to do this. I'm open to suggestions here.

Another idea is to delay in setting the control bits until the moment we
actually send the frame. If we do that, we can have priority for REJ/SREJ.
Before send, hci calls a l2cap function to fill the control bit. These are
just ideas.

I just think that use an workqueue and a tasklet to send packet is just too
much.

	Gustavo

  parent reply	other threads:[~2011-06-14 23:53 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-03 23:21 [PATCH 1/4] Bluetooth: Restore accidentally-deleted line Mat Martineau
2011-06-03 23:21 ` [PATCH 2/4] Bluetooth: Rename _busy_wq to _l2cap_wq Mat Martineau
2011-06-06 17:31   ` Gustavo F. Padovan
2011-06-08 23:24     ` Mat Martineau
2011-06-09 18:47       ` Gustavo F. Padovan
2011-06-09 23:09         ` Mat Martineau
2011-06-15  0:04           ` Gustavo F. Padovan
2011-06-16 21:48             ` Mat Martineau
2011-06-20 19:23               ` Gustavo F. Padovan
2011-06-24 22:31                 ` Gustavo F. Padovan
2011-06-03 23:21 ` [PATCH 3/4] Bluetooth: Limit depth of the HCI TX queue with ERTM mode Mat Martineau
2011-06-09  2:16   ` Gustavo F. Padovan
2011-06-09 23:36     ` Mat Martineau
2011-06-14 23:31       ` Mat Martineau
2011-06-14 23:53       ` Gustavo F. Padovan [this message]
2011-06-16 22:38         ` Mat Martineau
2011-06-03 23:21 ` [PATCH 4/4] Bluetooth: Fix check for the ERTM local busy state Mat Martineau
2011-06-06 17:38   ` Gustavo F. Padovan
2011-06-06 17:37 ` [PATCH 1/4] Bluetooth: Restore accidentally-deleted line Gustavo F. Padovan

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=20110614235313.GE2613@joana \
    --to=padovan@profusion.mobi \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=mathewm@codeaurora.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).