-
Notifications
You must be signed in to change notification settings - Fork 89
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
Skip default IPv6 route with prefix zero and fix IPv6 prefix bug #565
Conversation
Signed-off-by: Ze Gan <ganze718@gmail.com>
Hi @Pterosaur , do you mind to add some description here to describe the issue and how we are fixing it? |
dash-pipeline/SAI/src/utils.h
Outdated
@@ -268,6 +269,10 @@ namespace dash | |||
case SAI_IP_ADDR_FAMILY_IPV6: | |||
{ | |||
uint8_t ip[16]; | |||
if (std::is_same<T, p4::v1::FieldMatch_LPM>::value) { | |||
// BMv2 cannot support IPv6 LPM with prefix | |||
return SAI_STATUS_NOT_SUPPORTED; |
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 the BMv2's limitation or it is our implementation limit?
also i am a bit hesitated that we should check and fail here, because of 2 reasons:
- It is a utility function and should not have any knowledge on the scenarios
- Also the type check is a bit hacky.
IMO, if this is something we don't support, the change in the template should be good enough.
Hi @r12f , Thanks for your suggestion. This PR is just for testing right now, So it looks hacky and drafted. I will refactor it after confirmed. |
This reverts commit 44d95c7.
5078c25
to
999f4f1
Compare
Signed-off-by: Ze Gan <zegan@microsoft.com>
hi Ze, do you mind to add some explanation on what bug we are fixing in this change and how? |
Signed-off-by: Ze Gan <zegan@microsoft.com>
@r12f Thanks for your suggestion, Please check it again. |
@r12f - looks like a request for you to re-check after edits :) |
This is to ensure bmv2 can launch, but is a temporary patch. Not valid in LPM, and it fails. |
1.To set a default IPv6 route with the prefix 0, we will get following error logs. It's caused by the limitation of p4lang: https://github.com/p4lang/PI/blob/24e0a3c08c964e36d235973556b90e0ae922b894/proto/frontend/src/device_mgr.cpp#L2242-L2246 .
In this case, I just ignore the default IPv6 route to skip this limitation.
There are two issues on the IPv6 prefix:
leadingNonZeroBits
returns the exact length of prefix, we shouldn't directly subtract it from 129. For example, if the mask is 0xffffffffffffffffffffffff, the original implementation will get 129-0-32=97, it is obviously wrong. The correct answer is 128. So, I fix this bug.