Page MenuHomeFreeBSD

Make net.fibs growable
ClosedPublic

Authored by melifaro on Aug 14 2020, 8:00 AM.

Details

Reviewers
glebius
ae
bz
Group Reviewers
network
Commits
rS364465: Make net.fibs growable.
Summary

Allow to dynamically grow the amount of fibs in each vnet.

This change alters current behaviour: currently, if one defines ROUTETABLES > 1 in the kernel config, each vnet will be created with the number of fibs defined in the kernel config. This change sets default number of fibs in the vnet to be always 1.

Dynamic net.fibs is not compatible with net.add_addr_allfibs. The plan is to deprecate the latter and make the net.add_addr_allfibs=0 default behaviour.

Next steps:

  • Update rt_numfibs to V_rt_numfibs (60 occasions).
  • Add interface fib handler, similar to vnet fib handler
  • Deprecate net.add_addr_allfibs
Test Plan
8:53 [0] m@current s sysctl net.fibs=2
net.fibs: 1 -> 2
8:54 [0] m@current setfib 1 netstat -rn
Routing tables (fib: 1)
8:54 [0] m@current s ifconfig vlan2 create vlan 2 vlandev em0 fib 1
8:54 [0] m@current
8:54 [0] m@current s ifconfig vlan2
vlan2: flags=8842<BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
	options=4000003<RXCSUM,TXCSUM,NOMAP>
	ether 00:0c:29:4b:db:9c
	groups: vlan
	vlan: 2 vlanpcp: 0 parent interface: em0
	fib: 1
	media: Ethernet autoselect (1000baseT <full-duplex>)
	status: active
	nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
8:54 [0] m@current s ifconfig vlan2 inet 1.2.3.4/29
8:54 [0] m@current s ifconfig vlan2 inet6 2a02:6b8::1/120
8:54 [0] m@current setfib 1 netstat -rn
Routing tables (fib: 1)

Internet:
Destination        Gateway            Flags     Netif Expire
1.2.3.0/29         link#5             U         vlan2
1.2.3.4            link#4             UHS         lo0

Internet6:
Destination                       Gateway                       Flags     Netif Expire
2a02:6b8::/120                    link#5                        U         vlan2
2a02:6b8::1                       link#4                        UHS         lo0
fe80::%vlan2/64                   link#5                        U         vlan2
fe80::20c:29ff:fe4b:db9c%vlan2    link#4                        UHS         lo0

Diff Detail

Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 33009
Build 30397: arc lint + arc unit

Event Timeline

melifaro edited the test plan for this revision. (Show Details)
melifaro added reviewers: network, glebius, ae.
melifaro edited the summary of this revision. (Show Details)
melifaro added a reviewer: bz.
melifaro edited the summary of this revision. (Show Details)

Update diff to address comments and fix vnet behaviour.

Update functions parameters.

I intend to commit this on Friday, Aug 21 unless there are any objections.

glebius added inline comments.
sys/net/route/route_tables.c
182

Unlikely we will ever allocate a huge number of fibs on a 32bit machine, but just to be safer makes sense to use mallocarray() here.

This revision is now accepted and ready to land.Aug 19 2020, 7:44 PM
This revision was automatically updated to reflect the committed changes.