Skip to content
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

[dual-tor] add missing SAI attribte in order to create IPNIP tunnel #2503

Conversation

ayurkiv-nvda
Copy link
Contributor

@ayurkiv-nvda ayurkiv-nvda commented Oct 31, 2022

Signed-off-by: Andriy Yurkiv ayurkiv@nvidia.com

What I did
add SAI_TUNNEL_ATTR_DECAP_TTL_MODE and SAI_TUNNEL_ATTR_DECAP_DSCP_MODE

Why I did it
Need to pass additional SAI attrib. Align encap end decap params

1 SAI_TUNNEL_ATTR_DECAP_DSCP_MODE
Problem:

Long time ago this attribute was defined as “mandatory on create” in SAI API, but at some point it was changed to “optional”.
But MLNX SAI implementation didn’t change it and still expects this attribute to be always provided on tunnel creation.
SONiC “dual ToR” implementation, when it creates IP-in-IP tunnel, does not provide this attribute because it is “optional”.
So we get SAI error for creating tunnel because as mentioned above MLNX SAI implementation still expects this attribute as “mandatory on create”.
Need to always set this attribute in “Dual ToR orchagent” on IP-in-IP tunnel creation

2 SAI_TUNNEL_ATTR_DECAP_TTL_MODE
Problem:

Long time ago this attribute was defined as “mandatory on create” in SAI API, but at some point it was changed to “optional”.
SONiC “dual ToR” implementation, when it creates IP-in-IP tunnel, does not provide this attribute because now it is “optional”.

SAI team reported:
"We only support pipe, which is not the default API value of uniform, so user must provide explicit pipe
This has always been the ip in ip behavior and limitation, which is also documented in our RN"

So it is MLNX SAI implementation limitation that we support only “pipe” and since default value for this attribute is “uniform” we need to set it explicitly.
And in our case it is becomes “mandatory on create” attribute which must be set to “pipe” value.

As a result of this limitation we should update SONiC “Dual ToR” code in order to pass this attribute on IP-in-IP tunnel creation.

How I verified it
tunnel successfully created

Details if related

@ayurkiv-nvda ayurkiv-nvda force-pushed the ip_n_ip_dualtor_attr_forked_public branch from 13170d5 to 3274baf Compare November 1, 2022 19:53
@ayurkiv-nvda ayurkiv-nvda marked this pull request as ready for review November 3, 2022 09:15
@ayurkiv-nvda ayurkiv-nvda requested a review from prsunny as a code owner November 3, 2022 09:15
@@ -212,6 +212,10 @@ static sai_object_id_t create_tunnel(
attr.value.s32 = SAI_TUNNEL_TTL_MODE_PIPE_MODEL;
tunnel_attrs.push_back(attr);

attr.id = SAI_TUNNEL_ATTR_DECAP_TTL_MODE;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This tunnel is used only as nexthop tunnel for encap purposes. Why is this required here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding SAI_TUNNEL_ATTR_DECAP_TTL_MODE

Problem:
Long time ago this attribute was defined as “mandatory on create” in SAI API, but at some point it was changed to “optional”.
SONiC “dual ToR” implementation, when it creates IP-in-IP tunnel, does not provide this attribute because now it is “optional”.

SAI team reported:
"We only support pipe, which is not the default API value of uniform, so user must provide explicit pipe
This has always been the ip in ip behavior and limitation, which is also documented in our RN"

So it is MLNX SAI implementation limitation that we support only “pipe” and since default value for this attribute is “uniform” we need to set it explicitly.
And in our case it is becomes “mandatory on create” attribute which must be set to “pipe” value.

As a result of this limitation we should update SONiC “Dual ToR” code in order to pass this attribute on IP-in-IP tunnel creation.

@prsunny prsunny requested a review from bingwang-ms November 9, 2022 20:56
prsunny
prsunny previously approved these changes Nov 9, 2022
Copy link
Collaborator

@prsunny prsunny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. @bingwang-ms , do you've any comments?

bingwang-ms
bingwang-ms previously approved these changes Nov 10, 2022
@bingwang-ms
Copy link
Contributor

LGTM. I need to watch the test result of master image to confirm the extra attribute does't cause issue.

Signed-off-by: Andriy Yurkiv <ayurkiv@nvidia.com>
@ayurkiv-nvda ayurkiv-nvda dismissed stale reviews from bingwang-ms and prsunny via 6b9e6a1 November 23, 2022 00:14
@ayurkiv-nvda ayurkiv-nvda force-pushed the ip_n_ip_dualtor_attr_forked_public branch from 3274baf to 6b9e6a1 Compare November 23, 2022 00:14
@ayurkiv-nvda
Copy link
Contributor Author

@bingwang-ms @prsunny it looks like after branch alignment with latest master all checks passed successfully.
Can you please approve PR again?

@ayurkiv-nvda
Copy link
Contributor Author

can someone merge this PR to upstream?

@liat-grozovik liat-grozovik merged commit bc3c894 into sonic-net:master Nov 27, 2022
yxieca pushed a commit that referenced this pull request Nov 29, 2022
…2503)

- What I did
add SAI_TUNNEL_ATTR_DECAP_TTL_MODE and SAI_TUNNEL_ATTR_DECAP_DSCP_MODE

- Why I did it
Need to pass additional SAI attrib. Align encap end decap params

1 SAI_TUNNEL_ATTR_DECAP_DSCP_MODE
Problem:

Long time ago this attribute was defined as “mandatory on create” in SAI API, but at some point it was changed to “optional”.
But MLNX SAI implementation didn’t change it and still expects this attribute to be always provided on tunnel creation.
SONiC “dual ToR” implementation, when it creates IP-in-IP tunnel, does not provide this attribute because it is “optional”.
So we get SAI error for creating tunnel because as mentioned above MLNX SAI implementation still expects this attribute as “mandatory on create”.
Need to always set this attribute in “Dual ToR orchagent” on IP-in-IP tunnel creation

2 SAI_TUNNEL_ATTR_DECAP_TTL_MODE
Problem:

Long time ago this attribute was defined as “mandatory on create” in SAI API, but at some point it was changed to “optional”.
SONiC “dual ToR” implementation, when it creates IP-in-IP tunnel, does not provide this attribute because now it is “optional”.

SAI team reported:
"We only support pipe, which is not the default API value of uniform, so user must provide explicit pipe
This has always been the ip in ip behavior and limitation, which is also documented in our RN"

So it is MLNX SAI implementation limitation that we support only “pipe” and since default value for this attribute is “uniform” we need to set it explicitly.
And in our case it is becomes “mandatory on create” attribute which must be set to “pipe” value.

As a result of this limitation we should update SONiC “Dual ToR” code in order to pass this attribute on IP-in-IP tunnel creation.

- How I verified it
tunnel successfully created

Signed-off-by: Andriy Yurkiv <ayurkiv@nvidia.com>
StormLiangMS pushed a commit that referenced this pull request Mar 7, 2023
…2503)

- What I did
add SAI_TUNNEL_ATTR_DECAP_TTL_MODE and SAI_TUNNEL_ATTR_DECAP_DSCP_MODE

- Why I did it
Need to pass additional SAI attrib. Align encap end decap params

1 SAI_TUNNEL_ATTR_DECAP_DSCP_MODE
Problem:

Long time ago this attribute was defined as “mandatory on create” in SAI API, but at some point it was changed to “optional”.
But MLNX SAI implementation didn’t change it and still expects this attribute to be always provided on tunnel creation.
SONiC “dual ToR” implementation, when it creates IP-in-IP tunnel, does not provide this attribute because it is “optional”.
So we get SAI error for creating tunnel because as mentioned above MLNX SAI implementation still expects this attribute as “mandatory on create”.
Need to always set this attribute in “Dual ToR orchagent” on IP-in-IP tunnel creation

2 SAI_TUNNEL_ATTR_DECAP_TTL_MODE
Problem:

Long time ago this attribute was defined as “mandatory on create” in SAI API, but at some point it was changed to “optional”.
SONiC “dual ToR” implementation, when it creates IP-in-IP tunnel, does not provide this attribute because now it is “optional”.

SAI team reported:
"We only support pipe, which is not the default API value of uniform, so user must provide explicit pipe
This has always been the ip in ip behavior and limitation, which is also documented in our RN"

So it is MLNX SAI implementation limitation that we support only “pipe” and since default value for this attribute is “uniform” we need to set it explicitly.
And in our case it is becomes “mandatory on create” attribute which must be set to “pipe” value.

As a result of this limitation we should update SONiC “Dual ToR” code in order to pass this attribute on IP-in-IP tunnel creation.

- How I verified it
tunnel successfully created

Signed-off-by: Andriy Yurkiv <ayurkiv@nvidia.com>
@ayurkiv-nvda ayurkiv-nvda deleted the ip_n_ip_dualtor_attr_forked_public branch January 22, 2025 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants