Skip to content

Switchport Modes Port & Port Channel Yang Model Configurations#13580

Merged
qiluo-msft merged 250 commits intosonic-net:masterfrom
ridahanif96:Switchport_Vlan
Jan 26, 2024
Merged

Switchport Modes Port & Port Channel Yang Model Configurations#13580
qiluo-msft merged 250 commits intosonic-net:masterfrom
ridahanif96:Switchport_Vlan

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

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

This will target 202305 release.

@zhangyanzhao
Copy link

@ridahanif96 will fix the build failure.

}
}
}
} No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

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

Please check end of file

Copy link
Contributor

Choose a reason for hiding this comment

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

Please fix this issue

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 space at end of file. Fixed.

"sonic-portchannel:PORTCHANNEL": {
"PORTCHANNEL_LIST": [
{
"admin_status": "up",
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 remove admin_status?

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!

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

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


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

"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!

"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
@zhangyanzhao
Copy link

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.

9 participants