diff options
author | Kip Macy <kmacy@FreeBSD.org> | 2010-03-12 05:03:26 +0000 |
---|---|---|
committer | Kip Macy <kmacy@FreeBSD.org> | 2010-03-12 05:03:26 +0000 |
commit | d4121a02c07b16cd4d5534e04a1277f98e5744bd (patch) | |
tree | 892d80f823d6c6d886b13b8b52823bc01f00c33f /sys/net/flowtable.h | |
parent | 2200b28e5f60866ea8f537ff8f0cf2b0e3b49844 (diff) |
- restructure flowtable to support ipv6
- add a name argument to flowtable_alloc for printing with ddb commands
- extend ddb commands to print destination address or 4-tuples
- don't parse ports in ulp header if FL_HASH_ALL is not passed
- add kern_flowtable_insert to enable more generic use of flowtable
(e.g. system calls for adding entries)
- don't hash loopback addresses
- cleanup whitespace
- keep statistics per-cpu for per-cpu flowtables to avoid cache line contention
- add sysctls to accumulate stats and report aggregate
MFC after: 7 days
Notes
Notes:
svn path=/head/; revision=205066
Diffstat (limited to 'sys/net/flowtable.h')
-rw-r--r-- | sys/net/flowtable.h | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/sys/net/flowtable.h b/sys/net/flowtable.h index 7d7abdfad15b..6e79a3cfe93a 100644 --- a/sys/net/flowtable.h +++ b/sys/net/flowtable.h @@ -1,6 +1,6 @@ /************************************************************************** -Copyright (c) 2008-2009, BitGravity Inc. +Copyright (c) 2008-2010, BitGravity Inc. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -34,24 +34,49 @@ $FreeBSD$ #ifdef _KERNEL -#define FL_HASH_PORTS (1<<0) /* hash 4-tuple + protocol */ +#define FL_HASH_ALL (1<<0) /* hash 4-tuple + protocol */ #define FL_PCPU (1<<1) /* pcpu cache */ +#define FL_NOAUTO (1<<2) /* don't automatically add flentry on miss */ + +#define FL_TCP (1<<11) +#define FL_SCTP (1<<12) +#define FL_UDP (1<<13) +#define FL_DEBUG (1<<14) +#define FL_DEBUG_ALL (1<<15) struct flowtable; +struct flentry; +struct route; +struct route_in6; + VNET_DECLARE(struct flowtable *, ip_ft); #define V_ip_ft VNET(ip_ft) -struct flowtable *flowtable_alloc(int nentry, int flags); +VNET_DECLARE(struct flowtable *, ip6_ft); +#define V_ip6_ft VNET(ip6_ft) + +struct flowtable *flowtable_alloc(char *name, int nentry, int flags); /* * Given a flow table, look up the L3 and L2 information and * return it in the route. * */ -int flowtable_lookup(struct flowtable *ft, struct mbuf *m, - struct route *ro, uint32_t fibnum); +struct flentry *flowtable_lookup_mbuf(struct flowtable *ft, struct mbuf *m, int af); + +struct flentry *flowtable_lookup(struct flowtable *ft, struct sockaddr_storage *ssa, + struct sockaddr_storage *dsa, uint32_t fibnum, int flags); +int kern_flowtable_insert(struct flowtable *ft, struct sockaddr_storage *ssa, + struct sockaddr_storage *dsa, struct route *ro, uint32_t fibnum, int flags); + +void flow_invalidate(struct flentry *fl); void flowtable_route_flush(struct flowtable *ft, struct rtentry *rt); +void flow_to_route(struct flentry *fl, struct route *ro); + +void flow_to_route_in6(struct flentry *fl, struct route_in6 *ro); + + #endif /* _KERNEL */ #endif |