PERFORCE change 150131 for review
Marko Zec
zec at FreeBSD.org
Fri Sep 19 18:28:21 UTC 2008
http://perforce.freebsd.org/chv.cgi?CH=150131
Change 150131 by zec at zec_tpx32 on 2008/09/19 18:27:48
Move multi-fib constant #defines from net/route.c to net/route.h
so that net/vnet.h can include instead of shadow them.
Affected files ...
.. //depot/projects/vimage-commit2/src/sys/net/route.c#11 edit
.. //depot/projects/vimage-commit2/src/sys/net/route.h#4 edit
.. //depot/projects/vimage-commit2/src/sys/net/vnet.h#2 edit
Differences ...
==== //depot/projects/vimage-commit2/src/sys/net/route.c#11 (text+ko) ====
@@ -63,26 +63,6 @@
#include <vm/uma.h>
-#ifndef ROUTETABLES
- #define RT_NUMFIBS 1
- #define RT_MAXFIBS 1
-#else
- /* while we use 4 bits in the mbuf flags,
- * we are limited to 16
- */
- #define RT_MAXFIBS 16
- #if ROUTETABLES > RT_MAXFIBS
- #define RT_NUMFIBS RT_MAXFIBS
- #error "ROUTETABLES defined too big"
- #else
- #if ROUTETABLES == 0
- #define RT_NUMFIBS 1
- #else
- #define RT_NUMFIBS ROUTETABLES
- #endif
- #endif
-#endif
-
u_int rt_numfibs = RT_NUMFIBS;
SYSCTL_INT(_net, OID_AUTO, fibs, CTLFLAG_RD, &rt_numfibs, 0, "");
/*
==== //depot/projects/vimage-commit2/src/sys/net/route.h#4 (text+ko) ====
@@ -82,6 +82,24 @@
#define RTM_RTTUNIT 1000000 /* units for rtt, rttvar, as units per sec */
#define RTTTOPRHZ(r) ((r) / (RTM_RTTUNIT / PR_SLOWHZ))
+#ifndef ROUTETABLES
+ #define RT_NUMFIBS 1
+ #define RT_MAXFIBS 1
+#else
+ /* while we use 4 bits in the mbuf flags, we are limited to 16 */
+ #define RT_MAXFIBS 16
+ #if ROUTETABLES > RT_MAXFIBS
+ #define RT_NUMFIBS RT_MAXFIBS
+ #error "ROUTETABLES defined too big"
+ #else
+ #if ROUTETABLES == 0
+ #define RT_NUMFIBS 1
+ #else
+ #define RT_NUMFIBS ROUTETABLES
+ #endif
+ #endif
+#endif
+
extern u_int rt_numfibs; /* number fo usable routing tables */
extern u_int tunnel_fib; /* tunnels use these */
extern u_int fwd_fib; /* packets being forwarded use these routes */
==== //depot/projects/vimage-commit2/src/sys/net/vnet.h#2 (text+ko) ====
@@ -31,7 +31,6 @@
#ifndef _NET_VNET_H_
#define _NET_VNET_H_
-
#ifdef VIMAGE
#include "opt_route.h"
@@ -44,14 +43,6 @@
#include <net/route.h>
#include <net/raw_cb.h>
-
-/* calculate this the same as in route.c */
-#ifndef ROUTETABLES
- #define RT_MAXFIBS 1
-#else
- #define RT_MAXFIBS 16
-#endif
-
struct vnet_net {
int _if_index;
struct ifindex_entry *_ifindex_table;
More information about the p4-projects
mailing list