1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-19 10:53:58 +00:00

Don't insert a flowtable entry if the lle isn't yet valid.

Some of the collisions that are occuring are due to flowtable lookups
that succeed but have an invalid lle - typically because the L2 adjacency
lookup hasn't completed.  This would lead to a follow-up insert which
would then fail (ie, collision) and the code would fall through to doing
a slow-path L2/L3 lookup in the netinet/netinet6 code.

This patch simply aborts storing a new flowtable entry if the lle isn't
yet valid.

Whilst I'm here, add a new pcpu counter for the item so the number of
failures can be tracked separately from generic "collisions."

Reviewed by:	glebius
MFC after:	10 days
Sponsored by:	Netflix, Inc.
This commit is contained in:
Adrian Chadd 2014-02-14 00:05:09 +00:00
parent 53c4471833
commit 0e778c88c9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=261859
3 changed files with 11 additions and 0 deletions

View File

@ -966,6 +966,15 @@ flowtable_lookup_common(struct flowtable *ft, struct sockaddr_storage *ssa,
RTFREE(rt);
return (NULL);
}
/* Don't insert the entry if the ARP hasn't yet finished resolving */
if ((lle->la_flags & LLE_VALID) == 0) {
RTFREE(rt);
LLE_FREE(lle);
FLOWSTAT_INC(ft, ft_fail_lle_invalid);
return (NULL);
}
ro->ro_lle = lle;
if (flowtable_insert(ft, hash, key, fibnum, ro, flags) != 0) {

View File

@ -39,6 +39,7 @@ struct flowtable_stat {
uint64_t ft_frees;
uint64_t ft_hits;
uint64_t ft_lookups;
uint64_t ft_fail_lle_invalid;
};
#ifdef _KERNEL

View File

@ -55,6 +55,7 @@ print_stats(struct flowtable_stat *stat)
p(ft_collisions, "\t%ju collision%s\n");
p(ft_free_checks, "\t%ju free check%s\n");
p(ft_frees, "\t%ju free%s\n");
p(ft_fail_lle_invalid, "\t%ju lookups w/ no resolved ARP%s\n");
#undef p2
#undef p