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
This commit is contained in:
bz 2019-11-13 11:21:02 +00:00
parent 2c7d9bf22f
commit 228fa8096b
2 changed files with 0 additions and 77 deletions

View File

@ -446,50 +446,6 @@ llentry_free(struct llentry *lle)
return (pkts_dropped);
}
/*
* (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.
*/
@ -534,34 +490,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.
* Used for userland interaction to remove

View File

@ -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 *);