From owner-freebsd-current Mon Oct 2 22: 7:54 2000 Delivered-To: freebsd-current@freebsd.org Received: from ego.mind.net (ego.mind.net [206.99.66.9]) by hub.freebsd.org (Postfix) with ESMTP id A3E7337B503; Mon, 2 Oct 2000 22:07:50 -0700 (PDT) Received: from takhus-home.ashlandfn.org (AFN-Dyn-6315110844.pc.ashlandfiber.net [63.151.108.44]) by ego.mind.net (8.9.3/8.9.3) with ESMTP id WAA15481; Mon, 2 Oct 2000 22:07:49 -0700 Received: from localhost (fleisher@localhost) by takhus-home.ashlandfn.org (8.11.0/8.11.0) with ESMTP id e9357g834466; Mon, 2 Oct 2000 22:07:42 -0700 (PDT) (envelope-from takhus@takhus.mind.net) X-Authentication-Warning: takhus-home.ashlandfn.org: fleisher owned process doing -bs Date: Mon, 2 Oct 2000 22:07:42 -0700 (PDT) From: Tony Fleisher X-Sender: fleisher@takhus-home.ashlandfn.org To: John Baldwin Cc: phk@FreeBSD.org, current@FreeBSD.org Subject: Re: bpf "fix" In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Yeah, I didn't figure that my patch was correct. I too am waiting to see what phk comes up with. :) He did commit a new flag to sys/sys/conf.h on Sep. 19 "Introduce experimental SI_CHEAPCLONE flag set it on cloned bpfs." but I have not seen anything in the source come up that uses it... yet.: conf.h:59: #define SI_CHEAPCLONE 0x0008 /* can be removed_dev'ed when vnode reclaims */ Regards, TOny. On Mon, 2 Oct 2000, John Baldwin wrote: > > On 03-Oct-00 Tony Fleisher wrote: > > I submitted a PR on this a few weeks ago. > > > > See: http://www.FreeBSD.org/cgi/query-pr.cgi?pr=21391 for comments > > from phk. > > Hmm, well your patch would break in the non-DEVFS case. In the non-DEVFS > case, open() still needs to call make_dev(), but I'm eager to see what phk's > better solution is. :-P > > > On Mon, 2 Oct 2000, John Baldwin wrote: > > > >> I stared at the bpf code some last week, and determined that the > >> extra make_dev() was in bpf's open() method in the non-devfs > >> case. As such, I have a rather simple patch. However, I don't > >> like a driver having to be aware of devfs. Does anyone have any > >> other (preferably cleaner) ways to fix this? > >> > >> http://www.FreeBSD.org/~jhb/patches/bpf.patch > >> > >> Index: net/bpf.c > >> =================================================================== > >> RCS file: /usr/cvs/src/sys/net/bpf.c,v > >> retrieving revision 1.67 > >> diff -u -r1.67 bpf.c > >> --- net/bpf.c 2000/09/19 10:28:41 1.67 > >> +++ net/bpf.c 2000/09/27 00:51:30 > >> @@ -363,8 +363,10 @@ > >> */ > >> if (d) > >> return (EBUSY); > >> - make_dev(&bpf_cdevsw, minor(dev), UID_ROOT, GID_WHEEL, 0600, > >> - "bpf%d", dev2unit(dev)); > >> + /* XXX - ugly, we shouldn't have to know about devfs here */ > >> + if (!devfs_present) > >> + make_dev(&bpf_cdevsw, minor(dev), UID_ROOT, GID_WHEEL, 0600, > >> + "bpf%d", dev2unit(dev)); > >> MALLOC(d, struct bpf_d *, sizeof(*d), M_BPF, M_WAITOK); > >> bzero(d, sizeof(*d)); > >> dev->si_drv1 = d; > >> > >> -- > >> > >> John Baldwin -- http://www.FreeBSD.org/~jhb/ > >> PGP Key: http://www.baldwin.cx/~john/pgpkey.asc > >> "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ > >> > >> > >> To Unsubscribe: send mail to majordomo@FreeBSD.org > >> with "unsubscribe freebsd-current" in the body of the message > >> > > > > -- > > John Baldwin -- http://www.FreeBSD.org/~jhb/ > PGP Key: http://www.baldwin.cx/~john/pgpkey.asc > "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message