Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F146690529
D36161.id109249.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
4 KB
Referenced Files
None
Subscribers
None
D36161.id109249.diff
View Options
Index: sys/netinet/icmp6.h
===================================================================
--- sys/netinet/icmp6.h
+++ sys/netinet/icmp6.h
@@ -704,8 +704,6 @@
void icmp6_error(struct mbuf *, int, int, int);
void icmp6_error2(struct mbuf *, int, int, int, struct ifnet *);
int icmp6_input(struct mbuf **, int *, int);
-void icmp6_fasttimo(void);
-void icmp6_slowtimo(void);
void icmp6_prepare(struct mbuf *);
void icmp6_redirect_input(struct mbuf *, int);
void icmp6_redirect_output(struct mbuf *, struct nhop_object *);
Index: sys/netinet6/icmp6.c
===================================================================
--- sys/netinet6/icmp6.c
+++ sys/netinet6/icmp6.c
@@ -2127,20 +2127,6 @@
return;
}
-void
-icmp6_fasttimo(void)
-{
-
- mld_fasttimo();
-}
-
-void
-icmp6_slowtimo(void)
-{
-
- mld_slowtimo();
-}
-
static const char *
icmp6_redirect_diag(struct in6_addr *src6, struct in6_addr *dst6,
struct in6_addr *tgt6)
Index: sys/netinet6/in6.c
===================================================================
--- sys/netinet6/in6.c
+++ sys/netinet6/in6.c
@@ -79,7 +79,6 @@
#include <sys/systm.h>
#include <sys/priv.h>
#include <sys/proc.h>
-#include <sys/protosw.h>
#include <sys/time.h>
#include <sys/kernel.h>
#include <sys/lock.h>
Index: sys/netinet6/in6_proto.c
===================================================================
--- sys/netinet6/in6_proto.c
+++ sys/netinet6/in6_proto.c
@@ -211,8 +211,6 @@
.pr_protocol = IPPROTO_ICMPV6,
.pr_flags = PR_ATOMIC|PR_ADDR,
.pr_ctloutput = rip6_ctloutput,
- .pr_fasttimo = icmp6_fasttimo,
- .pr_slowtimo = icmp6_slowtimo,
.pr_usrreqs = &rip6_usrreqs
},
#ifdef INET
Index: sys/netinet6/mld6.c
===================================================================
--- sys/netinet6/mld6.c
+++ sys/netinet6/mld6.c
@@ -75,7 +75,6 @@
#include <sys/systm.h>
#include <sys/mbuf.h>
#include <sys/socket.h>
-#include <sys/protosw.h>
#include <sys/sysctl.h>
#include <sys/kernel.h>
#include <sys/callout.h>
@@ -1294,14 +1293,17 @@
* Fast timeout handler (global).
* VIMAGE: Timeout handlers are expected to service all vimages.
*/
-void
-mld_fasttimo(void)
+static struct callout mldfast_callout;
+static void
+mld_fasttimo(void *arg __unused)
{
+ struct epoch_tracker et;
struct in6_multi_head inmh;
VNET_ITERATOR_DECL(vnet_iter);
SLIST_INIT(&inmh);
+ NET_EPOCH_ENTER(et);
VNET_LIST_RLOCK_NOSLEEP();
VNET_FOREACH(vnet_iter) {
CURVNET_SET(vnet_iter);
@@ -1309,7 +1311,10 @@
CURVNET_RESTORE();
}
VNET_LIST_RUNLOCK_NOSLEEP();
+ NET_EPOCH_EXIT(et);
in6m_release_list_deferred(&inmh);
+
+ callout_reset(&mldfast_callout, hz / PR_FASTHZ, mld_fasttimo, NULL);
}
/*
@@ -1320,7 +1325,6 @@
static void
mld_fasttimo_vnet(struct in6_multi_head *inmh)
{
- struct epoch_tracker et;
struct mbufq scq; /* State-change packets */
struct mbufq qrq; /* Query response packets */
struct ifnet *ifp;
@@ -1385,7 +1389,6 @@
mbufq_init(&scq, MLD_MAX_STATE_CHANGE_PACKETS);
}
- NET_EPOCH_ENTER(et);
IF_ADDR_WLOCK(ifp);
CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
inm = in6m_ifmultiaddr_get_inm(ifma);
@@ -1424,7 +1427,6 @@
mld_dispatch_queue(&scq, 0);
break;
}
- NET_EPOCH_EXIT(et);
}
out_locked:
@@ -1707,8 +1709,9 @@
* Global slowtimo handler.
* VIMAGE: Timeout handlers are expected to service all vimages.
*/
-void
-mld_slowtimo(void)
+static struct callout mldslow_callout;
+static void
+mld_slowtimo(void *arg __unused)
{
VNET_ITERATOR_DECL(vnet_iter);
@@ -1719,6 +1722,8 @@
CURVNET_RESTORE();
}
VNET_LIST_RUNLOCK_NOSLEEP();
+
+ callout_reset(&mldslow_callout, hz / PR_SLOWHZ, mld_slowtimo, NULL);
}
/*
@@ -3268,6 +3273,11 @@
mld_po.ip6po_hbh = &mld_ra.hbh;
mld_po.ip6po_prefer_tempaddr = IP6PO_TEMPADDR_NOTPREFER;
mld_po.ip6po_flags = IP6PO_DONTFRAG;
+
+ callout_init(&mldslow_callout, 1);
+ callout_reset(&mldslow_callout, hz / PR_SLOWHZ, mld_slowtimo, NULL);
+ callout_init(&mldfast_callout, 1);
+ callout_reset(&mldfast_callout, hz / PR_FASTHZ, mld_fasttimo, NULL);
}
SYSINIT(mld_init, SI_SUB_PROTO_MC, SI_ORDER_MIDDLE, mld_init, NULL);
@@ -3276,6 +3286,8 @@
{
CTR1(KTR_MLD, "%s: tearing down", __func__);
+ callout_drain(&mldslow_callout);
+ callout_drain(&mldfast_callout);
MLD_LOCK_DESTROY();
}
SYSUNINIT(mld_uninit, SI_SUB_PROTO_MC, SI_ORDER_MIDDLE, mld_uninit, NULL);
Index: sys/netinet6/mld6_var.h
===================================================================
--- sys/netinet6/mld6_var.h
+++ sys/netinet6/mld6_var.h
@@ -165,15 +165,16 @@
struct mld_ifsoftc *
mld_domifattach(struct ifnet *);
void mld_domifdetach(struct ifnet *);
-void mld_fasttimo(void);
void mld_ifdetach(struct ifnet *, struct in6_multi_head *);
int mld_input(struct mbuf **, int, int);
-void mld_slowtimo(void);
#ifdef SYSCTL_DECL
SYSCTL_DECL(_net_inet6_mld);
#endif
+#define PR_SLOWHZ 2 /* 2 slow timeouts per second */
+#define PR_FASTHZ 5 /* 5 fast timeouts per second */
+
#endif /* _KERNEL */
#endif /* _NETINET6_MLD6_VAR_H_ */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Mar 5, 6:16 PM (5 h, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29294545
Default Alt Text
D36161.id109249.diff (4 KB)
Attached To
Mode
D36161: mld6: use callout(9) directly instead of pr_slowtimo, pr_fasttimo
Attached
Detach File
Event Timeline
Log In to Comment