Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F151155658
D23047.id66395.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
6 KB
Referenced Files
None
Subscribers
None
D23047.id66395.diff
View Options
Index: sys/net/radix_mpath.h
===================================================================
--- sys/net/radix_mpath.h
+++ sys/net/radix_mpath.h
@@ -57,8 +57,8 @@
void rtalloc_mpath_fib(struct route *, u_int32_t, u_int);
struct rtentry *rt_mpath_select(struct rtentry *, uint32_t);
int rt_mpath_deldup(struct rtentry *, struct rtentry *);
-int rn4_mpath_inithead(void **, int);
-int rn6_mpath_inithead(void **, int);
+int rn4_mpath_inithead(void **, int, u_int);
+int rn6_mpath_inithead(void **, int, u_int);
#endif
Index: sys/net/radix_mpath.c
===================================================================
--- sys/net/radix_mpath.c
+++ sys/net/radix_mpath.c
@@ -290,17 +290,17 @@
RT_UNLOCK(ro->ro_rt);
}
-extern int in6_inithead(void **head, int off);
-extern int in_inithead(void **head, int off);
+extern int in6_inithead(void **head, int off, u_int fibnum);
+extern int in_inithead(void **head, int off, u_int fibnum);
#ifdef INET
int
-rn4_mpath_inithead(void **head, int off)
+rn4_mpath_inithead(void **head, int off, u_int fibnum)
{
struct rib_head *rnh;
hashjitter = arc4random();
- if (in_inithead(head, off) == 1) {
+ if (in_inithead(head, off, fibnum) == 1) {
rnh = (struct rib_head *)*head;
rnh->rnh_multipath = 1;
return 1;
@@ -311,12 +311,12 @@
#ifdef INET6
int
-rn6_mpath_inithead(void **head, int off)
+rn6_mpath_inithead(void **head, int off, u_int fibnum)
{
struct rib_head *rnh;
hashjitter = arc4random();
- if (in6_inithead(head, off) == 1) {
+ if (in6_inithead(head, off, fibnum) == 1) {
rnh = (struct rib_head *)*head;
rnh->rnh_multipath = 1;
return 1;
Index: sys/net/route.h
===================================================================
--- sys/net/route.h
+++ sys/net/route.h
@@ -455,7 +455,7 @@
void rt_newmaddrmsg(int, struct ifmultiaddr *);
int rt_setgate(struct rtentry *, struct sockaddr *, struct sockaddr *);
void rt_maskedcopy(struct sockaddr *, struct sockaddr *, struct sockaddr *);
-struct rib_head *rt_table_init(int);
+struct rib_head *rt_table_init(int, int, u_int);
void rt_table_destroy(struct rib_head *);
u_int rt_tables_get_gen(int table, int fam);
Index: sys/net/route.c
===================================================================
--- sys/net/route.c
+++ sys/net/route.c
@@ -304,7 +304,7 @@
rnh = rt_tables_get_rnh_ptr(table, fam);
if (rnh == NULL)
panic("%s: rnh NULL", __func__);
- dom->dom_rtattach((void **)rnh, 0);
+ dom->dom_rtattach((void **)rnh, 0, table);
}
}
}
@@ -345,7 +345,7 @@
#endif
struct rib_head *
-rt_table_init(int offset)
+rt_table_init(int offset, int family, u_int fibnum)
{
struct rib_head *rh;
@@ -357,8 +357,16 @@
rn_inithead_internal(&rh->rmhead.head, rh->rmhead.mask_nodes, 0);
rh->head.rnh_masks = &rh->rmhead;
+ /* Save metadata associated with this routing table. */
+ rh->rib_family = family;
+ rh->rib_fibnum = fibnum;
+#ifdef VIMAGE
+ rh->rib_vnet = curvnet;
+#endif
+
/* Init locks */
RIB_LOCK_INIT(rh);
+
/* Finally, set base callbacks */
rh->rnh_addaddr = rn_addroute;
Index: sys/net/route_var.h
===================================================================
--- sys/net/route_var.h
+++ sys/net/route_var.h
@@ -46,6 +46,11 @@
struct radix_node rnh_nodes[3]; /* empty tree for common case */
struct rmlock rib_lock; /* config/data path lock */
struct radix_mask_head rmhead; /* masks radix head */
+ struct vnet *rib_vnet; /* vnet pointer */
+ int rib_family; /* AF of the rtable */
+ u_int rib_fibnum; /* tableid */
+ struct callout expire_callout; /* Callout for expiring dynamic routes */
+ time_t next_expire; /* Next expire run ts */
};
#define RIB_RLOCK_TRACKER struct rm_priotracker _rib_tracker
Index: sys/netinet/in_proto.c
===================================================================
--- sys/netinet/in_proto.c
+++ sys/netinet/in_proto.c
@@ -297,7 +297,7 @@
},
};
-extern int in_inithead(void **, int);
+extern int in_inithead(void **, int, u_int);
extern int in_detachhead(void **, int);
struct domain inetdomain = {
Index: sys/netinet/in_rmx.c
===================================================================
--- sys/netinet/in_rmx.c
+++ sys/netinet/in_rmx.c
@@ -49,7 +49,7 @@
#include <netinet/ip_icmp.h>
#include <netinet/ip_var.h>
-extern int in_inithead(void **head, int off);
+extern int in_inithead(void **head, int off, u_int fibnum);
#ifdef VIMAGE
extern int in_detachhead(void **head, int off);
#endif
@@ -116,11 +116,11 @@
* Initialize our routing tree.
*/
int
-in_inithead(void **head, int off)
+in_inithead(void **head, int off, u_int fibnum)
{
struct rib_head *rh;
- rh = rt_table_init(32);
+ rh = rt_table_init(32, AF_INET, fibnum);
if (rh == NULL)
return (0);
Index: sys/netinet6/in6_proto.c
===================================================================
--- sys/netinet6/in6_proto.c
+++ sys/netinet6/in6_proto.c
@@ -336,7 +336,7 @@
},
};
-extern int in6_inithead(void **, int);
+extern int in6_inithead(void **, int, u_int);
#ifdef VIMAGE
extern int in6_detachhead(void **, int);
#endif
Index: sys/netinet6/in6_rmx.c
===================================================================
--- sys/netinet6/in6_rmx.c
+++ sys/netinet6/in6_rmx.c
@@ -96,7 +96,7 @@
#include <netinet/tcp_timer.h>
#include <netinet/tcp_var.h>
-extern int in6_inithead(void **head, int off);
+extern int in6_inithead(void **head, int off, u_int fibnum);
#ifdef VIMAGE
extern int in6_detachhead(void **head, int off);
#endif
@@ -157,11 +157,12 @@
*/
int
-in6_inithead(void **head, int off)
+in6_inithead(void **head, int off, u_int fibnum)
{
struct rib_head *rh;
- rh = rt_table_init(offsetof(struct sockaddr_in6, sin6_addr) << 3);
+ rh = rt_table_init(offsetof(struct sockaddr_in6, sin6_addr) << 3,
+ AF_INET6, fibnum);
if (rh == NULL)
return (0);
Index: sys/sys/domain.h
===================================================================
--- sys/sys/domain.h
+++ sys/sys/domain.h
@@ -60,7 +60,7 @@
struct protosw *dom_protosw, *dom_protoswNPROTOSW;
struct domain *dom_next;
int (*dom_rtattach) /* initialize routing table */
- (void **, int);
+ (void **, int, u_int);
int (*dom_rtdetach) /* clean up routing table */
(void **, int);
void *(*dom_ifattach)(struct ifnet *);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Apr 7, 11:45 AM (12 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31028570
Default Alt Text
D23047.id66395.diff (6 KB)
Attached To
Mode
D23047: Add fibnum, family and vnet pointer to each rib head.
Attached
Detach File
Event Timeline
Log In to Comment