Date: Fri, 19 Sep 2008 18:28:21 GMT From: Marko Zec <zec@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 150131 for review Message-ID: <200809191828.m8JISLW5035326@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=150131 Change 150131 by zec@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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200809191828.m8JISLW5035326>