Use single 'lle_timer' callout in lltable instead of

two different names of the same timer.
This commit is contained in:
Alexander V. Chernikov 2015-08-11 12:38:54 +00:00
parent 3caed89878
commit 0447c1367a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=286629
6 changed files with 15 additions and 22 deletions

View File

@ -374,7 +374,7 @@ lltable_free(struct lltable *llt)
IF_AFDATA_WUNLOCK(llt->llt_ifp);
LIST_FOREACH_SAFE(lle, &dchain, lle_chain, next) {
if (callout_stop(&lle->la_timer))
if (callout_stop(&lle->lle_timer))
LLE_REMREF(lle);
llentry_free(lle);
}
@ -656,7 +656,7 @@ llatbl_lle_show(struct llentry_sa *la)
bcopy(&lle->ll_addr.mac16, octet, sizeof(octet));
db_printf(" ll_addr=%02x:%02x:%02x:%02x:%02x:%02x\n",
octet[0], octet[1], octet[2], octet[3], octet[4], octet[5]);
db_printf(" la_timer=%p\n", &lle->la_timer);
db_printf(" lle_timer=%p\n", &lle->lle_timer);
switch (la->l3_addr.sa_family) {
#ifdef INET

View File

@ -82,11 +82,7 @@ struct llentry {
int lle_refcnt;
LIST_ENTRY(llentry) lle_chain; /* chain of deleted items */
/* XXX af-private? */
union {
struct callout ln_timer_ch;
struct callout la_timer;
} lle_timer;
struct callout lle_timer;
struct rwlock lle_lock;
};
@ -135,9 +131,6 @@ struct llentry {
} while (0)
#define ln_timer_ch lle_timer.ln_timer_ch
#define la_timer lle_timer.la_timer
typedef struct llentry *(llt_lookup_t)(struct lltable *, u_int flags,
const struct sockaddr *l3addr);
typedef struct llentry *(llt_create_t)(struct lltable *, u_int flags,

View File

@ -170,7 +170,7 @@ arptimer(void *arg)
return;
}
LLE_WLOCK(lle);
if (callout_pending(&lle->la_timer)) {
if (callout_pending(&lle->lle_timer)) {
/*
* Here we are a bit odd here in the treatment of
* active/pending. If the pending bit is set, it got
@ -202,7 +202,7 @@ arptimer(void *arg)
EVENTHANDLER_INVOKE(lle_event, lle, evt);
}
callout_stop(&lle->la_timer);
callout_stop(&lle->lle_timer);
/* XXX: LOR avoidance. We still have ref on lle. */
LLE_WUNLOCK(lle);
@ -453,7 +453,7 @@ arpresolve(struct ifnet *ifp, int is_gw, struct mbuf *m,
LLE_ADDREF(la);
la->la_expire = time_uptime;
canceled = callout_reset(&la->la_timer, hz * V_arpt_down,
canceled = callout_reset(&la->lle_timer, hz * V_arpt_down,
arptimer, la);
if (canceled)
LLE_REMREF(la);
@ -793,7 +793,7 @@ in_arpinput(struct mbuf *m)
LLE_ADDREF(la);
la->la_expire = time_uptime + V_arpt_keep;
canceled = callout_reset(&la->la_timer,
canceled = callout_reset(&la->lle_timer,
hz * V_arpt_keep, arptimer, la);
if (canceled)
LLE_REMREF(la);

View File

@ -996,7 +996,7 @@ in_lltable_new(struct in_addr addr4, u_int flags)
lle->base.lle_refcnt = 1;
lle->base.lle_free = in_lltable_destroy_lle;
LLE_LOCK_INIT(&lle->base);
callout_init(&lle->base.la_timer, 1);
callout_init(&lle->base.lle_timer, 1);
return (&lle->base);
}
@ -1039,7 +1039,7 @@ in_lltable_free_entry(struct lltable *llt, struct llentry *lle)
}
/* cancel timer */
if (callout_stop(&lle->la_timer))
if (callout_stop(&lle->lle_timer))
LLE_REMREF(lle);
/* Drop hold queue */

View File

@ -2080,7 +2080,7 @@ in6_lltable_new(const struct in6_addr *addr6, u_int flags)
lle->base.lle_refcnt = 1;
lle->base.lle_free = in6_lltable_destroy_lle;
LLE_LOCK_INIT(&lle->base);
callout_init(&lle->base.ln_timer_ch, 1);
callout_init(&lle->base.lle_timer, 1);
return (&lle->base);
}
@ -2116,7 +2116,7 @@ in6_lltable_free_entry(struct lltable *llt, struct llentry *lle)
lltable_unlink_entry(llt, lle);
}
if (callout_stop(&lle->la_timer))
if (callout_stop(&lle->lle_timer))
LLE_REMREF(lle);
llentry_free(lle);

View File

@ -492,17 +492,17 @@ nd6_llinfo_settimer_locked(struct llentry *ln, long tick)
if (tick < 0) {
ln->la_expire = 0;
ln->ln_ntick = 0;
canceled = callout_stop(&ln->ln_timer_ch);
canceled = callout_stop(&ln->lle_timer);
} else {
ln->la_expire = time_uptime + tick / hz;
LLE_ADDREF(ln);
if (tick > INT_MAX) {
ln->ln_ntick = tick - INT_MAX;
canceled = callout_reset(&ln->ln_timer_ch, INT_MAX,
canceled = callout_reset(&ln->lle_timer, INT_MAX,
nd6_llinfo_timer, ln);
} else {
ln->ln_ntick = 0;
canceled = callout_reset(&ln->ln_timer_ch, tick,
canceled = callout_reset(&ln->lle_timer, tick,
nd6_llinfo_timer, ln);
}
}
@ -530,7 +530,7 @@ nd6_llinfo_timer(void *arg)
KASSERT(arg != NULL, ("%s: arg NULL", __func__));
ln = (struct llentry *)arg;
LLE_WLOCK(ln);
if (callout_pending(&ln->la_timer)) {
if (callout_pending(&ln->lle_timer)) {
/*
* Here we are a bit odd here in the treatment of
* active/pending. If the pending bit is set, it got