From owner-freebsd-net@FreeBSD.ORG Fri Jan 18 14:38:30 2013 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7E756596 for ; Fri, 18 Jan 2013 14:38:30 +0000 (UTC) (envelope-from barney_cordoba@yahoo.com) Received: from nm23-vm4.bullet.mail.ne1.yahoo.com (nm23-vm4.bullet.mail.ne1.yahoo.com [98.138.91.183]) by mx1.freebsd.org (Postfix) with ESMTP id 4BE8EC29 for ; Fri, 18 Jan 2013 14:38:30 +0000 (UTC) Received: from [98.138.90.55] by nm23.bullet.mail.ne1.yahoo.com with NNFMP; 18 Jan 2013 14:35:04 -0000 Received: from [98.138.89.233] by tm8.bullet.mail.ne1.yahoo.com with NNFMP; 18 Jan 2013 14:35:04 -0000 Received: from [127.0.0.1] by omp1048.mail.ne1.yahoo.com with NNFMP; 18 Jan 2013 14:35:04 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 423574.32388.bm@omp1048.mail.ne1.yahoo.com Received: (qmail 571 invoked by uid 60001); 18 Jan 2013 14:35:04 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1358519704; bh=Q2fQbejkciLakSxDqQTPKhlT7+g0bObGGOpbv94ivD4=; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:Message-ID:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=dlS19GrpGRFSXnP2MpiYV/+1knUNfr72iBtDZ216ht+UgEZjHP7PIrGkinDqyEFIeqFcQNZ82LqbD8pT6fbaB3psnJU5GMpWnTtxhVau6yY5jmcn1xJ/UCUiQpX6TApBFxyTo6EJ7d9/oMW/Rt6SF3YdosQnx9Gvfk+SuFaSu1E= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:Message-ID:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=lIp16mJDhiHjAubSELenpkCxW5GlkiesZKo55vUUTokGLg258h3h2MRld5BJB814wXO2oTJr5zOC33vYMVuo4d+qR67nCGOIJTH5RMb9gRd85Bfku4COucpxTNdqIbxlPwsJDh+FqVwDv2fFcFr+ALLTSGFwrVteIOUUoFl6rk4=; X-YMail-OSG: KWBebAUVM1lxvZo7q0bQIrICFuC5GrKcHpEcLfrHWNhpW8m 0Xg0LO2mHOit8ML7qaBhbG6FJgmNXY62HHfd.L4hXHvQ53NskBWpV8LNsV0i _CTr3W_BK2iYA78qe_XtRJHOTKyq.ECx6frE.vUl2etVeofdly2usi2EzoOq 2M1zHyDSXxhcXe_kQiBlTygnwvJhKhsvu8W_GGfTpGOtyDE5lIhwDKr8u0.u KzU2GbNMnIlemVSpLFdmpi3h0VfO0z8rXpM99xnf_.idfLEU9TiIJkubXygQ ClCEBGnLaJZd5aplIygKQJDZkNdgbAZPP_hSt3h89SdsJLFEUUK8MJZnQRqU 5Uv8TOHNs.4RIsP5eh5l1X5eMcTf9TZuzmFo5KYuHNfx6GCjkW0YX.WFm1C2 4rCNUTpeKlXTdpUAfO1fdyxjtF5cHzk600b975SO.6gQ8trVcWMJnkObAVEe ORFb8kXLyQSBmWxgAuIyIhTbdAmEtLu9m4wUU9KfuqyVwb86RXR75r_Q4pHR Fzc2JVWWegpM6Fp7QO80c7b8ydWb6 Received: from [174.48.128.27] by web121605.mail.ne1.yahoo.com via HTTP; Fri, 18 Jan 2013 06:35:04 PST X-Rocket-MIMEInfo: 001.001, DQoNCi0tLSBPbiBUaHUsIDEvMTcvMTMsIEFkcmlhbiBDaGFkZCA8YWRyaWFuQGZyZWVic2Qub3JnPiB3cm90ZToNCg0KPiBGcm9tOiBBZHJpYW4gQ2hhZGQgPGFkcmlhbkBmcmVlYnNkLm9yZz4NCj4gU3ViamVjdDogUmU6IHR3byBwcm9ibGVtcyBpbiBkZXYvZTEwMDAvaWZfbGVtLmM6OmxlbV9oYW5kbGVfcnh0eCgpDQo.IFRvOiAiTHVpZ2kgUml6em8iIDxyaXp6b0BpZXQudW5pcGkuaXQ.DQo.IENjOiAiQmFybmV5IENvcmRvYmEiIDxiYXJuZXlfY29yZG9iYUB5YWhvby5jb20.LCBmcmVlYnNkLW5ldEBmcmUBMAEBAQE- X-Mailer: YahooMailClassic/15.1.2 YahooMailWebService/0.8.130.494 Message-ID: <1358519704.98312.YahooMailClassic@web121605.mail.ne1.yahoo.com> Date: Fri, 18 Jan 2013 06:35:04 -0800 (PST) From: Barney Cordoba Subject: Re: two problems in dev/e1000/if_lem.c::lem_handle_rxtx() To: Luigi Rizzo , Adrian Chadd In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-net@freebsd.org X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jan 2013 14:38:30 -0000 --- On Thu, 1/17/13, Adrian Chadd wrote: > From: Adrian Chadd > Subject: Re: two problems in dev/e1000/if_lem.c::lem_handle_rxtx() > To: "Luigi Rizzo" > Cc: "Barney Cordoba" , freebsd-net@freebsd.org > Date: Thursday, January 17, 2013, 2:04 PM > On 17 January 2013 09:44, Luigi Rizzo > > wrote: >=20 > > (in the "lem" driver this cannot happen until you > release some > > rx slots, which only happens once at the end of the > lem_rxeof() routine, > > not long before re-enabling interrupts) >=20 > Right. >=20 > >> * .. and the hardware immediately sends you the MSI > or signals an interrupt; > >> * .. thus you re-enter the RX processing thread > almost(!) immediately. > > > > the problem i was actually seeing are slightly > different, namely: > > - once the driver lags behind, it does not have a > chance to recover > >=A0=A0=A0even if there are CPU cycles > available, because both interrupt > >=A0=A0=A0rate and packets per interrupt are > capped. >=20 > Right, but the interrupt isn't being continuously asserted > whilst > there are packets there. > You just get a single interrupt when the queue has frames in > it, and > you won't get a further interrupt for whatever the > mitigation period > is (or ever, if you fill up the RX FIFO, right?) >=20 > > - much worse, once the input stream stops, you have a > huge backlog that > >=A0=A0=A0is not drained. And if, say, you try > to ping the machine, > >=A0=A0=A0the incoming packet is behind another > 3900 packets, so the first > >=A0=A0=A0interrupt drains 100 (but not the ping > request, so no response), > >=A0=A0=A0you keep going for a while, eventually > the external world sees the > >=A0=A0=A0machine as not responding and stops > even trying to talk to it. >=20 > Right, so you do need to do what you're doing - but I still > think > there's a possibility of a race there. > Namely that your queue servicing does reach the end of the > list (and > so you don't immediately reschedule the taskqueue) but some > more > frames have arrived. > You have to wait for the next mitigated interrupt for that. i don't think that's the case. The mitigation is a minimum delay. If the=20 delay is longer than the minimum, you'd get an interrupt as soon as you enable it, which is clearly better than scheduling a task. BC