Linux bluetooth development
 help / color / mirror / Atom feed
From: Mat Martineau <mathewm@codeaurora.org>
To: "Gustavo F. Padovan" <padovan@profusion.mobi>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH 3/4] Bluetooth: Limit depth of the HCI TX queue with ERTM mode
Date: Thu, 16 Jun 2011 15:38:34 -0700 (PDT)	[thread overview]
Message-ID: <alpine.DEB.2.02.1106161012550.25757@mathewm-linux> (raw)
In-Reply-To: <20110614235313.GE2613@joana>


Gustavo -

On Tue, 14 Jun 2011, Gustavo F. Padovan wrote:

> Hi Mat,
>
> * Mat Martineau <mathewm@codeaurora.org> [2011-06-09 16:36:29 -0700]:
>
...
>> 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.

My suggestion would be:

  * Run HCI tx on a workqueue
  * Remove the hci_conn data_q
  * Use a tx queue in each l2cap_chan for all L2CAP modes
  * L2CAP sends put data in the l2cap_chan tx queue and hci_send_acl 
informs the hci layer that there's a channel to pull from
  * When the HCI device can accept ACL frames (packets are available or 
num_completed_packets is received), instead of having the hci 
scheduler pull data from hci_conn queues, it calls back to L2CAP to 
pull from l2cap_chan tx queues.  ACL data goes directly from the L2CAP 
tx queue to the HCI device.

Pulling data for ERTM would require locking (while the control bits 
are set), but basic mode and streaming mode probably would not need 
locking in the L2CAP callback.

There are several benefits: fewer layers of queuing, improved fairness 
between L2CAP channels on the same ACL, and just one workqueue instead 
of a workqueue and a tasklet.


> 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.

This very similar to what my patch does :).  When frames can be sent, 
a job runs on the workqueue to set the control bits and push the 
frames to the hci_conn data_q.  However, there is not a callback for 
every frame in my patch.  Several frames are sent during each callback 
to reduce overhead.


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

It seems to work very well with AMP on mobile devices.  Keep in mind 
that there are more dropped packets on AMP than on BR/EDR, so quick 
handling of REJ/SREJ becomes important for maintaining throughput. 
ERTM flow control (local busy) works a lot better too.

--
Mat Martineau
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum


  reply	other threads:[~2011-06-16 22:38 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
2011-06-16 22:38         ` Mat Martineau [this message]
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=alpine.DEB.2.02.1106161012550.25757@mathewm-linux \
    --to=mathewm@codeaurora.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=padovan@profusion.mobi \
    /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