Page MenuHomeFreeBSD

Add fibnum, family and vnet pointer to each rib head.
ClosedPublic

Authored by melifaro on Jan 6 2020, 12:01 AM.

Details

Summary

Having metadata such as fibnum or vnet in the struct rib_head is handy as it eases building functionality in the routing space.
The first customer of this proposed change are route redirects.
More upcoming changes in the routing stack would benefit from having these fields.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

melifaro created this revision.Jan 6 2020, 12:01 AM
melifaro edited the summary of this revision. (Show Details)Jan 6 2020, 12:03 AM
melifaro updated this revision to Diff 66396.Jan 6 2020, 12:06 AM

Remove forgotten fields from rib_head.

bz accepted this revision.Jan 9 2020, 1:07 PM

Thank you so much for splitting this out. It really helps a lot! спасибо большой!

I assume this will not be MFCed due to KPI change?

sys/net/route.c
369 ↗(On Diff #66396)

Unrelated blank line.

sys/net/route_var.h
51 ↗(On Diff #66396)

I think tableid could be misleading as it is not a unique ID; there might be multiple tables with the same ID. Maybe just calling it FIB is enough?

This revision is now accepted and ready to land.Jan 9 2020, 1:07 PM
In D23047#506342, @bz wrote:

Thank you so much for splitting this out. It really helps a lot! спасибо большой!

Thank you for reviewing this!

I assume this will not be MFCed due to KPI change?

Well, actually I thought of MFC'ing the version which would keep dom_rtattach() and other functions the same, while filling in rib_family and rib_fibnum directly in the vnet_route_init() after call to the dom_rtattach().
Do you have any concerns about this?

sys/net/route_var.h
51 ↗(On Diff #66396)

Naming is hard :-) yep, will rename to fib number.

bz added a comment.Jan 9 2020, 4:10 PM

The AF can be set in in6_inithead() already but I understand if you want to do all in the callers together; sounds like a good compromise for an MFC :-) Thanks!

This revision was automatically updated to reflect the committed changes.
melifaro marked an inline comment as done.Jan 9 2020, 5:22 PM