From owner-cvs-all@FreeBSD.ORG Sun Jan 15 00:55:05 2006 Return-Path: X-Original-To: cvs-all@FreeBSD.org 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 818AD16A41F; Sun, 15 Jan 2006 00:55:05 +0000 (GMT) (envelope-from glebius@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4CE8D43D48; Sun, 15 Jan 2006 00:55:05 +0000 (GMT) (envelope-from glebius@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0F0t5Dj028618; Sun, 15 Jan 2006 00:55:05 GMT (envelope-from glebius@repoman.freebsd.org) Received: (from glebius@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0F0t52R028617; Sun, 15 Jan 2006 00:55:05 GMT (envelope-from glebius) Message-Id: <200601150055.k0F0t52R028617@repoman.freebsd.org> From: Gleb Smirnoff Date: Sun, 15 Jan 2006 00:55:05 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: RELENG_6 Cc: Subject: cvs commit: src/sys/netinet ip_fw2.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 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: Sun, 15 Jan 2006 00:55:05 -0000 glebius 2006-01-15 00:55:05 UTC FreeBSD src repository Modified files: (Branch: RELENG_6) sys/netinet ip_fw2.c Log: MFC 1.118: Optimize parallel processing of ipfw(4) rulesets eliminating the locking of the radix lookup tables. Since several rnh_lookup() can run in parallel on the same table, we can piggyback on the shared locking provided by ipfw(4). However, the single entry cache in the ip_fw_table can't be used lockless, so it is removed. This pessimizes two cases: processing of bursts of similar packets and matching one packet against the same table several times during one ipfw_chk() lookup. To optimize the processing of similar packet bursts administrator should use stateful firewall. To optimize the second problem a solution will be provided soon. Details: o Since we piggyback on the ipfw(4) locking, and the latter is per-chain, the tables are moved from the global declaration to the struct ip_fw_chain. o The struct ip_fw_table is shrunk to one entry and thus vanished. o All table manipulating functions are extended to accept the struct ip_fw_chain * argument. o All table modifing functions use IPFW_WLOCK_ASSERT(). Revision Changes Path 1.106.2.7 +54 -71 src/sys/netinet/ip_fw2.c