Author: melifaro
Date: Tue Aug 11 12:38:54 2015
New Revision: 286629
URL: https://svnweb.freebsd.org/changeset/base/286629

Log:
  Use single 'lle_timer' callout in lltable instead of
    two different names of the same timer.

Modified:
  head/sys/net/if_llatbl.c
  head/sys/net/if_llatbl.h
  head/sys/netinet/if_ether.c
  head/sys/netinet/in.c
  head/sys/netinet6/in6.c
  head/sys/netinet6/nd6.c

Modified: head/sys/net/if_llatbl.c
==============================================================================
--- head/sys/net/if_llatbl.c    Tue Aug 11 12:38:01 2015        (r286628)
+++ head/sys/net/if_llatbl.c    Tue Aug 11 12:38:54 2015        (r286629)
@@ -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

Modified: head/sys/net/if_llatbl.h
==============================================================================
--- head/sys/net/if_llatbl.h    Tue Aug 11 12:38:01 2015        (r286628)
+++ head/sys/net/if_llatbl.h    Tue Aug 11 12:38:54 2015        (r286629)
@@ -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,

Modified: head/sys/netinet/if_ether.c
==============================================================================
--- head/sys/netinet/if_ether.c Tue Aug 11 12:38:01 2015        (r286628)
+++ head/sys/netinet/if_ether.c Tue Aug 11 12:38:54 2015        (r286629)
@@ -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 @@ retry:
 
                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 @@ match:
 
                        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);

Modified: head/sys/netinet/in.c
==============================================================================
--- head/sys/netinet/in.c       Tue Aug 11 12:38:01 2015        (r286628)
+++ head/sys/netinet/in.c       Tue Aug 11 12:38:54 2015        (r286629)
@@ -996,7 +996,7 @@ in_lltable_new(struct in_addr addr4, u_i
        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 *ll
        }
 
        /* cancel timer */
-       if (callout_stop(&lle->la_timer))
+       if (callout_stop(&lle->lle_timer))
                LLE_REMREF(lle);
 
        /* Drop hold queue */

Modified: head/sys/netinet6/in6.c
==============================================================================
--- head/sys/netinet6/in6.c     Tue Aug 11 12:38:01 2015        (r286628)
+++ head/sys/netinet6/in6.c     Tue Aug 11 12:38:54 2015        (r286629)
@@ -2080,7 +2080,7 @@ in6_lltable_new(const struct in6_addr *a
        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 *l
                lltable_unlink_entry(llt, lle);
        }
 
-       if (callout_stop(&lle->la_timer))
+       if (callout_stop(&lle->lle_timer))
                LLE_REMREF(lle);
 
        llentry_free(lle);

Modified: head/sys/netinet6/nd6.c
==============================================================================
--- head/sys/netinet6/nd6.c     Tue Aug 11 12:38:01 2015        (r286628)
+++ head/sys/netinet6/nd6.c     Tue Aug 11 12:38:54 2015        (r286629)
@@ -492,17 +492,17 @@ nd6_llinfo_settimer_locked(struct llentr
        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
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to