-
Notifications
You must be signed in to change notification settings - Fork 697
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Supporting BGP/MPLS L3VPNs with Frrouting Zebra API 6 #1992
Conversation
- This commit aims to solve reported problem on issues osrg#1611, osrg#1648 and osrg#1912 - Partial changes of this commit duplicate with changes on PR osrg#1587 (not merged) and PR osrg#1766 (not merged and already closed) - This commit is tested with only FRRouting version 6.0.2 (which uses Zebra API 6) - This commit fixes lack of LABEL_MANAGER_CONNECT_ASYNC for ZAPI6. (This bug is introduced on commit 2bdb76f "Supporting Zebra API version 6 which is used in FRRouting version 6")
internal/pkg/table/path.go
Outdated
attrsHash uint32 | ||
aslooped bool | ||
reason BestPathReason | ||
receiveVrfId uint32 //VRF in which the path was received. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't fatten Path structure. Can you create a map or whatever in zclient.go to store that information?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for reply and reviewing my source code.
I introduced receiveVrfId to Path struct referring PR #1766 without careful consideration.
I sent new source code on this PR for introducing map on zclient instead of deleting receiveVrfID from Path struct.
- Deleting receiveVrfId (which is introduced on 2 previous commit 90eeb5d) from Path struct and Introducing pathVrf Map in zclient. - Recovering logic (which is changed on 1 previous commit acfd5be) to use assignMplsLabel in server.go. - Refectoring zclient's newIPRouteBody for deleating duplicate logic for IPv4 and IPv6.
if pathList, err := s.globalRib.AddVrf(name, id, rd, im, ex, pi); err != nil { | ||
return err | ||
} else if len(pathList) > 0 { | ||
s.propagateUpdate(nil, pathList) | ||
} | ||
if vrf, ok := s.globalRib.Vrfs[name]; ok { | ||
if s.zclient != nil && s.zclient.mplsLabelRangeSize > 0 { | ||
go assignMplsLabel(s, vrf) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why needs to use goroutine here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function assignMplsLabel waits to read channel (at line 2045 in servr.go).
https://github.com/osrg/gobgp/pull/1992/files#diff-09856fe9becddf0199651f451409356aR2045
The channel is written when zclient receives body of GET_LABEL_CHUNK message (at line 406 in zclient.go)
https://github.com/osrg/gobgp/pull/1992/files#diff-596a9f4549e849312ed11458eb74b762R406
I confirmed the program continue to block following processing when I call assignMplsLabel without goroutine.
pushed, let's see how things work. Thanks a lot! |
(This bug is introduced on commit 2bdb76f "Supporting Zebra API version 6 which is used in FRRouting version 6")