Move the kernel option FLOWTABLE chacking from the header file to the
actual implementation. Remove the accessor functions for the compiled out case, just returning "unavail" values. Remove the kernel conditional from the header file as it is no longer needed, only leaving the externs. Hide the improperly virtualized SYSCTL/TUNABLE for the flowtable size under the kernel option as well. Reviewed by: rwatson
This commit is contained in:
parent
4650ad4cc0
commit
53be8fca00
@ -41,7 +41,6 @@ struct flowtable;
|
||||
extern struct flowtable *ip_ft;
|
||||
extern struct flowtable *ip_forward_ft;
|
||||
|
||||
#ifdef FLOWTABLE
|
||||
struct flowtable *flowtable_alloc(int nentry, int flags);
|
||||
|
||||
/*
|
||||
@ -52,22 +51,6 @@ struct flowtable *flowtable_alloc(int nentry, int flags);
|
||||
int flowtable_lookup(struct flowtable *ft, struct mbuf *m,
|
||||
struct route *ro);
|
||||
|
||||
#else
|
||||
static __inline struct flowtable *
|
||||
flowtable_alloc(int nentry, int flags)
|
||||
{
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
static __inline int
|
||||
flowtable_lookup(struct flowtable *ft, struct mbuf *m,
|
||||
struct route *ro)
|
||||
{
|
||||
|
||||
return (ENOTSUP);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -206,16 +206,19 @@ SYSCTL_INT(_net_inet_ip, IPCTL_DEFMTU, mtu, CTLFLAG_RW,
|
||||
SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_ip, OID_AUTO, stealth, CTLFLAG_RW,
|
||||
ipstealth, 0, "IP stealth mode, no TTL decrementation on forwarding");
|
||||
#endif
|
||||
#ifdef FLOWTABLE
|
||||
static int ip_output_flowtable_size = 2048;
|
||||
TUNABLE_INT("net.inet.ip.output_flowtable_size", &ip_output_flowtable_size);
|
||||
SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_ip, OID_AUTO, output_flowtable_size,
|
||||
CTLFLAG_RDTUN, ip_output_flowtable_size, 2048,
|
||||
"number of entries in the per-cpu output flow caches");
|
||||
|
||||
struct flowtable *ip_ft;
|
||||
#endif
|
||||
|
||||
#ifdef VIMAGE_GLOBALS
|
||||
int fw_one_pass;
|
||||
#endif
|
||||
struct flowtable *ip_ft;
|
||||
|
||||
static void ip_freef(struct ipqhead *, struct ipq *);
|
||||
|
||||
@ -374,7 +377,9 @@ ip_init(void)
|
||||
/* Initialize various other remaining things. */
|
||||
IPQ_LOCK_INIT();
|
||||
netisr_register(&ip_nh);
|
||||
#ifdef FLOWTABLE
|
||||
ip_ft = flowtable_alloc(ip_output_flowtable_size, FL_PCPU);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -155,6 +155,7 @@ ip_output(struct mbuf *m, struct mbuf *opt, struct route *ro, int flags,
|
||||
ro = &iproute;
|
||||
bzero(ro, sizeof (*ro));
|
||||
|
||||
#ifdef FLOWTABLE
|
||||
/*
|
||||
* The flow table returns route entries valid for up to 30
|
||||
* seconds; we rely on the remainder of ip_output() taking no
|
||||
@ -163,6 +164,7 @@ ip_output(struct mbuf *m, struct mbuf *opt, struct route *ro, int flags,
|
||||
*/
|
||||
if (flowtable_lookup(ip_ft, m, ro) == 0)
|
||||
nortfree = 1;
|
||||
#endif
|
||||
}
|
||||
|
||||
if (opt) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user