From: Marcel Holtmann <marcel@holtmann.org>
To: Emeltchenko Andrei <Andrei.Emeltchenko.news@gmail.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCHv1 6/6] Bluetooth: Recalculate sched for HCI block flow ctrl
Date: Wed, 30 Nov 2011 15:26:22 +0100 [thread overview]
Message-ID: <1322663182.26198.12.camel@aeonflux> (raw)
In-Reply-To: <1322645765-9519-7-git-send-email-Andrei.Emeltchenko.news@gmail.com>
Hi Andrei,
> Upstream Code Aurora code with trivial fixes.
> Origin: git://codeaurora.org/kernel/msm.git
>
> Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
> ---
> net/bluetooth/hci_core.c | 25 ++++++++++++++++++++-----
> 1 files changed, 20 insertions(+), 5 deletions(-)
>
> diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
> index 4a0391e..360b44c 100644
> --- a/net/bluetooth/hci_core.c
> +++ b/net/bluetooth/hci_core.c
> @@ -2290,10 +2290,12 @@ static inline void hci_sched_acl(struct hci_dev *hdev)
>
> cnt = hdev->acl_cnt;
>
> - while (hdev->acl_cnt &&
> + while (hdev->acl_cnt > 0 &&
> (chan = hci_chan_sent(hdev, ACL_LINK, "e))) {
> u32 priority = (skb_peek(&chan->data_q))->priority;
> - while (quote-- && (skb = skb_peek(&chan->data_q))) {
> + while (quote > 0 && (skb = skb_peek(&chan->data_q))) {
> + int blocks = 1;
> +
> BT_DBG("chan %p skb %p len %d priority %u", chan, skb,
> skb->len, skb->priority);
>
> @@ -2303,15 +2305,28 @@ static inline void hci_sched_acl(struct hci_dev *hdev)
>
> skb = skb_dequeue(&chan->data_q);
>
> + if (hdev->flow_ctl_mode ==
> + HCI_FLOW_CTL_MODE_BLOCK_BASED)
> + /* Calculate count of blocks used by
> + * this packet
> + */
> + blocks = DIV_ROUND_UP(skb->len -
> + HCI_ACL_HDR_SIZE, hdev->block_len);
would it not be more efficient to have to functions here? One
hci_sched_acl_block and one hci_sched_acl_pkt which implement the
specific details of the flow control mode. And the hci_sched_acl would
just decide which on to call once.
> +
> + if (blocks > hdev->acl_cnt)
> + return;
> +
> hci_conn_enter_active_mode(chan->conn,
> bt_cb(skb)->force_active);
Now an important question that comes up here. The support for the power
save mode (sniff mainly) and AMP controllers is fully pointless. We need
to actually make sure we don't try to put an AMP controller into sniff
mode since that seems like an attempt for failure.
Regards
Marcel
next prev parent reply other threads:[~2011-11-30 14:26 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-30 9:35 [PATCHv1 0/6] AMP/BREDR initialization patches Emeltchenko Andrei
2011-11-30 9:36 ` [PATCHv1 1/6] Bluetooth: remove old code Emeltchenko Andrei
2011-11-30 14:14 ` Marcel Holtmann
2011-11-30 9:36 ` [PATCHv1 2/6] Bluetooth: Split ctrl init to BREDR and AMP parts Emeltchenko Andrei
2011-11-30 9:36 ` [PATCHv1 3/6] Bluetooth: Add HCI Read Flow Control Mode function Emeltchenko Andrei
2011-11-30 9:36 ` [PATCHv1 4/6] Bluetooth: Initialize default flow control mode Emeltchenko Andrei
2011-11-30 14:14 ` Marcel Holtmann
2011-11-30 9:36 ` [PATCHv1 5/6] Bluetooth: Add HCI Read Data Block Size function Emeltchenko Andrei
2011-11-30 14:22 ` Marcel Holtmann
2011-12-01 12:25 ` Emeltchenko Andrei
2011-11-30 9:36 ` [PATCHv1 6/6] Bluetooth: Recalculate sched for HCI block flow ctrl Emeltchenko Andrei
2011-11-30 14:26 ` Marcel Holtmann [this message]
2011-12-01 6:24 ` Peter Krystad
2011-12-01 9:46 ` 'Emeltchenko Andrei'
2011-12-01 11:15 ` Marcel Holtmann
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=1322663182.26198.12.camel@aeonflux \
--to=marcel@holtmann.org \
--cc=Andrei.Emeltchenko.news@gmail.com \
--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).