From owner-freebsd-current@FreeBSD.ORG Mon Dec 4 17:03:15 2006 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C8D5E16A4D2; Mon, 4 Dec 2006 17:03:15 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4170943CFC; Mon, 4 Dec 2006 17:01:34 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from zion.baldwin.cx (zion.baldwin.cx [192.168.0.7]) (authenticated bits=0) by server.baldwin.cx (8.13.6/8.13.6) with ESMTP id kB4H1sk1040244; Mon, 4 Dec 2006 12:02:00 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: Munehiro Matsuda Date: Mon, 4 Dec 2006 11:49:20 -0500 User-Agent: KMail/1.9.4 References: <20061128180811.P95096@fledge.watson.org> <20061202122415.A91892@maildrop.int.zabbadoz.net> <20061204.004950.74755916.haro@h4.dion.ne.jp> In-Reply-To: <20061204.004950.74755916.haro@h4.dion.ne.jp> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200612041149.21533.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [192.168.0.1]); Mon, 04 Dec 2006 12:02:01 -0500 (EST) X-Virus-Scanned: ClamAV 0.88.3/2276/Mon Dec 4 03:15:27 2006 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: bzeeb-lists@lists.zabbadoz.net, freebsd-current@freebsd.org, rwatson@freebsd.org Subject: Re: LOR with netisr changes X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Dec 2006 17:03:16 -0000 On Sunday 03 December 2006 10:49, Munehiro Matsuda wrote: > From: John Baldwin > Date: Wed, 29 Nov 2006 12:39:56 -0500 > ::On Tuesday 28 November 2006 14:41, Sam Leffler wrote: > ::> Robert Watson wrote: > ::> > > ::> > On Wed, 29 Nov 2006, Munehiro Matsuda wrote: > ::> > > ::> >> JFYI, I got following LOR started after the netisr changes: > ::> > > ::> > In general, device driver locks should not be held over entry to the > ::> > network stack. However, things get a bit tricky in the 802.11 code due > ::> > to lock sharing, I believe, so it could be a bit more tricky to fix that. > ::> > ::> It's just a bug in the driver. Driver locks should be dropped when > ::> packets get passed up the stack. This issue was pointed out before iwi > ::> ever was committed but since nothing immediately comes back via the > ::> bridge (or similar) it's been ignored. > :: > ::How about this: > > ::(I'm unsure if the net82011 layer protects 'ic' or if the driver is supposed > ::to do that.) > > Sorry for the late reply, and thanks for the patch. > I needed to tweak the patch to make it compile, but seems to work fine. > Modified patch attached. > > From: "Bjoern A. Zeeb" > Date: Sat, 2 Dec 2006 12:25:28 +0000 (UTC) > ::ok, whoever is going to take care of this and perhaps commit the fix > ::let me know. I assigned it LOR ID 194 on "The LOR page": > :: http://sources.zabbadoz.net/freebsd/lor.html#194 > > LOR seems to be gone with the patch, so it could be removed when committed. > > Thanks, > Haro > > --- if_iwi.c.org 9 Nov 2006 16:05:43 -0000 > +++ if_iwi.c 3 Dec 2006 14:17:45 -0000 > @@ -1230,6 +1230,7 @@ > struct mbuf *mnew, *m; > struct ieee80211_node *ni; > int type, error, framelen; > + IWI_LOCK_DECL; Hmm, why this? If it's for spl's, note that the rest of the patch is specific to 5.x and up, shouldn't really be dropping spl in 4.x. Also, even if it did, it would pass a garbage value to splx(), so it would really break things badly. > framelen = le16toh(frame->len); > if (framelen < IEEE80211_MIN_LEN || framelen > MCLBYTES) { > @@ -1310,6 +1311,7 @@ > > bpf_mtap2(sc->sc_drvbpf, tap, sc->sc_rxtap_len, m); > } > + IWI_UNLOCK(sc); > > ni = ieee80211_find_rxnode(ic, mtod(m, struct ieee80211_frame_min *)); > > @@ -1319,6 +1321,7 @@ > /* node is no longer needed */ > ieee80211_free_node(ni); > > + IWI_LOCK(sc); > if (sc->sc_softled) { > /* > * Blink for any data frame. Otherwise do a > > =------------------------------------------------------------------------------ > _ _ Munehiro (haro) Matsuda > -|- /_\ |_|_| Internet Solution Dept., KGT Inc. > /|\ |_| |_|_| 2-8-8 Shinjuku Shinjuku-ku Tokyo 160-0022, Japan > Tel: +81-3-3225-0767 Fax: +81-3-3225-0740 > -- John Baldwin