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

Switchport Modes Port & Port Channel Yang Model Configurations #13580

Merged
merged 250 commits into from
Jan 26, 2024

Conversation

ridahanif96
Copy link
Contributor

@ridahanif96 ridahanif96 commented Feb 1, 2023

Why I did it

  • Modified "sonic-port.yang" for adding support in Port Yang model for the "mode" attribute for adding port modes

  • Modified "sonic-portchannel.yang" for adding support in Port Channel Yang model for the "mode" attribute for adding port modes

  • Updated tests for these modifications

How to verify it

  • Added support to align SONiC yang with Config_db

@ridahanif96 ridahanif96 marked this pull request as ready for review February 2, 2023 18:28
@zhangyanzhao zhangyanzhao added the YANG YANG model related changes label Feb 2, 2023
@zhangyanzhao
Copy link
Collaborator

Please help on the review. Thanks.

@ganglyu
Copy link
Contributor

ganglyu commented Feb 4, 2023

Please fix unit test:

libyang[0]: Invalid keyword "routed|access|trunk.". (path: /sonic-port:sonic-port/PORT/PORT_LIST/mode)
libyang[0]: Module "sonic-port" parsing failed.
libyang[0]: Importing "sonic-port" module into "sonic-buffer-port-egress-profile-list" failed.
libyang[0]: Module "sonic-buffer-port-egress-profile-list" parsing failed.

ganglyu
ganglyu previously approved these changes Feb 6, 2023
@zhangyanzhao
Copy link
Collaborator

This will target 202305 release.

@zhangyanzhao
Copy link
Collaborator

@ridahanif96 will fix the build failure.

@@ -208,6 +210,7 @@ module sonic-vlan {
type inet:ipv6-address;
}


Copy link
Contributor

Choose a reason for hiding this comment

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

unnecessary empty line.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@@ -221,6 +224,8 @@ module sonic-vlan {
leaf mac {
type yang:mac-address;
}


Copy link
Contributor

Choose a reason for hiding this comment

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

unnecessary empty line.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@@ -240,22 +245,29 @@ module sonic-vlan {
}
}

leaf port {
leaf port
{
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't change format 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.

Fixed

/* key elements are mandatory by default */
type union {
type leafref {
type leafref
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't change format 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.

Fixed

@@ -89,7 +89,7 @@
"description": "Ethernet0",
"mtu": 9000,
"name": "Ethernet0",
"speed": 25000
"speed": 25000
Copy link
Contributor

Choose a reason for hiding this comment

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

space at end of line

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed!

@@ -193,7 +193,7 @@
"description": "Ethernet1",
"mtu": 9000,
"name": "Ethernet1",
"speed": 25000
"speed": 25000
Copy link
Contributor

Choose a reason for hiding this comment

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

space at end of line

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed!

Copy link
Contributor

@ganglyu ganglyu left a comment

Choose a reason for hiding this comment

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

lgtm

@ridahanif96
Copy link
Contributor Author

@qiluo-msft please help merge this PR! Thanks!

@ridahanif96
Copy link
Contributor Author

@qiluo-msft can you pls help merge this PR! Thanks

@zongbintu
Copy link

@qiluo-msft can you pls help merge this PR! Thanks

We need the port mode change.
Thanks for the PR.
May I ask when this PR is planned to be merge.

@ridahanif96
Copy link
Contributor Author

@qiluo-msft pls merge this PR

@qiluo-msft qiluo-msft merged commit 88f80fb into sonic-net:master Jan 26, 2024
18 checks passed
@zhangyanzhao
Copy link
Collaborator

This is disruptive change per @qiluo-msft

leaf mode {
description "SwitchPort Modes possible values are routed|access|trunk. Default value for mode is routed";
type stypes:switchport_mode;
default "routed";
Copy link
Collaborator

Choose a reason for hiding this comment

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

The default value will introduce disruptive change. The current behavior is conditional "default value".

qiluo-msft pushed a commit that referenced this pull request Mar 27, 2024
#### Why I did it
Removed Default Mode value from sonic-port.yang & sonic-portchannel.yang to avoid disruptive change

#### How I did it
This PR is created in reference with [PR](#13580)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
YANG YANG model related changes
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

8 participants