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:
parent
7951fbc23d
commit
8b5f9bb755
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=354679
@ -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
|
||||
|
@ -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 *);
|
||||
|
Loading…
Reference in New Issue
Block a user