Author: bz
Date: Wed Nov 13 11:21:02 2019
New Revision: 354679
URL: https://svnweb.freebsd.org/changeset/base/354679

Log:
  lltabl: remove dead code
  
  Remove the long (8? years ago) #if 0 marked function lltable_drain() and
  while here also remove the unused function llentry_alloc() which has call
  paths tools keep finding and are never used.
  
  Sponsored by: Netflix

Modified:
  head/sys/net/if_llatbl.c
  head/sys/net/if_llatbl.h

Modified: head/sys/net/if_llatbl.c
==============================================================================
--- head/sys/net/if_llatbl.c    Wed Nov 13 10:08:45 2019        (r354678)
+++ head/sys/net/if_llatbl.c    Wed Nov 13 11:21:02 2019        (r354679)
@@ -447,50 +447,6 @@ llentry_free(struct llentry *lle)
 }
 
 /*
- * (al)locate an llentry for address dst (equivalent to rtalloc for new-arp).
- *
- * If found the llentry * is returned referenced and unlocked.
- */
-struct llentry *
-llentry_alloc(struct ifnet *ifp, struct lltable *lt,
-    struct sockaddr_storage *dst)
-{
-       struct epoch_tracker et;
-       struct llentry *la, *la_tmp;
-
-       NET_EPOCH_ENTER(et);
-       la = lla_lookup(lt, LLE_EXCLUSIVE, (struct sockaddr *)dst);
-       NET_EPOCH_EXIT(et);
-
-       if (la != NULL) {
-               LLE_ADDREF(la);
-               LLE_WUNLOCK(la);
-               return (la);
-       }
-
-       if ((ifp->if_flags & (IFF_NOARP | IFF_STATICARP)) == 0) {
-               la = lltable_alloc_entry(lt, 0, (struct sockaddr *)dst);
-               if (la == NULL)
-                       return (NULL);
-               IF_AFDATA_WLOCK(ifp);
-               LLE_WLOCK(la);
-               /* Prefer any existing LLE over newly-created one */
-               la_tmp = lla_lookup(lt, LLE_EXCLUSIVE, (struct sockaddr *)dst);
-               if (la_tmp == NULL)
-                       lltable_link_entry(lt, la);
-               IF_AFDATA_WUNLOCK(ifp);
-               if (la_tmp != NULL) {
-                       lltable_free_entry(lt, la);
-                       la = la_tmp;
-               }
-               LLE_ADDREF(la);
-               LLE_WUNLOCK(la);
-       }
-
-       return (la);
-}
-
-/*
  * Free all entries from given table and free itself.
  */
 
@@ -533,34 +489,6 @@ lltable_free(struct lltable *llt)
 
        llt->llt_free_tbl(llt);
 }
-
-#if 0
-void
-lltable_drain(int af)
-{
-       struct lltable  *llt;
-       struct llentry  *lle;
-       int i;
-
-       LLTABLE_LIST_RLOCK();
-       SLIST_FOREACH(llt, &V_lltables, llt_link) {
-               if (llt->llt_af != af)
-                       continue;
-
-               for (i=0; i < llt->llt_hsize; i++) {
-                       CK_LIST_FOREACH(lle, &llt->lle_head[i], lle_next) {
-                               LLE_WLOCK(lle);
-                               if (lle->la_hold) {
-                                       m_freem(lle->la_hold);
-                                       lle->la_hold = NULL;
-                               }
-                               LLE_WUNLOCK(lle);
-                       }
-               }
-       }
-       LLTABLE_LIST_RUNLOCK();
-}
-#endif
 
 /*
  * Deletes an address from given lltable.

Modified: head/sys/net/if_llatbl.h
==============================================================================
--- head/sys/net/if_llatbl.h    Wed Nov 13 10:08:45 2019        (r354678)
+++ head/sys/net/if_llatbl.h    Wed Nov 13 11:21:02 2019        (r354679)
@@ -211,14 +211,9 @@ void               lltable_free(struct lltable *);
 void           lltable_link(struct lltable *llt);
 void           lltable_prefix_free(int, struct sockaddr *,
                    struct sockaddr *, u_int);
-#if 0
-void           lltable_drain(int);
-#endif
 int            lltable_sysctl_dumparp(int, struct sysctl_req *);
 
 size_t         llentry_free(struct llentry *);
-struct llentry  *llentry_alloc(struct ifnet *, struct lltable *,
-                   struct sockaddr_storage *);
 
 /* helper functions */
 size_t lltable_drop_entry_queue(struct llentry *);
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to