diff options
author | Gustavo F. Padovan <padovan@profusion.mobi> | 2010-05-01 15:15:42 -0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2010-05-10 03:28:50 -0400 |
commit | 3b1a9f3fa6ad842991538da2c3b2e29e047b131f (patch) | |
tree | 7d555cfaf3a017ded7bb1dc970b8a7caca37e348 /net/bluetooth/l2cap.c | |
parent | 812e737e29a1d559e7bfbea675fdcfcbad9f5e1f (diff) |
Bluetooth: Optimize SREJ_QUEUE append
When the I-frame received is the expected, i.e., its tx_seq is equal to
expected_tx_seq and we are under a SREJ, we can just add it to the tail
of the list. Doing that we change the complexity from O(n) to O(1).
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/l2cap.c')
-rw-r--r-- | net/bluetooth/l2cap.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c index 042fd967e79c..187f46dd8309 100644 --- a/net/bluetooth/l2cap.c +++ b/net/bluetooth/l2cap.c | |||
@@ -3542,7 +3542,9 @@ expected: | |||
3542 | pi->expected_tx_seq = (pi->expected_tx_seq + 1) % 64; | 3542 | pi->expected_tx_seq = (pi->expected_tx_seq + 1) % 64; |
3543 | 3543 | ||
3544 | if (pi->conn_state & L2CAP_CONN_SREJ_SENT) { | 3544 | if (pi->conn_state & L2CAP_CONN_SREJ_SENT) { |
3545 | l2cap_add_to_srej_queue(sk, skb, tx_seq, sar); | 3545 | bt_cb(skb)->tx_seq = tx_seq; |
3546 | bt_cb(skb)->sar = sar; | ||
3547 | __skb_queue_tail(SREJ_QUEUE(sk), skb); | ||
3546 | return 0; | 3548 | return 0; |
3547 | } | 3549 | } |
3548 | 3550 | ||