From owner-svn-src-head@FreeBSD.ORG Wed Oct 1 14:39:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2FDA812E; Wed, 1 Oct 2014 14:39:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 113F6F61; Wed, 1 Oct 2014 14:39:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s91Ed7UM022639; Wed, 1 Oct 2014 14:39:07 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s91Ed7K3022634; Wed, 1 Oct 2014 14:39:07 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201410011439.s91Ed7K3022634@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Wed, 1 Oct 2014 14:39:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272361 - in head/sys: net netinet netinet6 netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Oct 2014 14:39:08 -0000 Author: melifaro Date: Wed Oct 1 14:39:06 2014 New Revision: 272361 URL: https://svnweb.freebsd.org/changeset/base/272361 Log: Remove lock init from radix.c. Radix has never managed its locking itself. The only consumer using radix with embeded rwlock is system routing table. Move per-AF lock inits there. Modified: head/sys/net/radix.c head/sys/netinet/in_rmx.c head/sys/netinet6/in6_rmx.c head/sys/netpfil/pf/pf_table.c Modified: head/sys/net/radix.c ============================================================================== --- head/sys/net/radix.c Wed Oct 1 14:35:52 2014 (r272360) +++ head/sys/net/radix.c Wed Oct 1 14:39:06 2014 (r272361) @@ -1122,9 +1122,6 @@ rn_inithead_internal(void **head, int of R_Zalloc(rnh, struct radix_node_head *, sizeof (*rnh)); if (rnh == 0) return (0); -#ifdef _KERNEL - RADIX_NODE_HEAD_LOCK_INIT(rnh); -#endif *head = rnh; t = rn_newpair(rn_zeros, off, rnh->rnh_nodes); ttt = rnh->rnh_nodes + 2; Modified: head/sys/netinet/in_rmx.c ============================================================================== --- head/sys/netinet/in_rmx.c Wed Oct 1 14:35:52 2014 (r272360) +++ head/sys/netinet/in_rmx.c Wed Oct 1 14:39:06 2014 (r272361) @@ -352,10 +352,12 @@ in_inithead(void **head, int off) if (!rn_inithead(head, 32)) return 0; + rnh = *head; + RADIX_NODE_HEAD_LOCK_INIT(rnh); + if (off == 0) /* XXX MRT see above */ return 1; /* only do the rest for a real routing table */ - rnh = *head; rnh->rnh_addaddr = in_addroute; in_setmatchfunc(rnh, V_drop_redirect); rnh->rnh_close = in_clsroute; Modified: head/sys/netinet6/in6_rmx.c ============================================================================== --- head/sys/netinet6/in6_rmx.c Wed Oct 1 14:35:52 2014 (r272360) +++ head/sys/netinet6/in6_rmx.c Wed Oct 1 14:39:06 2014 (r272361) @@ -270,10 +270,12 @@ in6_inithead(void **head, int off) if (!rn_inithead(head, offsetof(struct sockaddr_in6, sin6_addr) << 3)) return 0; /* See above */ + rnh = *head; + RADIX_NODE_HEAD_LOCK_INIT(rnh); + if (off == 0) /* See above */ return 1; /* only do the rest for the real thing */ - rnh = *head; rnh->rnh_addaddr = in6_addroute; if (V__in6_rt_was_here == 0) { Modified: head/sys/netpfil/pf/pf_table.c ============================================================================== --- head/sys/netpfil/pf/pf_table.c Wed Oct 1 14:35:52 2014 (r272360) +++ head/sys/netpfil/pf/pf_table.c Wed Oct 1 14:39:06 2014 (r272361) @@ -1853,14 +1853,10 @@ pfr_destroy_ktable(struct pfr_ktable *kt pfr_clean_node_mask(kt, &addrq); pfr_destroy_kentries(&addrq); } - if (kt->pfrkt_ip4 != NULL) { - RADIX_NODE_HEAD_DESTROY(kt->pfrkt_ip4); + if (kt->pfrkt_ip4 != NULL) rn_detachhead((void **)&kt->pfrkt_ip4); - } - if (kt->pfrkt_ip6 != NULL) { - RADIX_NODE_HEAD_DESTROY(kt->pfrkt_ip6); + if (kt->pfrkt_ip6 != NULL) rn_detachhead((void **)&kt->pfrkt_ip6); - } if (kt->pfrkt_shadow != NULL) pfr_destroy_ktable(kt->pfrkt_shadow, flushaddr); if (kt->pfrkt_rs != NULL) {