Date: Mon, 24 Nov 2008 18:07:36 GMT From: Sam Leffler <sam@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 153453 for review Message-ID: <200811241807.mAOI7aGf047642@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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 <netinet6/nd6.h> 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)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200811241807.mAOI7aGf047642>