From owner-freebsd-stable@FreeBSD.ORG Tue Sep 17 16:04:01 2013 Return-Path: Delivered-To: freebsd-stable@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 48B48A3A; Tue, 17 Sep 2013 16:04:01 +0000 (UTC) (envelope-from hans.petter.selasky@bitfrost.no) Received: from mta.bitpro.no (mta.bitpro.no [92.42.64.202]) by mx1.freebsd.org (Postfix) with ESMTP id CCDEB2ED7; Tue, 17 Sep 2013 16:04:00 +0000 (UTC) Received: from mail.lockless.no (mail.lockless.no [46.29.221.38]) by mta.bitpro.no (Postfix) with ESMTP id CCD397A1DB; Tue, 17 Sep 2013 18:03:52 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.lockless.no (Postfix) with ESMTP id 7CF6B8F66A2; Tue, 17 Sep 2013 18:04:10 +0200 (CEST) X-Virus-Scanned: by amavisd-new-2.6.4 (20090625) (Debian) at lockless.no Received: from mail.lockless.no ([127.0.0.1]) by localhost (mail.lockless.no [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZWYhIWXPXqyt; Tue, 17 Sep 2013 18:04:09 +0200 (CEST) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) by mail.lockless.no (Postfix) with ESMTPSA id A6B008F66A1; Tue, 17 Sep 2013 18:04:09 +0200 (CEST) Message-ID: <52387DAA.1020109@bitfrost.no> Date: Tue, 17 Sep 2013 18:04:58 +0200 From: Hans Petter Selasky Organization: Bitfrost A/S User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130522 Thunderbird/17.0.6 MIME-Version: 1.0 To: Harald Schmalzbauer Subject: Re: umcs (4-Port-USB-serial) triggering way too much ehci IRQs References: <52372DBA.6020703@omnilan.de> <875323075.20130917124437@serebryakov.spb.ru> <523816E1.10603@omnilan.de> <1857258551.20130917124737@serebryakov.spb.ru> <5238198C.3070604@bitfrost.no> <52381BAC.5010801@omnilan.de> <52381FCA.5030509@bitfrost.no> <5238775C.8010000@omnilan.de> In-Reply-To: <5238775C.8010000@omnilan.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Cc: lev@FreeBSD.org, FreeBSD Stable , freebsd-usb@FreeBSD.org X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Sep 2013 16:04:01 -0000 On 09/17/13 17:38, Harald Schmalzbauer wrote: > Bezüglich Hans Petter Selasky's Nachricht vom 17.09.2013 11:24 > (localtime): >> On 09/17/13 11:06, Harald Schmalzbauer wrote: >>> ... >>> Shall we switch to non-list-comm? >> >> Hi, >> >> That's OK. >> >>> Hmm, in my case, this 4-port-serial-USB-hub will be used as console >>> concentrator. So most time it's doing nothing, just feeding tmux with >>> consoles output. What latency are we talking about? Less than a some >>> milliseconds should be fine. >>> What I'm curious about is why my prolific USB-serial converter doesn't >>> generate these high irqs. >> >> Try this patch and see what happens: >> >> ================================================================== >> --- umcs.c (revision 255492) >> +++ umcs.c (local) >> @@ -230,6 +230,7 @@ >> .bufsize = 0, /* use wMaxPacketSize */ >> .callback = &umcs7840_intr_callback, >> .if_index = 0, >> + .interval = 20, /* ms */ >> }, >> }; >> >> >> BTW: I see that the umcs driver shouldn't do synchronous control >> transfers from the USB interrupt transfer callback. This should be >> postponed into some worker thread, for example the USB explore thread. >> See USB audio driver for an example. >> >> --HPS > > I tried your patch and it works as expected: IRQs decreased to ~64/s > when idle/disconnected. > > One interesting thing I never measured before: > Console connection with 115k2 via umcs and 'while ( 2>1 ) echo "---..." > end' results in 8000 irqs/s :-( But that's also true for the prolific > (uplcom). The latter just goes down to 0.0 irqs/s when idle. > > Doing the same with uart0 results in 1444irqs/s. > Is it by design/unavoidable that transfering the same via USB multiplies > by factor 5-6? > > Thanks, > > -Harry > Hi, I think the adapters use very small buffers. You can try adding ".interval = 4" to the other USB configs, above the one you patched, and see what happens. I cannot tell if you will loose characters or not. --HPS