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

[yang] interface: add missing mac_addr leaf #20968

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

Conversation

bradh352
Copy link
Contributor

@bradh352 bradh352 commented Nov 29, 2024

Why I did it

YANG configuration verification fails during config replace.

How I did it

mac_addr support was added in the INTERFACE, PORTCHANNEL_INTERFACE, and VLAN_INTERFACE tables by sonic-net/sonic-swss#814 in 2020 but the YANG models were never updated to reflect that change. Updated yang model to reflect change.

How to verify it

Add mac_addr to the various INTERFACE tables then run config replace and it succeeds.

Work item tracking

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

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

Marked all releases that contained the change.

Tested branch (Please provide the tested image version)

master as of 20241109

Description for the changelog

YANG INTERFACE: add missing mac_addr leaf

Link to config_db schema for YANG module changes

There is no actual INTERFACE section in the docs (there probably should be).

A picture of a cute animal (not mandatory but encouraged)

Fixes #14253
Signed-off-by: Brad House (@bradh352)

@bradh352 bradh352 requested a review from qiluo-msft as a code owner November 29, 2024 13:34
@bradh352 bradh352 changed the title YANG sonic-interface: add missing mac_addr leaf [yang] interface: add missing mac_addr leaf Nov 29, 2024
@bradh352 bradh352 force-pushed the yang-macaddr branch 5 times, most recently from fc17991 to 546e620 Compare November 29, 2024 16:03
@bradh352
Copy link
Contributor Author

test failures are unrelated to this PR

@bradh352
Copy link
Contributor Author

/AzurePipelines run Azure.sonic-buildimage

Copy link

Commenter does not have sufficient privileges for PR 20968 in repo sonic-net/sonic-buildimage

Copy link
Collaborator

@dgsudharsan dgsudharsan left a comment

Choose a reason for hiding this comment

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

Can you please add this config to sample_config_db.json as well us update the schema in Configuration.md?
In addition can you please add a test case covering MAC address with capital hex letters to see if it pass?

@dgsudharsan dgsudharsan added the YANG YANG model related changes label Dec 6, 2024
@bradh352
Copy link
Contributor Author

bradh352 commented Dec 6, 2024

@dgsudharsan I guess I'll need to break out an INTERFACE section since such a thing doesn't exist in the current docs and try to migrate the other info into there.

@bradh352
Copy link
Contributor Author

bradh352 commented Dec 6, 2024

@dgsudharsan ready for review

@dgsudharsan
Copy link
Collaborator

@bradh352 I think there is some problem with the diff in configuration.md. Due to formatting, it is showing a huge diff which will be very hard to manage especially when we plan to cherry-pick changes to different branches. Can you please ensure the diff shows only the changed content?

@bradh352
Copy link
Contributor Author

bradh352 commented Dec 6, 2024

@dgsudharsan I thought you might say that. I'm really frustrated with the markdown format used (inconsistently and incorrectly) in that doc, so I fixed a lot of it. It was worth a shot to clean it up and actually make, say, the Table of Contents links actually work. Oh well. I'll revert that stuff and just keep the changes relevant to this PR.

@bradh352
Copy link
Contributor Author

bradh352 commented Dec 6, 2024

@dgsudharsan hopefully that's acceptable now, please review

@bradh352
Copy link
Contributor Author

bradh352 commented Dec 6, 2024

found a couple minor bugs, one unexpected as I didn't realize the double-conversion flow for the sample db. those should be corrected now.

@bradh352
Copy link
Contributor Author

bradh352 commented Dec 6, 2024

@dgsudharsan I moved the most important parts of my markdown cleanup into PR #21072 it would be great if that could be merged. I provided the links to render mine vs original, you'll see the table of contents works on mine.

@bradh352
Copy link
Contributor Author

rebased to force rebuild to see if build general sonic CI build/test issues have been resolved

@bradh352
Copy link
Contributor Author

@dgsudharsan @qiluo-msft please merge

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@bradh352
Copy link
Contributor Author

bradh352 commented Feb 5, 2025

@ganglyu

LGTM @prsunny Could you please review this PR? Do we really need the MAC address?

This isn't adding a feature for mac addresses, just letting YANG know about something that already exists.

Also, the use case for setting mac addresses is for pure layer3 environments (e.g. VXLAN EVPN - BGP). If you have 2 switches wired together with dual ports (for redundancy), you need each port to have a different mac address otherwise you have mac conflicts. At least on my Trident3 switches, every port defaults to the same system-wide mac address. So it is necessary.

@wen587
Copy link
Contributor

wen587 commented Feb 5, 2025

Is it good to support from now for mac_address? Do we need to backport? It will break YANG validation if we add mac_address in INTERFACE for the past releases.

@bradh352
Copy link
Contributor Author

bradh352 commented Feb 5, 2025

@wen587

Is it good to support from now for mac_address? Do we need to backport? It will break YANG validation if we add mac_address in INTERFACE for the past releases.

not sure how it would break yang validation, if someone is using mac_addr currently they aren't doing any yang validation at all since yang would reject. But I don't honestly care if its backported or not.

@@ -123,6 +123,10 @@ module sonic-vlan {
default disable;
}

leaf mac_addr {
Copy link
Contributor

@prsunny prsunny Feb 5, 2025

Choose a reason for hiding this comment

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

this should be an optional field.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This doesn't have the mandatory true; attribute and also doesn't have a default value .... so it is therefore optional as far as I am aware.

What am I missing here?

github-actions bot pushed a commit to bradh352/sonic-buildimage that referenced this pull request Feb 6, 2025
mac_addr support was added in the INTERFACES table by
sonic-net/sonic-swss#814 in 2020
but the YANG models were never updated to reflect that change.

Signed-off-by: Brad House (@bradh352)
github-actions bot pushed a commit to bradh352/sonic-buildimage that referenced this pull request Feb 6, 2025
mac_addr support was added in the INTERFACES table by
sonic-net/sonic-swss#814 in 2020
but the YANG models were never updated to reflect that change.

Signed-off-by: Brad House (@bradh352)
github-actions bot pushed a commit to bradh352/sonic-buildimage that referenced this pull request Feb 7, 2025
mac_addr support was added in the INTERFACES table by
sonic-net/sonic-swss#814 in 2020
but the YANG models were never updated to reflect that change.

Signed-off-by: Brad House (@bradh352)
github-actions bot pushed a commit to bradh352/sonic-buildimage that referenced this pull request Feb 7, 2025
mac_addr support was added in the INTERFACES table by
sonic-net/sonic-swss#814 in 2020
but the YANG models were never updated to reflect that change.

Signed-off-by: Brad House (@bradh352)
github-actions bot pushed a commit to bradh352/sonic-buildimage that referenced this pull request Feb 8, 2025
mac_addr support was added in the INTERFACES table by
sonic-net/sonic-swss#814 in 2020
but the YANG models were never updated to reflect that change.

Signed-off-by: Brad House (@bradh352)
github-actions bot pushed a commit to bradh352/sonic-buildimage that referenced this pull request Feb 8, 2025
mac_addr support was added in the INTERFACES table by
sonic-net/sonic-swss#814 in 2020
but the YANG models were never updated to reflect that change.

Signed-off-by: Brad House (@bradh352)
github-actions bot pushed a commit to bradh352/sonic-buildimage that referenced this pull request Feb 9, 2025
mac_addr support was added in the INTERFACES table by
sonic-net/sonic-swss#814 in 2020
but the YANG models were never updated to reflect that change.

Signed-off-by: Brad House (@bradh352)
github-actions bot pushed a commit to bradh352/sonic-buildimage that referenced this pull request Feb 9, 2025
mac_addr support was added in the INTERFACES table by
sonic-net/sonic-swss#814 in 2020
but the YANG models were never updated to reflect that change.

Signed-off-by: Brad House (@bradh352)
github-actions bot pushed a commit to bradh352/sonic-buildimage that referenced this pull request Feb 11, 2025
mac_addr support was added in the INTERFACES table by
sonic-net/sonic-swss#814 in 2020
but the YANG models were never updated to reflect that change.

Signed-off-by: Brad House (@bradh352)
github-actions bot pushed a commit to bradh352/sonic-buildimage that referenced this pull request Feb 12, 2025
mac_addr support was added in the INTERFACES table by
sonic-net/sonic-swss#814 in 2020
but the YANG models were never updated to reflect that change.

Signed-off-by: Brad House (@bradh352)
github-actions bot pushed a commit to bradh352/sonic-buildimage that referenced this pull request Feb 13, 2025
mac_addr support was added in the INTERFACES table by
sonic-net/sonic-swss#814 in 2020
but the YANG models were never updated to reflect that change.

Signed-off-by: Brad House (@bradh352)
github-actions bot pushed a commit to bradh352/sonic-buildimage that referenced this pull request Feb 14, 2025
mac_addr support was added in the INTERFACES table by
sonic-net/sonic-swss#814 in 2020
but the YANG models were never updated to reflect that change.

Signed-off-by: Brad House (@bradh352)
github-actions bot pushed a commit to bradh352/sonic-buildimage that referenced this pull request Feb 15, 2025
mac_addr support was added in the INTERFACES table by
sonic-net/sonic-swss#814 in 2020
but the YANG models were never updated to reflect that change.

Signed-off-by: Brad House (@bradh352)
github-actions bot pushed a commit to bradh352/sonic-buildimage that referenced this pull request Feb 18, 2025
mac_addr support was added in the INTERFACES table by
sonic-net/sonic-swss#814 in 2020
but the YANG models were never updated to reflect that change.

Signed-off-by: Brad House (@bradh352)
github-actions bot pushed a commit to bradh352/sonic-buildimage that referenced this pull request Feb 19, 2025
mac_addr support was added in the INTERFACES table by
sonic-net/sonic-swss#814 in 2020
but the YANG models were never updated to reflect that change.

Signed-off-by: Brad House (@bradh352)
github-actions bot pushed a commit to bradh352/sonic-buildimage that referenced this pull request Feb 20, 2025
mac_addr support was added in the INTERFACES table by
sonic-net/sonic-swss#814 in 2020
but the YANG models were never updated to reflect that change.

Signed-off-by: Brad House (@bradh352)
mac_addr support was added in the INTERFACES table by
sonic-net/sonic-swss#814 in 2020
but the YANG models were never updated to reflect that change.

Signed-off-by: Brad House (@bradh352)
@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

github-actions bot pushed a commit to bradh352/sonic-buildimage that referenced this pull request Feb 21, 2025
mac_addr support was added in the INTERFACES table by
sonic-net/sonic-swss#814 in 2020
but the YANG models were never updated to reflect that change.

Signed-off-by: Brad House (@bradh352)
github-actions bot pushed a commit to bradh352/sonic-buildimage that referenced this pull request Feb 22, 2025
mac_addr support was added in the INTERFACES table by
sonic-net/sonic-swss#814 in 2020
but the YANG models were never updated to reflect that change.

Signed-off-by: Brad House (@bradh352)
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
None yet
Development

Successfully merging this pull request may close these issues.

[yang] interface yang model is missing mac_addr key
7 participants