* [PATCH] Bluetooth: Improve data packing in SAR mode
@ 2014-08-13 14:01 Lukasz Rymanowski
2014-08-13 17:27 ` Marcel Holtmann
0 siblings, 1 reply; 2+ messages in thread
From: Lukasz Rymanowski @ 2014-08-13 14:01 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Lukasz Rymanowski
There is no need to decrease pdu size with L2CAP SDU lenght in Start
L2CAP SDU frame. Start packtet is just 2 bytes longer as specified and
we can keep payload as long as possible.
Signed-off-by: Lukasz Rymanowski <lukasz.rymanowski@tieto.com>
---
When testing SAR L2CAP against PTS, L2CAP channel is usually
configured in that way, that SDU = MPS * 3. PTS expets then 3
I-Frames from IUT: Start, Continuation and End frame.
Without this fix, we sent 4 I-Frames. We could pass a test
by using -b option in l2test and send just two bytes less than
SDU length but it was hakish :) With this patch no need to use -b
option.
net/bluetooth/l2cap_core.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index 7b0d744..8fe9f4b 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -2276,7 +2276,6 @@ static int l2cap_segment_sdu(struct l2cap_chan *chan,
} else {
sar = L2CAP_SAR_START;
sdu_len = len;
- pdu_len -= L2CAP_SDULEN_SIZE;
}
while (len > 0) {
@@ -2291,10 +2290,8 @@ static int l2cap_segment_sdu(struct l2cap_chan *chan,
__skb_queue_tail(seg_queue, skb);
len -= pdu_len;
- if (sdu_len) {
+ if (sdu_len)
sdu_len = 0;
- pdu_len += L2CAP_SDULEN_SIZE;
- }
if (len <= pdu_len) {
sar = L2CAP_SAR_END;
--
1.8.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Bluetooth: Improve data packing in SAR mode
2014-08-13 14:01 [PATCH] Bluetooth: Improve data packing in SAR mode Lukasz Rymanowski
@ 2014-08-13 17:27 ` Marcel Holtmann
0 siblings, 0 replies; 2+ messages in thread
From: Marcel Holtmann @ 2014-08-13 17:27 UTC (permalink / raw)
To: Lukasz Rymanowski; +Cc: linux-bluetooth
Hi Lukasz,
> There is no need to decrease pdu size with L2CAP SDU lenght in Start
> L2CAP SDU frame. Start packtet is just 2 bytes longer as specified and
> we can keep payload as long as possible.
>
> Signed-off-by: Lukasz Rymanowski <lukasz.rymanowski@tieto.com>
> ---
> When testing SAR L2CAP against PTS, L2CAP channel is usually
> configured in that way, that SDU = MPS * 3. PTS expets then 3
> I-Frames from IUT: Start, Continuation and End frame.
>
> Without this fix, we sent 4 I-Frames. We could pass a test
> by using -b option in l2test and send just two bytes less than
> SDU length but it was hakish :) With this patch no need to use -b
> option.
>
> net/bluetooth/l2cap_core.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
patch has been applied to bluetooth-next tree.
Regards
Marcel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-08-13 17:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-13 14:01 [PATCH] Bluetooth: Improve data packing in SAR mode Lukasz Rymanowski
2014-08-13 17:27 ` Marcel Holtmann
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.