From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 9 20:47:48 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6AF3516A4CF for ; Mon, 9 Aug 2004 20:47:48 +0000 (GMT) Received: from koala.domainit.com (koala.domainit.com [206.21.217.15]) by mx1.FreeBSD.org (Postfix) with SMTP id ECEA943D1D for ; Mon, 9 Aug 2004 20:47:47 +0000 (GMT) (envelope-from cokane@cokane.org) Received: (qmail 81442 invoked by uid 85); 9 Aug 2004 20:50:43 -0000 X-Remote-IP: 216.196.247.106 Received: from ddsl-216-196-247-106.fuse.net (HELO ?192.168.2.251?) (216.196.247.106) by mail.domainit.com with SMTP; 9 Aug 2004 20:50:43 -0000 From: Coleman To: Yar Tikhiy In-Reply-To: <20040807092347.GB39835@comp.chem.msu.su> References: <346a8022040806145018a5e18@mail.gmail.com> <1091862376.7840.3.camel@berloga.shadowland> <20040807092347.GB39835@comp.chem.msu.su> Content-Type: multipart/mixed; boundary="=-NcuASJXk0RQjgaZBLv5j" Message-Id: <1092084486.65806.12.camel@schemer> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Mon, 09 Aug 2004 16:48:06 -0400 X-Mailman-Approved-At: Tue, 10 Aug 2004 11:40:49 +0000 cc: hackers@freebsd.org cc: Alex Lyashkov Subject: Re: Network interface RUNNING and UP flags X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Aug 2004 20:47:48 -0000 --=-NcuASJXk0RQjgaZBLv5j Content-Type: text/plain Content-Transfer-Encoding: 7bit Here, I pushed that section of code up before the prior mtx_unlock(&tp->tap_mtx) above it, then removed the splimp/splx calls. Is this what you were referring to (attached)? Also, I noticed splx and splimp are called in a number of other places in this driver, even under -CURRENT. You want those out too? The patch is a patch on the original -CURRENT version of the driver and not a patch to the previous patch I received. -- coleman kane On Sat, 2004-08-07 at 05:23, Yar Tikhiy wrote: > On Sat, Aug 07, 2004 at 10:06:17AM +0300, Alex Lyashkov wrote: > > > > not better move this under tp->tap_mtx mutex without using splX > > functions? > > ...especially taking into account that splX do nothing > in CURRENT anyway. Mutex locking framework adopted by > the interface driver should be used of course. --=-NcuASJXk0RQjgaZBLv5j Content-Description: Content-Disposition: attachment; filename=if_tap.c.diff Content-Type: text/x-patch; charset=ASCII Content-Transfer-Encoding: 7bit --- if_tap.c.orig Thu Jun 24 13:16:35 2004 +++ if_tap.c Mon Aug 9 16:42:40 2004 @@ -368,6 +368,12 @@ bcopy(tp->arpcom.ac_enaddr, tp->ether_addr, sizeof(tp->ether_addr)); tp->tap_pid = td->td_proc->p_pid; tp->tap_flags |= TAP_OPEN; + + /* Set the interface to RUNNING state while the device is + opened + */ + tp->tap_if.if_flags |= IFF_RUNNING; + tp->tap_if.if_flags &= ~IFF_OACTIVE; mtx_unlock(&tp->tap_mtx); TAPDEBUG("%s is open. minor = %#x\n", --=-NcuASJXk0RQjgaZBLv5j--