All of lore.kernel.org
 help / color / mirror / Atom feed
From: Max Krasnyansky <maxk@qualcomm.com>
To: "Daryl Van Vorst" <daryl@wideray.com>,
	"'Marcel Holtmann'" <marcel@rvs.uni-bielefeld.de>
Cc: "'BlueZ Mailing List'" <bluez-devel@lists.sourceforge.net>,
	David Woodhouse <dwmw2@infradead.org>
Subject: RE: [Bluez-devel] RE: Qualification testing - rfcomm
Date: Tue, 22 Jul 2003 10:09:10 -0700	[thread overview]
Message-ID: <5.1.0.14.2.20030722092654.096aad60@unixmail.qualcomm.com> (raw)
In-Reply-To: <002501c34d61$84afdc30$5796fea9@baked>

At 12:19 PM 7/18/2003, Daryl Van Vorst wrote:
>Marcel,
>
>> > Do you mean you tried the aclsession script and didn't see the same 
>> > send 5 frames, wait 20 sec, send 5 more etc problem?
>> 
>> the aclsession scripts produces this effect, but it also left 
>> the ACL link in some kind of buggy state. It must be some 
>> really stupid that I always overlook. The code looks correct 
>> to me and my Bluetooth 1.0b devices are working fine.
>
>Ok...  I guess we can leave it for now then. If it becomes a more serious
>issue I'll let you know.
Ok. I know what's the problem is. Basically what happens is that we fill up socket 
tx buffer before MSC exchange completes (aclsession script does wait 10) and app goes to 
sleep in sendmsg(). Then we receive MSC and send 5 frames from tx buffer (we only 
send 5 frames at a time when credit flow ctl is not enabled). App is still sleeping 
at this point because sock_def_write_space() will not wakeup the process unless there
is a lot of room in the tx buffer. Eventually (after 30 secs) sendmsg() times out but
it doesn't return an error because it did manage to send a little bit. So the app will 
call sendmsg() again and send some more data, which will trigger tx queue processing 
and we will send 5 more frames, app goes to sleep again because buffer is still full 
and the cycle repeats. 
So it's should be obvious where the bug is :), it is in rfcomm_process_tx(). It's supposed
to reschedule DLC after it sends 5 packets. The reason it works for real world apps is 
because there is always some activity on the link which kicks tx processing.

Also the problem was somewhat hard to trigger before this patch from David went in
> >+++ core.c      Thu Apr  3 14:05:20 2003
> >@@ -1430,7 +1430,7 @@
> >        } else {
> >                /* CFC disabled.
> >                 * Give ourselves some credits */
> >-               d->tx_credits = RFCOMM_MAX_CREDITS;
> >+               d->tx_credits = 5;
> >        }
> >  
> >        if (test_bit(RFCOMM_TX_THROTTLED, &d->flags))

ie We used to send more frames and therefor managed free more tx buffer space and wake up application.

The fix is simple we just need to reschedule DLC when credit based flow control is not enabled. But I'm
not sure how often we need to do that. If we do it too often we'll essentially restore old behavior, too
seldom and performance will suffer. David, any suggestion ?

Max

  reply	other threads:[~2003-07-22 17:09 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-08 18:16 Qualification testing - rfcomm Daryl Van Vorst
2003-07-08 21:47 ` [Bluez-devel] " James Courtier-Dutton
2003-07-08 23:23   ` Daryl Van Vorst
2003-07-18 19:35     ` James Courtier-Dutton
2003-07-11  8:18 ` [Bluez-devel] " Marcel Holtmann
2003-07-22 16:23   ` Max Krasnyansky
2003-07-22 16:46     ` Marcel Holtmann
2003-07-22 17:40       ` Max Krasnyansky
2003-07-22 19:13         ` Marcel Holtmann
2003-07-22 16:48     ` Daryl Van Vorst
2003-07-22 16:53       ` Marcel Holtmann
2003-07-22 17:01         ` Daryl Van Vorst
2003-07-11  8:55 ` Marcel Holtmann
2003-07-11 16:43   ` Daryl Van Vorst
2003-07-11 19:05     ` [Bluez-devel] " Daryl Van Vorst
2003-07-18 18:53       ` Daryl Van Vorst
2003-07-18 18:58         ` Marcel Holtmann
2003-07-18 19:07           ` Daryl Van Vorst
2003-07-18 19:12             ` Marcel Holtmann
2003-07-18 19:19               ` Daryl Van Vorst
2003-07-22 17:09                 ` Max Krasnyansky [this message]
2003-07-22 18:13                   ` David Woodhouse
2003-07-22 19:43                     ` Max Krasnyansky
2003-07-22 16:26     ` Max Krasnyansky
2003-07-18 19:30 ` [Bluez-devel] " James Courtier-Dutton
2003-07-18 20:25   ` Daryl Van Vorst

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=5.1.0.14.2.20030722092654.096aad60@unixmail.qualcomm.com \
    --to=maxk@qualcomm.com \
    --cc=bluez-devel@lists.sourceforge.net \
    --cc=daryl@wideray.com \
    --cc=dwmw2@infradead.org \
    --cc=marcel@rvs.uni-bielefeld.de \
    /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 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.