PERFORCE change 164850 for review

Marko Zec zec at FreeBSD.org
Mon Jun 22 13:04:25 UTC 2009


http://perforce.freebsd.org/chv.cgi?CH=164850

Change 164850 by zec at zec_amdx4 on 2009/06/22 13:03:35

	Catch up with flowtable globals in sys/netinet.
	Pointed out by:	bz

Affected files ...

.. //depot/projects/vimage-commit2/src/sys/net/flowtable.h#6 edit
.. //depot/projects/vimage-commit2/src/sys/netinet/ip_input.c#44 edit
.. //depot/projects/vimage-commit2/src/sys/netinet/ip_output.c#32 edit
.. //depot/projects/vimage-commit2/src/sys/netinet/vinet.h#34 edit

Differences ...

==== //depot/projects/vimage-commit2/src/sys/net/flowtable.h#6 (text+ko) ====

@@ -38,7 +38,9 @@
 #define	FL_PCPU		(1<<1)	/* pcpu cache */
 
 struct flowtable;
+#ifdef VIMAGE_GLOBALS
 extern struct flowtable *ip_ft;
+#endif
 
 struct flowtable *flowtable_alloc(int nentry, int flags);
 

==== //depot/projects/vimage-commit2/src/sys/netinet/ip_input.c#44 (text+ko) ====

@@ -207,13 +207,13 @@
     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);
+#ifdef VIMAGE_GLOBALS
+static int ip_output_flowtable_size;
+struct flowtable *ip_ft;
+#endif
 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
@@ -335,6 +335,13 @@
 	    NULL, UMA_ALIGN_PTR, 0);
 	maxnipq_update();
 
+#ifdef FLOWTABLE
+	TUNABLE_INT_FETCH("net.inet.ip.output_flowtable_size",
+	    &V_ip_output_flowtable_size);
+	V_ip_output_flowtable_size = 2048;
+	V_ip_ft = flowtable_alloc(V_ip_output_flowtable_size, FL_PCPU);
+#endif
+
 	/* Skip initialization of globals for non-default instances. */
 	if (!IS_DEFAULT_VNET(curvnet))
 		return;
@@ -377,9 +384,6 @@
 	/* 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

==== //depot/projects/vimage-commit2/src/sys/netinet/ip_output.c#32 (text+ko) ====

@@ -162,7 +162,7 @@
 		 * longer than that long for the stability of ro_rt.  The
 		 * flow ID assignment must have happened before this point.
 		 */
-		if (flowtable_lookup(ip_ft, m, ro) == 0)
+		if (flowtable_lookup(V_ip_ft, m, ro) == 0)
 			nortfree = 1;
 #endif
 	}

==== //depot/projects/vimage-commit2/src/sys/netinet/vinet.h#34 (text+ko) ====

@@ -212,6 +212,8 @@
 	int			_icmpbmcastecho;
 
 	int			_fw_one_pass;
+
+	struct flowtable *	_ip_ft;
 };
 
 /* Size guard. See sys/vimage.h. */
@@ -272,9 +274,11 @@
 #define	V_ip_checkinterface	VNET_INET(ip_checkinterface)
 #define	V_ip_defttl		VNET_INET(ip_defttl)
 #define	V_ip_do_randomid	VNET_INET(ip_do_randomid)
+#define	V_ip_ft			VNET_INET(ip_ft)
 #define	V_ip_id			VNET_INET(ip_id)
 #define	V_ip_keepfaith		VNET_INET(ip_keepfaith)
 #define	V_ip_mrouter		VNET_INET(ip_mrouter)
+#define	V_ip_output_flowtable_size VNET_INET(ip_output_flowtable_size)
 #define	V_ip_rsvp_on		VNET_INET(ip_rsvp_on)
 #define	V_ip_rsvpd		VNET_INET(ip_rsvpd)
 #define	V_ip_sendsourcequench	VNET_INET(ip_sendsourcequench)


More information about the p4-projects mailing list