From owner-p4-projects@FreeBSD.ORG Mon Nov 24 18:07:37 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 5CAAE1065675; Mon, 24 Nov 2008 18:07:37 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20179106564A for ; Mon, 24 Nov 2008 18:07:37 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 1269D8FC0A for ; Mon, 24 Nov 2008 18:07:37 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id mAOI7a4h047644 for ; Mon, 24 Nov 2008 18:07:36 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id mAOI7aGf047642 for perforce@freebsd.org; Mon, 24 Nov 2008 18:07:36 GMT (envelope-from sam@freebsd.org) Date: Mon, 24 Nov 2008 18:07:36 GMT Message-Id: <200811241807.mAOI7aGf047642@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Cc: Subject: PERFORCE change 153453 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Nov 2008 18:07:37 -0000 http://perforce.freebsd.org/chv.cgi?CH=153453 Change 153453 by sam@sam_ebb on 2008/11/24 18:06:56 don't pollute if.c with ll table state, add a SYSINIT to setup the zone; might want to think about SI_ORDER_* but this appears to work Affected files ... .. //depot/projects/arp-v2/src/sys/net/if.c#8 edit .. //depot/projects/arp-v2/src/sys/net/if_llatbl.c#7 edit Differences ... ==== //depot/projects/arp-v2/src/sys/net/if.c#8 (text+ko) ==== @@ -136,9 +136,6 @@ extern void nd6_setmtu(struct ifnet *); #endif -extern uma_zone_t llezone; -extern struct mtx lltables_mtx; - int if_index = 0; int ifqmaxlen = IFQ_MAXLEN; struct ifnethead ifnet; /* depend on static init XXX */ @@ -370,11 +367,6 @@ ifdev_setbyindex(0, make_dev(&net_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, "network")); if_clone_init(); - /* - * create uma zone for L2/L3 cache - */ - llezone = uma_zcreate("llentry", sizeof(struct llentry), NULL, NULL, - NULL, NULL, UMA_ALIGN_PTR, 0); } static void ==== //depot/projects/arp-v2/src/sys/net/if_llatbl.c#7 (text+ko) ==== @@ -52,14 +52,25 @@ #include MALLOC_DEFINE(M_LLTABLE, "lltable", "link level address tables"); -uma_zone_t llezone; -SLIST_HEAD(, lltable) lltables = SLIST_HEAD_INITIALIZER(lltables); +static uma_zone_t llezone; +static SLIST_HEAD(, lltable) lltables = SLIST_HEAD_INITIALIZER(lltables); int sysctl_dumparp(int af, struct sysctl_req *wr); extern void arprequest(struct ifnet *, struct in_addr *, struct in_addr *, u_char *); +/* ARGSUSED*/ +static void +lla_init(void *dummy __unused) +{ + /* + * create uma zone for L2/L3 cache + */ + llezone = uma_zcreate("llentry", sizeof(struct llentry), NULL, NULL, + NULL, NULL, UMA_ALIGN_PTR, 0); +} +SYSINIT(lla, SI_SUB_INIT_IF, SI_ORDER_FIRST, lla_init, NULL); static int dump_llcache(struct lltable *llt, int af, struct sysctl_req *wr)