From owner-cvs-all@FreeBSD.ORG Sat Dec 11 07:10:00 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 33B9E16A4CE; Sat, 11 Dec 2004 07:10:00 +0000 (GMT) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1D42543D2F; Sat, 11 Dec 2004 07:10:00 +0000 (GMT) (envelope-from bright@elvis.mu.org) Received: by elvis.mu.org (Postfix, from userid 1192) id 112B95C98A; Fri, 10 Dec 2004 23:10:00 -0800 (PST) Date: Fri, 10 Dec 2004 23:10:00 -0800 From: Alfred Perlstein To: "Christian S.J. Peron" Message-ID: <20041211070959.GT20783@elvis.mu.org> References: <200412100217.iBA2HI2L008474@repoman.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200412100217.iBA2HI2L008474@repoman.freebsd.org> User-Agent: Mutt/1.4.2.1i cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/netinet ip_fw2.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: Sat, 11 Dec 2004 07:10:00 -0000 * Christian S.J. Peron [041209 18:17] wrote: > csjp 2004-12-10 02:17:18 UTC > > It should be noted that this locking mechanism does not guarantee > fairness between read and write locks, and that it will favor > firewall chain readers over writers. This seemed acceptable since > write operations to firewall chains protected by this lock tend to > be less frequent than reads. > > Reviewed by: andre, rwatson > Tested by: myself, seanc > Silence on: ipfw@ > MFC after: 1 month > > Revision Changes Path > 1.85 +69 -29 src/sys/netinet/ip_fw2.c The code I see doesn't appear to work right. Can you switch it using sx lock? see the sx_xlock(9) API. Specifically: static __inline void IPFW_RLOCK(struct ip_fw_chain *chain) { mtx_lock(&chain->mtx); chain->busy_count++; mtx_unlock(&chain->mtx); } What if there already is an WLOCK? It doesn't block the reader. -- - Alfred Perlstein - Research Engineering Development Inc. - email: bright@mu.org cell: 408-480-4684