-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
add Tunnel yang model #12232
add Tunnel yang model #12232
Conversation
@praveen-li will add comments. @qiluo-msft will check the configuration part. |
description "optional source IPv4 address."; | ||
} | ||
|
||
leaf dst_ip { |
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.
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 would be the correct way to specify this? other than in the description
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.
To clarify, I am not asking you to modify yang model. The point of accurate yang model, is to capture exact backend (in this case orchagent/etc) behavior. If backend has the implementation to validate dst_ip
with some constrains, yang model need to state the constains. If backend has no validation at all, current yang model is good enough.
``` | ||
{ | ||
"TUNNEL": { | ||
"MuxTunnel0": { |
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.
Can we add couple of more Tunnel entries to show all possible configs. Such as "dscp_mode": "pipe" and ecn_mode values etc.
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.
Sure, I'll add these and update!
} | ||
}, | ||
"TUNNEL": { | ||
"MuxTunnel0": { |
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.
Same here, more entries to show\parse different possible configs.
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.
I'll add this and update as well
}, | ||
"TUNNEL_INVALID_IP": { | ||
"desc": "Load TUNNEL with invalid IPv4 Address.", | ||
"eStrKey": "Pattern" |
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.
"estr": ["Exact field name"]
may be dst_ip ? in this case.
}, | ||
"TUNNEL_MISSING_NAME": { | ||
"desc": "Load PEER_SWITCH missing PEER Device name.", | ||
"eStrKey": "Mandatory" |
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.
"estr": ["Exact field name"]
} | ||
}, | ||
|
||
"TUNNEL_INVALID_IP": { |
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.
TUNNEL_INVALID_IP -> TUNNEL_INVALID_FIELD_NAME
} | ||
}, | ||
|
||
"TUNNEL_MISSING_NAME": { |
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.
TUNNEL_MISSING_NAME -> TUNNEL_MISSING_MUX_TUNNEL
} | ||
|
||
container sonic-tunnel { | ||
container TUNNEL { |
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.
description
leaf decap_dscp_to_tc_map { | ||
description "optional Decap DSCP to TC map"; | ||
type string { | ||
pattern "AZURE_TUNNEL"; |
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.
only 1 pattern 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.
As far as I can tell this was the only configuration supported, Is there a different way I should specify this?
@Ndancejic can you please help to address the comments? Thanks. |
"dscp_mode": "uniform", | ||
"dst_ip": "10.1.0.32", | ||
"ecn_mode": "copy_from_outer", | ||
"encap_ecn_mode": "standard", |
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 also include the encap and decap qos maps related attributes. I see that they have been added to the actual yang definition
@praveen-li @qiluo-msft I had a few questions on some of your comments |
leaf decap_tc_to_pg_map { | ||
description "optional Decap TC to PG map"; | ||
type string { | ||
pattern "AZURE_TUNNEL"; |
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.
Can we try to avoid using specific pattern names?
} | ||
} | ||
|
||
leaf decap_dscp_to_tc_map { |
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.
Can you create reference to DSCP to TC map table?
why do you update submodule for frr? |
My mistake, it slipped past my diff. I'll update that |
@Ndancejic can you please help to address the comments? Thanks. |
@Ndancejic Some unit tests failed, please let me know if you need any help. |
@Ndancejic , could you please check the failures? |
@Ndancejic please help to address the build failure. Thanks. |
Rebased and cleaned up the commits a bit. I would appreciate a second look - edit: nvm I need to take another look at this :/ my build is still going through without an issue for some reason... I think I'll have to clean and rebuild |
sonic-config-engine will run yang validation for generated config_db, and it seems that test_minigraph_tunnel_table can't pass yang validation. |
I can see the issue now, looks like it's because src/sonic-config-engine/tests/simple-sample-graph-case-remap-enabled.xml is configured with |
Thanks! Would you please fix this unit test? |
Signed-off-by: Nikola Dancejic <ndancejic@microsoft.com>
Signed-off-by: Nikola Dancejic <ndancejic@microsoft.com>
prefix inet; | ||
} | ||
|
||
import sonic-peer-switch { |
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.
Would you please check the indent?
Signed-off-by: Nikola Dancejic <ndancejic@microsoft.com>
Signed-off-by: Nikola Dancejic ndancejic@microsoft.com
Why I did it
Add yang model for TUNNEL config
How I did it
created sonic-tunnel.yang file and tests
How to verify it
make target/python-wheels/bullseye/sonic_yang_models-1.0-py3-none-any.whl
Which release branch to backport (provide reason below if selected)
Description for the changelog
Ensure to add label/tag for the feature raised. example - PR#2174 where, Generic Config and Update feature has been labelled as GCU.
Link to config_db schema for YANG module changes
https://github.com/sonic-net/sonic-buildimage/blob/master/src/sonic-yang-models/doc/Configuration.md#tunnel
A picture of a cute animal (not mandatory but encouraged)