diff options
author | glebius <glebius@FreeBSD.org> | 2014-02-14 10:56:26 +0000 |
---|---|---|
committer | glebius <glebius@FreeBSD.org> | 2014-02-14 10:56:26 +0000 |
commit | 959dc042beab1f46b18c2e3d9591df7de393d4cc (patch) | |
tree | 261c6872830b60868c0232747fdae185d76ee988 /usr.bin | |
parent | 1ea1d562a3cd9a58f90832eaff87d94ede9b5bfc (diff) | |
download | FreeBSD-src-959dc042beab1f46b18c2e3d9591df7de393d4cc.zip FreeBSD-src-959dc042beab1f46b18c2e3d9591df7de393d4cc.tar.gz |
Whenever flowtable lookup fails, we do route lookup and then try to
insert flow entry. During the route lookup the critical section is
exited. It may happen, that after route lookup we will be executed
on an other CPU that already has such flowentry. Before this change
we simply freed the flowentry and returned to ip_output() with
failure.
Actually there is nothing wrong with using previously allocated
flow entry, updating it properly. Thus, make flowentry_insert()
return the new either old fle, and make use of it.
Count reuses as "collisions" and real inserts as "inserts".
Reviewed by: adrian
Sponsored by: Netflix
Sponsored by: Nginx, Inc.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/netstat/flowtable.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/netstat/flowtable.c b/usr.bin/netstat/flowtable.c index fbacd12..a3d5dd5 100644 --- a/usr.bin/netstat/flowtable.c +++ b/usr.bin/netstat/flowtable.c @@ -52,10 +52,12 @@ print_stats(struct flowtable_stat *stat) p(ft_lookups, "\t%ju lookup%s\n"); p(ft_hits, "\t%ju hit%s\n"); p2(ft_misses, "\t%ju miss%s\n"); + p(ft_inserts, "\t%ju insert%s\n"); 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 Layer 2 address%s\n"); + p(ft_fail_lle_invalid, + "\t%ju lookup%s with not resolved Layer 2 address\n"); #undef p2 #undef p |