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

[smartswitch][YANG]Add yang model for DPU_PORT information #21439

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

vvolam
Copy link
Contributor

@vvolam vvolam commented Jan 15, 2025

Why I did it

Work item tracking
  • Microsoft ADO (number only): 30180572

How I did it

How to verify it

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211
  • 202305

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)

@vvolam vvolam requested a review from qiluo-msft as a code owner January 15, 2025 05:29
@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

Copy link

Azure Pipelines successfully started running 1 pipeline(s).


leaf state {
description "Admin state of DPU device";
type enumeration {
Copy link
Contributor

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;
}
}

Copy link
Contributor Author

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 {
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

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 {
Copy link
Contributor

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?

Copy link
Contributor Author

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;
Copy link
Contributor

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?

Copy link
Contributor Author

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
@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@vvolam vvolam requested review from wen587 and ganglyu January 22, 2025 00:18

@pytest.mark.parametrize(
"port_name, error_message", [
("port0", None),
Copy link
Contributor

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?

Copy link
Contributor Author

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]+";
Copy link
Contributor

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

Copy link
Contributor Author

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!

@vvolam vvolam requested a review from prsunny January 22, 2025 02:26
@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants