-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
srv6: Introduce IPv6 address in segment-list used by TE Policy #15057
base: master
Are you sure you want to change the base?
srv6: Introduce IPv6 address in segment-list used by TE Policy #15057
Conversation
3f63bf8
to
fccc0c2
Compare
Fix warnings by checkpatch. |
4d285ff
to
331f8d4
Compare
2 small fixes for isis_sr_te uploaded in the recent push. |
331f8d4
to
57fdef4
Compare
@@ -0,0 +1,35 @@ | |||
password 1 |
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.
Is this needed?
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.
fixed
create_interface_in_kernel, | ||
) | ||
|
||
pytestmark = [pytest.mark.isisd, pytest.mark.sharpd] |
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.
Shouldn't bgpd, pathd be included also?
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.
fixed
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.
this is not fixed.
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.
really fixed by also adding the
pytest.mark.pathd
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.
some questions; waiting on @ton31337 's comments as well
lib/zclient.c
Outdated
|
||
stream_putw(s, zt->srv6_segs.num_segs); | ||
|
||
stream_put(s, &zt->srv6_segs.segs[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.
yes ... this should check for an empty seg before putting, I think
lib/srte.h
Outdated
ZEBRA_SR_SRV6_SRTE = 2, /* SRv6 SID List*/ | ||
}; | ||
|
||
static inline enum lsp_types_t lsp_type_from_sr_type(int sr_type) |
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.
Shouldn't this pass in a enum sr_types..
instead of an int? Let's let the compiler help us please
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.
fixed
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.
Please remove the default case 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.
fixed
zebra/rt_netlink.c
Outdated
@@ -1550,7 +1550,7 @@ static ssize_t fill_seg6ipt_encap(char *buffer, size_t buflen, | |||
srh->first_segment = segs->num_segs - 1; | |||
|
|||
for (i = 0; i < segs->num_segs; i++) { | |||
memcpy(&srh->segments[i], &segs->seg[i], | |||
memcpy(&srh->segments[segs->num_segs - i - 1], &segs->seg[i], |
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.
This is only 1/2 of the equation, we need to fix the decode side as well. Add the ipv6 seg6 route from the linux cli and the segments are backwards in comparison.
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.
Thanks, fixed,
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.
Some work needs to be done to clean this up
zebra/zebra_srte.c
Outdated
|
||
for (rn = route_top(table); rn; rn = route_next(rn)) { | ||
RNODE_FOREACH_RE_SAFE (rn, re, next) { | ||
if (re->nhe->nhg.nexthop->srte_color == |
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.
invert this logic so the indent is not so deep this is hard to read
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.
fixed.
zebra/zebra_srte.c
Outdated
@@ -133,6 +136,47 @@ static int zebra_sr_policy_notify_update_client(struct zebra_sr_policy *policy, | |||
} | |||
stream_putl(s, policy->color); | |||
|
|||
if (policy->segment_list.srv6_segs.num_segs > 0) { | |||
/* Lookup table. */ | |||
table = zebra_vrf_table(AFI_IP6, SAFI_UNICAST, VRF_DEFAULT); |
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 supposed to happen when we have > 1 million routes? What is a reasonable number of items that are going to be sent. Are we going to run out of packet space? Are we going to just cpuhog like you would not believe?
Thank you very much for your reviews, @ton31337, @riw777, @donaldsharp. I was on PTO, thus the response delay. I expect to look at this PR in coming time. @cscarpitta, WDYT about the cli format for ipv6 address? Does it look good? |
c0b8fb3
to
8f81927
Compare
lib/srte.h
Outdated
return ZEBRA_LSP_SRTE; | ||
case ZEBRA_SR_LSP_NONE: | ||
case ZEBRA_SR_SRV6_SRTE: | ||
default: |
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.
remove the default this is an enum and all the values should be accounted for in the switch statement. Leaving a default allows future changes to the enum to be masked here and the developer will miss it.
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.
fixed
pathd/pathd.c
Outdated
@@ -621,7 +622,6 @@ void srte_policy_apply_changes(struct srte_policy *policy) | |||
SET_FLAG(new_best_candidate->flags, F_CANDIDATE_BEST); | |||
SET_FLAG(new_best_candidate->flags, | |||
F_CANDIDATE_MODIFIED); | |||
|
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 the whitespace change?
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.
fixed
When I run the new test under any type of load it fails badly:
|
as a note when I run the test by itself or concurrently with itself it works fine. It's only when scale/load is placed on the system that causes it to fail badly. This means, to me, that the test is starting to look for data before some other event has occurred and we get this output. See the hundreds of fixes in the topotest directory as we fix this sort of problem in the test for guidance on how to approach the problem. #16586, #16583, #16523, #16510 and #16485 as recent examples of this sort of problem. |
Hi @donaldsharp , thanks for this comment. Are you running the topotests on the upstream CI hardware?
Best Dmytro |
Hello @donaldsharp , I have checked all PRs you suggested: #16586 :
#16586 :
#16523 :
#16510:
Summary:
but instead uses:
Has someone encountered similar behavior when configuring in this way? I would do and verify the change, but have a setup that doesn't reproduce mentioned issue (regarding the failed tests under the load). |
b0fa3ff
to
19600f8
Compare
Failures are unrelated:
|
I think we're still waiting on @donaldsharp to clear his review on this one ... and the CI changes ... has this been rebased in a while? It might help to rebase it |
9212f6b
to
3a41cc3
Compare
Add SRv6 segments to zapi_srte_stunnel structure. Signed-off-by: Dmytro Shytyi <[email protected]>
Add SRv6 SID value (srv6-sid-value) to the YANG model. Implement nb handlers for this new value. Signed-off-by: Dmytro Shytyi <[email protected]>
Add structute sr_types_t, that contains the Segment Routing types. Fill the zapi_sr_policy's segment_list with values such as: - value - local_label - num_segs - srv6_segs Signed-off-by: Dmytro Shytyi <[email protected]>
SR-TE tunnel must contain at least one label or SRv6 SID. Check this condition. Signed-off-by: Dmytro Shytyi <[email protected]>
When the segment list is not empty add SRv6 segments to a nexthop. Signed-off-by: Dmytro Shytyi <[email protected]>
Encode and Decode SRv6-TE. It includes: - number of segments - list of segments Signed-off-by: Dmytro Shytyi <[email protected]>
When configuring an SRv6 SID list via iproute2, the segment list that appears in vtysh, learned from the kernel, is inversed. Fix the order of SRv6 SIDs in segment list, learned from the kernel. Fixes: f20cf14 ("bgpd,lib,sharpd,zebra: srv6 introduce multiple segs/SIDs in nexthop") Signed-off-by: Dmytro Shytyi <[email protected]>
Pathd needs to track the reachability of the first SID of any SRv6 segment-list. Use the nexthop tracking facility and add the pathd daemon as a client to nht service from zebra. Signed-off-by: Philippe Guibert <[email protected]> Signed-off-by: Dmytro Shytyi <[email protected]>
The Pathd daemon is aware of the SID reachability, but still once the sr policy installed in zebra, there is need to re-resolve the SID reachability. Extend the Pathd NHT service, by extracting the resolved next-hop. This information will be conveyed in the SR_POLICY_SET message, and will be very helpful to simplify code in zebra. Signed-off-by: Philippe Guibert <[email protected]> Signed-off-by: Dmytro Shytyi <[email protected]>
When SRv6 list of segments was changed, change SRv6 policy. Signed-off-by: Dmytro Shytyi <[email protected]>
…nt_list When notifying an update for a colored nexthop, ZEBRA sends the default PATHD distance value and the 0 metric value. Those two values break the original values that originated from an IGP route, for instance. When transmitting this information to BGP for instance, the distance and values are very important when computing BGP paths. Change this by keeping the original distance and metric values. When SRv6 segment list size is bigger than 0, send segments and other elements via zserv_send_message(). The ZEBRA SRTE code can not rely on the routing table. Use instead the resolved nexthop information gathered by th SRv6 SRTE information. Signed-off-by: Philippe Guibert <[email protected]> Signed-off-by: Dmytro Shytyi <[email protected]>
Consider an srv6 policy active, when sr policy set is received. The sr_policy_validate() function is however called, the default state value is down, and immediately sent to UP. Signed-off-by: Philippe Guibert <[email protected]> Signed-off-by: Dmytro Shytyi <[email protected]>
Add pathd srv6 segment list support. Signed-off-by: Philippe Guibert <[email protected]> Signed-off-by: Dmytro Shytyi <[email protected]>
SRv6 Policy is an ordered list of segments that represent a source-routed policy. Packet flows are steered into an SRv6 Policy. Signed-off-by: Dmytro Shytyi <dmytro@[email protected]> Signed-off-by: Philippe Guibert <[email protected]>
3a41cc3
to
5db1c40
Compare
CI failures look related ... |
Yes, it is related , after rabase. Dmytro |
These series of patches introduce new feature: user may configure ipv6-address in segment list.
Format:
Example:
Signed-off-by: Dmytro Shytyi [email protected]