From: Gustavo Padovan <padovan@profusion.mobi>
To: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [RFC 1/5 v3] Bluetooth: set skbuffer priority based on L2CAP socket priority
Date: Mon, 19 Sep 2011 18:36:25 -0300 [thread overview]
Message-ID: <20110919213625.GL2643@joana> (raw)
In-Reply-To: <1315846853-27442-1-git-send-email-luiz.dentz@gmail.com>
Hi Luiz,
* Luiz Augusto von Dentz <luiz.dentz@gmail.com> [2011-09-12 20:00:49 +0300]:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
>
> This uses SO_PRIORITY to set the skbuffer priority field
>
> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> ---
> include/net/bluetooth/hci_core.h | 3 +++
> include/net/bluetooth/l2cap.h | 3 ++-
> net/bluetooth/l2cap_core.c | 27 ++++++++++++++++++++-------
> net/bluetooth/l2cap_sock.c | 2 +-
> 4 files changed, 26 insertions(+), 9 deletions(-)
>
> diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
> index e2ba4d6..0742828 100644
> --- a/include/net/bluetooth/hci_core.h
> +++ b/include/net/bluetooth/hci_core.h
> @@ -32,6 +32,9 @@
> #define HCI_PROTO_L2CAP 0
> #define HCI_PROTO_SCO 1
>
> +/* HCI priority */
> +#define HCI_PRIO_MAX 7
> +
> /* HCI Core structures */
> struct inquiry_data {
> bdaddr_t bdaddr;
> diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
> index 4f34ad2..f018e5d 100644
> --- a/include/net/bluetooth/l2cap.h
> +++ b/include/net/bluetooth/l2cap.h
> @@ -511,7 +511,8 @@ struct l2cap_chan *l2cap_chan_create(struct sock *sk);
> void l2cap_chan_close(struct l2cap_chan *chan, int reason);
> void l2cap_chan_destroy(struct l2cap_chan *chan);
> int l2cap_chan_connect(struct l2cap_chan *chan);
> -int l2cap_chan_send(struct l2cap_chan *chan, struct msghdr *msg, size_t len);
> +int l2cap_chan_send(struct l2cap_chan *chan, struct msghdr *msg, size_t len,
> + u32 priority);
> void l2cap_chan_busy(struct l2cap_chan *chan, int busy);
>
> #endif /* __L2CAP_H */
> diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
> index b3bdb48..0b6e1ae 100644
> --- a/net/bluetooth/l2cap_core.c
> +++ b/net/bluetooth/l2cap_core.c
> @@ -556,6 +556,7 @@ static void l2cap_send_cmd(struct l2cap_conn *conn, u8 ident, u8 code, u16 len,
> flags = ACL_START;
>
> bt_cb(skb)->force_active = BT_POWER_FORCE_ACTIVE_ON;
> + skb->priority = HCI_PRIO_MAX;
As Mat pointed out we can't prioritize commands over data, this could to
misbehaviours and loss of data. However, if the command is not related to any
cid, like the information request/reponse we can put HCI_PRIO_MAX on it.
Gustavo
next prev parent reply other threads:[~2011-09-19 21:36 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-12 17:00 [RFC 1/5 v3] Bluetooth: set skbuffer priority based on L2CAP socket priority Luiz Augusto von Dentz
2011-09-12 17:00 ` [RFC 2/5 v3] Bluetooth: mark l2cap_create_iframe_pdu as static Luiz Augusto von Dentz
2011-09-19 21:17 ` Gustavo Padovan
2011-09-12 17:00 ` [RFC 3/5 v2] Bluetooth: make use sk_priority to priritize RFCOMM packets Luiz Augusto von Dentz
2011-09-19 21:45 ` Gustavo Padovan
2011-09-20 9:10 ` Luiz Augusto von Dentz
2011-09-20 13:04 ` Marcel Holtmann
2011-09-20 13:46 ` tim.howes
2011-09-20 14:34 ` Luiz Augusto von Dentz
2011-09-20 15:11 ` Marcel Holtmann
2011-09-20 16:06 ` Luiz Augusto von Dentz
2011-09-20 16:59 ` Gustavo Padovan
2011-09-21 11:20 ` Luiz Augusto von Dentz
2011-09-12 17:00 ` [RFC 4/5 v3] Bluetooth: prioritizing data over HCI Luiz Augusto von Dentz
2011-09-15 23:34 ` Mat Martineau
2011-09-16 7:35 ` Luiz Augusto von Dentz
2011-09-12 17:00 ` [RFC 5/5 v3] Bluetooth: recalculate priorities when channels are starving Luiz Augusto von Dentz
2011-09-19 21:36 ` Gustavo Padovan [this message]
2011-09-20 8:15 ` [RFC 1/5 v3] Bluetooth: set skbuffer priority based on L2CAP socket priority Luiz Augusto von Dentz
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=20110919213625.GL2643@joana \
--to=padovan@profusion.mobi \
--cc=linux-bluetooth@vger.kernel.org \
--cc=luiz.dentz@gmail.com \
/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).