From owner-cvs-all@FreeBSD.ORG Mon Mar 29 14:16:40 2004 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2B83916A4CE; Mon, 29 Mar 2004 14:16:40 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 256D243D1D; Mon, 29 Mar 2004 14:16:40 -0800 (PST) (envelope-from rwatson@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i2TMGdGe083266; Mon, 29 Mar 2004 14:16:39 -0800 (PST) (envelope-from rwatson@repoman.freebsd.org) Received: (from rwatson@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i2TMGdUs083265; Mon, 29 Mar 2004 14:16:39 -0800 (PST) (envelope-from rwatson) Message-Id: <200403292216.i2TMGdUs083265@repoman.freebsd.org> From: Robert Watson Date: Mon, 29 Mar 2004 14:16:39 -0800 (PST) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/net if_tun.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Mar 2004 22:16:40 -0000 rwatson 2004/03/29 14:16:39 PST FreeBSD src repository Modified files: sys/net if_tun.c Log: Add per-softc locking to if_tun: - Add tun_mtx to tun_softc. Annotate what is (and isn't) locked by it. - Lock down tun_flags, tun_pid. - In the output path, cache the value of tun_flags so it's consistent when processing a particular packet rather than re-reading the field. - In general, use unlocked reads for debugging. - Annotate a couple of places where additional unlocked reads may be possible. - Annotate that tun_pid is used as a bug in tunopen(). if_tun is now largely MPSAFE, although questions remain about some of the cdevsw fields and how they are synchronized. Revision Changes Path 1.139 +66 -6 src/sys/net/if_tun.c