Linux bluetooth development
 help / color / mirror / Atom feed
From: Emeltchenko Andrei <Andrei.Emeltchenko.news@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCHv1 5/5] Bluetooth: EWS: prevent unneeded fragmentation in l2cap
Date: Fri, 16 Sep 2011 14:43:17 +0300	[thread overview]
Message-ID: <20110916114308.GA25990@aemeltch-MOBL1> (raw)
In-Reply-To: <20110914035104.GN16856@joana>

Hi Gustavo,

On Wed, Sep 14, 2011 at 12:51:04AM -0300, Gustavo Padovan wrote:
> Hi Andrei,
> 
> * Emeltchenko Andrei <Andrei.Emeltchenko.news@gmail.com> [2011-09-07 17:05:14 +0300]:
> 
> > From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
> > 
> > Calculate pdu length before creating I-frame. Otherwise if
> > conn->mtu - (headers) < remote_mps we get fragmented packets in
> > create_iframe_pdu function.
> 
> You might check the way we set the remote_mps, it seems you are not taking
> that in account.

You are right, I was confused by magic "rfc.max_pdu_size =
cpu_to_le16(chan->conn->mtu - 10)"

I will send new patch with fixes like the one below:

-               rfc.max_pdu_size    = cpu_to_le16(L2CAP_DEFAULT_MAX_PDU_SIZE);
-               if (L2CAP_DEFAULT_MAX_PDU_SIZE > chan->conn->mtu - 10)
-                       rfc.max_pdu_size = cpu_to_le16(chan->conn->mtu - 10);
+
+               rfc.max_pdu_size = cpu_to_le16(min_t(u16,
+                                               L2CAP_DEFAULT_MAX_PDU_SIZE,
+                                               chan->conn->mtu -
+                                               L2CAP_EXTENDED_HDR_SIZE -
+                                               L2CAP_SDULEN_SIZE -
+                                               L2CAP_FCS_SIZE));

Regards,
Andrei

  reply	other threads:[~2011-09-16 11:43 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-07 14:05 [PATCHv1 0/5] EWS: extended window size and extended control field support Emeltchenko Andrei
2011-09-07 14:05 ` [PATCHv1 1/5] Bluetooth: EWS: extended window size option support Emeltchenko Andrei
2011-09-14  3:39   ` Gustavo Padovan
2011-09-07 14:05 ` [PATCHv1 2/5] Bluetooth: EWS: l2cap extended control field support Emeltchenko Andrei
2011-09-14  2:48   ` Gustavo Padovan
2011-09-07 14:05 ` [PATCHv1 3/5] Bluetooth: EWS: support extended seq numbers Emeltchenko Andrei
2011-09-14  3:43   ` Gustavo Padovan
2011-09-07 14:05 ` [PATCHv1 4/5] Bluetooth: EWS: remove magic numbers in l2cap Emeltchenko Andrei
2011-09-07 14:05 ` [PATCHv1 5/5] Bluetooth: EWS: prevent unneeded fragmentation " Emeltchenko Andrei
2011-09-14  3:51   ` Gustavo Padovan
2011-09-16 11:43     ` Emeltchenko Andrei [this message]
2011-09-19 17:13       ` Gustavo Padovan
2011-09-20  6:28         ` Emeltchenko Andrei

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=20110916114308.GA25990@aemeltch-MOBL1 \
    --to=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