Page MenuHomeFreeBSD

routing: Implement merge of nhgrp in new multipath route
AcceptedPublic

Authored by pouria on Tue, Mar 31, 4:08 PM.
Tags
None
Referenced Files
F152469873: D56187.id174691.diff
Wed, Apr 15, 4:05 AM
F152411984: D56187.id174671.diff
Tue, Apr 14, 7:36 PM
Unknown Object (File)
Sun, Apr 12, 11:33 AM
Unknown Object (File)
Sat, Apr 11, 9:34 PM
Unknown Object (File)
Sat, Apr 11, 8:06 PM
Unknown Object (File)
Sat, Apr 11, 5:42 PM
Unknown Object (File)
Sat, Apr 11, 5:41 PM
Unknown Object (File)
Sat, Apr 11, 2:16 PM
Subscribers

Details

Reviewers
kp
markj
glebius
zlei
melifaro
ae
Group Reviewers
network
Summary

Routing subsystem allows creating new multipath routes by
nexthop groups (e.g RTA_MULTIPATH in netlink), in case of
a second nexthop group on the same route, don't panic and
merge the existing nhgrp with new one.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 71876
Build 68759: arc lint + arc unit

Event Timeline

For tests, see D56190.

sys/net/route/nhgrp_ctl.c
836–838

For reviewers, it's meaningless to reference nhops of an nhgrp here like above. Therefore, I didn't.

843–845

For reviewers, don't worry about the reverse order here, it will eventually sorted by qsort.

For reviewers: this patch also fixes a panic caused by an incorrect assumption in nhgrp_get_addition_group().
That function assumes rnd->rnd_nhop is not an nhgrp_object, therefore sending two or more RTA_MULTIPATH attributes can trigger a panic.

This comment was removed by pouria.
sys/net/route/nhgrp_ctl.c
662

The parenthesis around sizeof() are superfluous.

pouria marked an inline comment as done.

Address @glebius comment.

Generally LGTM with the only comment above.

sys/net/route/nhgrp_ctl.c
642

The nexthop group contains next's and their relative weights. I'd rather try to have a single representation of all variants, where next hops are not duplicated,. E.g. if the merged list contains nehhops [(A, W1), (B, W2), (A, W3)] then it should be represented by the nhg (A, W1+W3), (B, W2))]

This revision is now accepted and ready to land.Sat, Apr 11, 9:31 PM
sys/net/route/nhgrp_ctl.c
642

Since part of the weight value is used for the metric (it was previously reserved for that), this would result in an incorrect metric because the metric value would be summed twice.
Also, we don't do this in append_nhops, so our compiled nhops become inconsistent.

We can fix append_nhops, but please also see my other revision, especially D56322.
After D56322, I can overwrite existing duplicate nhops with same metric but different weights.