-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[smartswitch][YANG]Add yang model for DPU_PORT information #21439
base: master
Are you sure you want to change the base?
Conversation
/azp run Azure.sonic-buildimage |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run Azure.sonic-buildimage |
Azure Pipelines successfully started running 1 pipeline(s). |
|
||
leaf state { | ||
description "Admin state of DPU device"; | ||
type enumeration { |
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 use sonic-types
typedef admin_status { | |
type enumeration { | |
enum up; | |
enum down; | |
} | |
} |
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.
Done. Thank you!
@@ -74,6 +84,63 @@ module sonic-smart-switch { | |||
/* end of container DPUS_LIST */ | |||
} | |||
/* end of container DPUS */ | |||
|
|||
container DPU_PORT { |
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.
could you add some unit test for this table here:
https://github.com/sonic-net/sonic-buildimage/blob/master/src/sonic-yang-models/tests/yang_model_pytests/test_smart_switch.py
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.
Added. Thank you!
type string; | ||
} | ||
|
||
leaf gnmi { |
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 use gnmi_port instead of gnmi?
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.
Done. Thank you!
|
||
leaf vip_ipv4 { | ||
description "VIP IPv4 address from minigraph"; | ||
type inet:ipv4-prefix; |
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 do you use ipv4-prefix for vip_ipv4 and ipv4-address for pa_ipv4?
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.
My bad, fixed it now. Thank you!
Also, write test cases for DPU_PORT
/azp run Azure.sonic-buildimage |
Azure Pipelines successfully started running 1 pipeline(s). |
|
||
@pytest.mark.parametrize( | ||
"port_name, error_message", [ | ||
("port0", None), |
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 does "port0" mean? We should use "port0" for DPU0?
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.
"port0" here is the interface name on the dpu.
leaf PORT_NAME { | ||
description "Name of the DPU port"; | ||
type string { | ||
pattern "[a-z]+[0-9]+"; |
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 should include uppercase and lowercase letters
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.
Modified to include uppercase letters too. Thank you!
/azp run Azure.sonic-buildimage |
Azure Pipelines successfully started running 1 pipeline(s). |
Why I did it
Work item tracking
How I did it
How to verify it
Which release branch to backport (provide reason below if selected)
Tested branch (Please provide the tested image version)
Description for the changelog
Add yang model for the DPU_PORT information below:
DPU_PORT|<PORT_NAME>:
state: up|down ; admin state of DPU device
vip_ipv4: ipv4 prefix ; from minigraph
vip_ipv6: ipv6 prefix ; from minigraph
pa_ipv4: ipv4 pa ip ; from minigraph
pa_ipv6: ipv6 pa ip ; from minigraph
vdpu_id: id of vdpu ; from minigraph
gnmi: gnmi server port ;
Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)