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

[dhcp_server] Fix the issue with "kea-dhcp4.conf" file generation for Smart Switch. #19200

Merged
merged 2 commits into from
Jun 21, 2024

Conversation

oleksandrivantsiv
Copy link
Collaborator

Why I did it

The configuration generated from the template for the Smart Switch contained incorrect data in the "subnet4:id" field. For regular cases, the subnet ID is deduced from the VLAN name. For the Smart Switch, there is always one subnet, and the ID is set to 0.

"subnet4": [
        {
            "id": bridge-midplane,
            "subnet": "169.254.200.0/24",
            "pools": [
                {
                    "pool": "169.254.200.1 - 169.254.200.1",
                    "client-class": "sonic:dpu0"
                },
...
Work item tracking
  • Microsoft ADO (number only):

How I did it

Fix configuration generation for Smart Switch device.

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

Link to config_db schema for YANG module changes

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

Copy link
Contributor

@yaqiangz yaqiangz left a comment

Choose a reason for hiding this comment

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

Thanks for fix!

Copy link
Contributor

@yaqiangz yaqiangz left a comment

Choose a reason for hiding this comment

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

Hold on...
This change for setting subnet id is for support lease update (From kea-lease file to state_db)
dhcp_lease.py#L123
If this part doesn't corresponding support, lease information will be incorrect for smart swith..
Example:
In state_db, key would be stored like "DHCP_SERVER_IPV4_LEASE|Vlan0|aa:bb:cc:dd:ee:ff"
Could you add correspond support in it?
We can check add flag indicate whether it's smart switch via is_smart_switch in KeaDhcp4LeaseHandler-init and construct redis key by the flag in here dhcp_lease.py#L123

(Just my suggestion, if you have any other insights, please feel free to point out)

Implement dhcp lease test for Smart Switch.
@oleksandrivantsiv
Copy link
Collaborator Author

oleksandrivantsiv commented Jun 10, 2024

@yaqiangz I updated the implementation. Please check.

Copy link
Contributor

@yaqiangz yaqiangz left a comment

Choose a reason for hiding this comment

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

LGTM

@yaqiangz
Copy link
Contributor

@yxieca Could you please help to merge this PR?

@oleksandrivantsiv
Copy link
Collaborator Author

@yxieca kindly reminder. Can you please merge the PR?

@yaqiangz
Copy link
Contributor

Hi @yxieca could you please help to merge this PR?

1 similar comment
@yaqiangz
Copy link
Contributor

Hi @yxieca could you please help to merge this PR?

@yxieca yxieca merged commit 2d4f3f8 into sonic-net:master Jun 21, 2024
20 checks passed
@yaqiangz
Copy link
Contributor

Hi @bingwang-ms, could you please help to approve the backport request?

mssonicbld pushed a commit to mssonicbld/sonic-buildimage that referenced this pull request Jul 9, 2024
… Smart Switch. (sonic-net#19200)

The configuration generated from the template for the Smart Switch contained incorrect data in the "subnet4:id" field. For regular cases, the subnet ID is deduced from the VLAN name. For the Smart Switch, there is always one subnet, and the ID is set to 0.
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202405: #19519

mssonicbld pushed a commit that referenced this pull request Jul 9, 2024
… Smart Switch. (#19200)

The configuration generated from the template for the Smart Switch contained incorrect data in the "subnet4:id" field. For regular cases, the subnet ID is deduced from the VLAN name. For the Smart Switch, there is always one subnet, and the ID is set to 0.
arun1355492 pushed a commit to arun1355492/sonic-buildimage that referenced this pull request Jul 26, 2024
… Smart Switch. (sonic-net#19200)

The configuration generated from the template for the Smart Switch contained incorrect data in the "subnet4:id" field. For regular cases, the subnet ID is deduced from the VLAN name. For the Smart Switch, there is always one subnet, and the ID is set to 0.
liushilongbuaa pushed a commit to liushilongbuaa/sonic-buildimage that referenced this pull request Aug 1, 2024
… Smart Switch. (sonic-net#19200)

The configuration generated from the template for the Smart Switch contained incorrect data in the "subnet4:id" field. For regular cases, the subnet ID is deduced from the VLAN name. For the Smart Switch, there is always one subnet, and the ID is set to 0.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants