-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Add support for SRv6 SID sharing between daemons #18726
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
base: master
Are you sure you want to change the base?
Conversation
When daemons make a `GET_SRV6_SID` request, they should be able to specify if they want an explicit SID or a dynamic SID. Currently this is not possible, because the enum srv6_sid_alloc_mode, which defines the "explicit" and "dynamic" allocation modes, is defined in the `zebra/zebra_srv6.h` header file. This means that only zebra has visibility of it. This patch moves the enum `srv6_sid_alloc_mode` from `zebra/zebra_srv6.h` to `lib/srv6.h` to allow other daemons to use it. Signed-off-by: Carmine Scarpitta <[email protected]>
This commit extends the SRv6 SID Manager to support the sharing of an explicit SID between multiple daemons. Right now, daemons can request SID Manager to allocate a SID for a given context. This commit extends the context by adding a new field "alloc_mode". This field allows daemons to request a SID in two ways: - DYNAMIC means "give me any available SID" - EXPLICIT means "give me a specific SID" When a daemon request to allocate an EXPLICIT SID for a context, we check if we already have an EXPLICIT SID for that context. - If we already have a SID (e.g., a SID that has been previously allocated by STATIC) we share and return the existing SID. - If we don't have a SID yet, we allocate a new SID for that context. Signed-off-by: Carmine Scarpitta <[email protected]>
Previous commit added a new field "alloc_mode" to the SID context. This commit extends STATIC to fill this field when making a `GET_SRV6_SID` or `RELEASE_SRV6_SID` request. Since STATIC can only allocate EXPLICIT SIDs, this field will be always set to EXPLICIT. Signed-off-by: Carmine Scarpitta <[email protected]>
Previous commit added a new field "alloc_mode" to the SID context. This commit extends BGP to fill this field when making a `GET_SRV6_SID` or `RELEASE_SRV6_SID` request. This field will be set to EXPLICIT or DYNAMIC depending on whether BGP is asking for a specific SID or any SID. Signed-off-by: Carmine Scarpitta <[email protected]>
4354925 to
4a5bcbf
Compare
Fix the following warning reported by checkpatch:
Report for zapi_msg.c | 2 issues
===============================================
< WARNING: braces {} are not necessary for single statement blocks
< FRRouting#3068: FILE: /tmp/f1-2075761/zapi_msg.c:3068:
Signed-off-by: Carmine Scarpitta <[email protected]>
4a5bcbf to
44d9606
Compare
| ifindex_t ifindex; | ||
|
|
||
| enum srv6_sid_alloc_mode alloc_mode; | ||
| }; |
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.
what is the interest of passing alloc_mode ?
passing a non zero sid value to the zapi message is not enough to say it is an explicit or an automatic value ?
are you trying to handle an other use case ? (allocating index 0), or are you trying to fix something else ?
dmytroshytyi
left a comment
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.
Hi thank you for this submission. After rapid parsing I have a comment.
| srv6_sid_ctx2str(buf, sizeof(buf), ctx)); | ||
| *sid = s->sid; | ||
| return 0; | ||
| } |
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.
In the scope of get_srv6_sid_explicit() why this case1 ("Condition: A daemon requested SID Manager to allocate any SID for the ctx") is applicable ? It looks like condition describes "any" sid while function scope is "specific" sid.
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
|
Please confirm the use case: BGP will want to reuse same SID as the one that STATIC allocated. This permits to redistribute srv6 SIDs into BGP. Right ? As alternate method, did you think of improving the 'redistribute static' command in BGP to distribute srv6 updates? |
|
How can we verify SID sharing between daemons? |
Currently the SRv6 SID Manager supports two allocation modes:
STATIC allocates EXPLICIT SIDs
BGP and ISIS allocate DYNAMIC SIDs
Each daemon allocate and use their own SIDs. Sharing a SID between multiple daemons is not supported.
This PR extends the SRv6 SID Manager to support the sharing of a SID between multiple daemons.