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

Add wait and check ip address check when dhcp6relay init #52

Merged
merged 7 commits into from
Dec 19, 2024

Conversation

yaqiangz
Copy link
Contributor

@yaqiangz yaqiangz commented Dec 12, 2024

Why I did it

There is wait in wait_for_intf.sh inside dhcp_relay container wait_for_intf.sh.j2 to wait all vlans' ipv6 link local address to be ready. Only after that, related dhcp relay processes could be started (i.e. dhcrelay, dhcp6relay, dhcpmon)
If ipv6 link local address for one vlan is not ready, it would block all vlans' dhcpv4 and dhcpv6 relay, which is unexpected.

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

How I did it

  1. Add wait LLA in dhcp6relay process with crrent PR
    Add libevent timer to periodicly check LLA and initialization for no-ready Vlan, after they are all ready, delete the timer.
    With this change, dhcp6relay would only wait vlans whose LLA are not ready, and vlans whose LLA are ready would not be blocked.

  2. Remove wait logic in wait script by this PR: [dhcp_relay] Remove wait LLA in wait_for_intf.sh in dhcp_relay container sonic-buildimage#21182

How to verify it

Install new dhcp6relay, and run below test:

  1. In 2 Vlans scenraio (Vlan1000 and Vlan2000), remove lla for Vlan2000, then restart dhcp6relay. Then dhcp6relay successfully bind 547 for Vlan1000. After adding lla back for Vlan2000, we can see dhcp6relay successfully bind 547 for Vlan2000.
  2. With new dhcp6relay, run dhcpv6_relay tests and all passed https://github.com/sonic-net/sonic-mgmt/blob/master/tests/dhcp_relay/test_dhcpv6_relay.py

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Pull request contains merge conflicts.

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

src/relay.cpp Fixed Show fixed Hide fixed
@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

yaqiangz added a commit to yaqiangz/sonic-dhcp-relay that referenced this pull request Jan 6, 2025
Why I did it
There is wait in wait_for_intf.sh inside dhcp_relay container wait_for_intf.sh.j2 to wait all vlans' ipv6 link local address to be ready. Only after that, related dhcp relay processes could be started (i.e. dhcrelay, dhcp6relay, dhcpmon)
If ipv6 link local address for one vlan is not ready, it would block all vlans' dhcpv4 and dhcpv6 relay, which is unexpected.

Work item tracking
Microsoft ADO (number only): 30491632

How I did it
Add wait LLA in dhcp6relay process with crrent PR
Add libevent timer to periodicly check LLA and initialization for no-ready Vlan, after they are all ready, delete the timer.
With this change, dhcp6relay would only wait vlans whose LLA are not ready, and vlans whose LLA are ready would not be blocked.

Remove wait logic in wait script by this PR: [dhcp_relay] Remove wait LLA in wati_for_intf.sh in dhcp_relay container sonic-buildimage#21182

How to verify it
Install new dhcp6relay, and run below test:

In 2 Vlans scenraio (Vlan1000 and Vlan2000), remove lla for Vlan2000, then restart dhcp6relay. Then dhcp6relay successfully bind 547 for Vlan1000. After adding lla back for Vlan2000, we can see dhcp6relay successfully bind 547 for Vlan2000.
With new dhcp6relay, run dhcpv6_relay tests and all passed https://github.com/sonic-net/sonic-mgmt/blob/master/tests/dhcp_relay/test_dhcpv6_relay.py
mssonicbld pushed a commit to mssonicbld/sonic-dhcp-relay that referenced this pull request Jan 6, 2025
Why I did it
There is wait in wait_for_intf.sh inside dhcp_relay container wait_for_intf.sh.j2 to wait all vlans' ipv6 link local address to be ready. Only after that, related dhcp relay processes could be started (i.e. dhcrelay, dhcp6relay, dhcpmon)
If ipv6 link local address for one vlan is not ready, it would block all vlans' dhcpv4 and dhcpv6 relay, which is unexpected.

Work item tracking
Microsoft ADO (number only): 30491632

How I did it
Add wait LLA in dhcp6relay process with crrent PR
Add libevent timer to periodicly check LLA and initialization for no-ready Vlan, after they are all ready, delete the timer.
With this change, dhcp6relay would only wait vlans whose LLA are not ready, and vlans whose LLA are ready would not be blocked.

Remove wait logic in wait script by this PR: [dhcp_relay] Remove wait LLA in wati_for_intf.sh in dhcp_relay container sonic-buildimage#21182

How to verify it
Install new dhcp6relay, and run below test:

In 2 Vlans scenraio (Vlan1000 and Vlan2000), remove lla for Vlan2000, then restart dhcp6relay. Then dhcp6relay successfully bind 547 for Vlan1000. After adding lla back for Vlan2000, we can see dhcp6relay successfully bind 547 for Vlan2000.
With new dhcp6relay, run dhcpv6_relay tests and all passed https://github.com/sonic-net/sonic-mgmt/blob/master/tests/dhcp_relay/test_dhcpv6_relay.py
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202411: #66

yaqiangz added a commit that referenced this pull request Jan 9, 2025
Why I did it
There is wait in wait_for_intf.sh inside dhcp_relay container wait_for_intf.sh.j2 to wait all vlans' ipv6 link local address to be ready. Only after that, related dhcp relay processes could be started (i.e. dhcrelay, dhcp6relay, dhcpmon)
If ipv6 link local address for one vlan is not ready, it would block all vlans' dhcpv4 and dhcpv6 relay, which is unexpected.

Work item tracking
Microsoft ADO (number only): 30491632

How I did it
Add wait LLA in dhcp6relay process with crrent PR
Add libevent timer to periodicly check LLA and initialization for no-ready Vlan, after they are all ready, delete the timer.
With this change, dhcp6relay would only wait vlans whose LLA are not ready, and vlans whose LLA are ready would not be blocked.

Remove wait logic in wait script by this PR: [dhcp_relay] Remove wait LLA in wati_for_intf.sh in dhcp_relay container sonic-buildimage#21182

How to verify it
Install new dhcp6relay, and run below test:

In 2 Vlans scenraio (Vlan1000 and Vlan2000), remove lla for Vlan2000, then restart dhcp6relay. Then dhcp6relay successfully bind 547 for Vlan1000. After adding lla back for Vlan2000, we can see dhcp6relay successfully bind 547 for Vlan2000.
With new dhcp6relay, run dhcpv6_relay tests and all passed https://github.com/sonic-net/sonic-mgmt/blob/master/tests/dhcp_relay/test_dhcpv6_relay.py

Co-authored-by: Yaqiang Zhu <[email protected]>
yaqiangz added a commit that referenced this pull request Jan 10, 2025
Why I did it
There is wait in wait_for_intf.sh inside dhcp_relay container wait_for_intf.sh.j2 to wait all vlans' ipv6 link local address to be ready. Only after that, related dhcp relay processes could be started (i.e. dhcrelay, dhcp6relay, dhcpmon)
If ipv6 link local address for one vlan is not ready, it would block all vlans' dhcpv4 and dhcpv6 relay, which is unexpected.

Work item tracking
Microsoft ADO (number only): 30491632

How I did it
Add wait LLA in dhcp6relay process with crrent PR
Add libevent timer to periodicly check LLA and initialization for no-ready Vlan, after they are all ready, delete the timer.
With this change, dhcp6relay would only wait vlans whose LLA are not ready, and vlans whose LLA are ready would not be blocked.

Remove wait logic in wait script by this PR: [dhcp_relay] Remove wait LLA in wati_for_intf.sh in dhcp_relay container sonic-buildimage#21182

How to verify it
Install new dhcp6relay, and run below test:

In 2 Vlans scenraio (Vlan1000 and Vlan2000), remove lla for Vlan2000, then restart dhcp6relay. Then dhcp6relay successfully bind 547 for Vlan1000. After adding lla back for Vlan2000, we can see dhcp6relay successfully bind 547 for Vlan2000.
With new dhcp6relay, run dhcpv6_relay tests and all passed https://github.com/sonic-net/sonic-mgmt/blob/master/tests/dhcp_relay/test_dhcpv6_relay.py

Co-authored-by: Yaqiang Zhu <[email protected]>
mssonicbld added a commit to mssonicbld/sonic-buildimage that referenced this pull request Jan 13, 2025
<!--
     Please make sure you've read and understood our contributing guidelines:
     https://github.com/Azure/SONiC/blob/gh-pages/CONTRIBUTING.md

     ** Make sure all your commits include a signature generated with `git commit -s` **

     If this is a bug fix, make sure your description includes "fixes #xxxx", or
     "closes #xxxx" or "resolves #xxxx"

     Please provide the following information:
-->

#### Why I did it
There is wait in wait_for_intf.sh inside dhcp_relay container to wait all vlans' ipv6 link local address to be ready. Only after that, related dhcp relay processes could be started (i.e. dhcrelay, dhcp6relay, dhcpmon)
If ipv6 link local address for one vlan is not ready, it would block all vlans' dhcpv4 and dhcpv6 relay, which is unexpected.

##### Work item tracking
- Microsoft ADO **(number only)**: 30491632

#### How I did it
With current PR, remove wait LLA logic in this script.
Add wait LLA in dhcp6relay process sonic-net/sonic-dhcp-relay#52 (PR has been merged)

#### How to verify it
Install image and confirm

<!--
If PR needs to be backported, then the PR must be tested against the base branch and the earliest backport release branch and provide tested image version on these two branches. For example, if the PR is requested for master, 202211 and 202012, then the requester needs to provide test results on master and 202012.
-->

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

<!--
- Note we only backport fixes to a release branch, *not* features!
- Please also provide a reason for the backporting below.
- e.g.
- [x] 202006
-->

- [ ] 201811
- [ ] 201911
- [ ] 202006
- [ ] 202012
- [ ] 202106
- [ ] 202111
- [ ] 202205
- [ ] 202211
- [ ] 202305

#### Tested branch (Please provide the tested image version)

<!--
- Please provide tested image version
- e.g.
- [x] 20201231.100
-->

- [ ] <!-- image version 1 -->
- [ ] <!-- image version 2 -->

#### Description for the changelog
<!--
Write a short (one line) summary that describes the changes in this
pull request for inclusion in the changelog:
-->

<!--
 Ensure to add label/tag for the feature raised. example - PR#2174 under sonic-utilities repo. where, Generic Config and Update feature has been labelled as GCU.
-->

#### Link to config_db schema for YANG module changes
<!--
Provide a link to config_db schema for the table for which YANG model
is defined
Link should point to correct section on https://github.com/Azure/sonic-buildimage/blob/master/src/sonic-yang-models/doc/Configuration.md
-->

#### A picture of a cute animal (not mandatory but encouraged)
mssonicbld added a commit to mssonicbld/sonic-buildimage that referenced this pull request Jan 13, 2025
<!--
     Please make sure you've read and understood our contributing guidelines:
     https://github.com/Azure/SONiC/blob/gh-pages/CONTRIBUTING.md

     ** Make sure all your commits include a signature generated with `git commit -s` **

     If this is a bug fix, make sure your description includes "fixes #xxxx", or
     "closes #xxxx" or "resolves #xxxx"

     Please provide the following information:
-->

#### Why I did it
There is wait in wait_for_intf.sh inside dhcp_relay container to wait all vlans' ipv6 link local address to be ready. Only after that, related dhcp relay processes could be started (i.e. dhcrelay, dhcp6relay, dhcpmon)
If ipv6 link local address for one vlan is not ready, it would block all vlans' dhcpv4 and dhcpv6 relay, which is unexpected.

##### Work item tracking
- Microsoft ADO **(number only)**: 30491632

#### How I did it
With current PR, remove wait LLA logic in this script.
Add wait LLA in dhcp6relay process sonic-net/sonic-dhcp-relay#52 (PR has been merged)

#### How to verify it
Install image and confirm

<!--
If PR needs to be backported, then the PR must be tested against the base branch and the earliest backport release branch and provide tested image version on these two branches. For example, if the PR is requested for master, 202211 and 202012, then the requester needs to provide test results on master and 202012.
-->

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

<!--
- Note we only backport fixes to a release branch, *not* features!
- Please also provide a reason for the backporting below.
- e.g.
- [x] 202006
-->

- [ ] 201811
- [ ] 201911
- [ ] 202006
- [ ] 202012
- [ ] 202106
- [ ] 202111
- [ ] 202205
- [ ] 202211
- [ ] 202305

#### Tested branch (Please provide the tested image version)

<!--
- Please provide tested image version
- e.g.
- [x] 20201231.100
-->

- [ ] <!-- image version 1 -->
- [ ] <!-- image version 2 -->

#### Description for the changelog
<!--
Write a short (one line) summary that describes the changes in this
pull request for inclusion in the changelog:
-->

<!--
 Ensure to add label/tag for the feature raised. example - PR#2174 under sonic-utilities repo. where, Generic Config and Update feature has been labelled as GCU.
-->

#### Link to config_db schema for YANG module changes
<!--
Provide a link to config_db schema for the table for which YANG model
is defined
Link should point to correct section on https://github.com/Azure/sonic-buildimage/blob/master/src/sonic-yang-models/doc/Configuration.md
-->

#### A picture of a cute animal (not mandatory but encouraged)
yxieca pushed a commit to sonic-net/sonic-buildimage that referenced this pull request Jan 14, 2025
…ner (#21398)

<!--
     Please make sure you've read and understood our contributing guidelines:
     https://github.com/Azure/SONiC/blob/gh-pages/CONTRIBUTING.md

     ** Make sure all your commits include a signature generated with `git commit -s` **

     If this is a bug fix, make sure your description includes "fixes #xxxx", or
     "closes #xxxx" or "resolves #xxxx"

     Please provide the following information:
-->

#### Why I did it
There is wait in wait_for_intf.sh inside dhcp_relay container to wait all vlans' ipv6 link local address to be ready. Only after that, related dhcp relay processes could be started (i.e. dhcrelay, dhcp6relay, dhcpmon)
If ipv6 link local address for one vlan is not ready, it would block all vlans' dhcpv4 and dhcpv6 relay, which is unexpected.

##### Work item tracking
- Microsoft ADO **(number only)**: 30491632

#### How I did it
With current PR, remove wait LLA logic in this script.
Add wait LLA in dhcp6relay process sonic-net/sonic-dhcp-relay#52 (PR has been merged)

#### How to verify it
Install image and confirm

<!--
If PR needs to be backported, then the PR must be tested against the base branch and the earliest backport release branch and provide tested image version on these two branches. For example, if the PR is requested for master, 202211 and 202012, then the requester needs to provide test results on master and 202012.
-->

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

<!--
- Note we only backport fixes to a release branch, *not* features!
- Please also provide a reason for the backporting below.
- e.g.
- [x] 202006
-->

- [ ] 201811
- [ ] 201911
- [ ] 202006
- [ ] 202012
- [ ] 202106
- [ ] 202111
- [ ] 202205
- [ ] 202211
- [ ] 202305

#### Tested branch (Please provide the tested image version)

<!--
- Please provide tested image version
- e.g.
- [x] 20201231.100
-->

- [ ] <!-- image version 1 -->
- [ ] <!-- image version 2 -->

#### Description for the changelog
<!--
Write a short (one line) summary that describes the changes in this
pull request for inclusion in the changelog:
-->

<!--
 Ensure to add label/tag for the feature raised. example - PR#2174 under sonic-utilities repo. where, Generic Config and Update feature has been labelled as GCU.
-->

#### Link to config_db schema for YANG module changes
<!--
Provide a link to config_db schema for the table for which YANG model
is defined
Link should point to correct section on https://github.com/Azure/sonic-buildimage/blob/master/src/sonic-yang-models/doc/Configuration.md
-->

#### A picture of a cute animal (not mandatory but encouraged)
yxieca pushed a commit to sonic-net/sonic-mgmt that referenced this pull request Jan 14, 2025
…6494)

What is the motivation for this PR?
We add wait LLA logic in dhcp6relay with sonic-net/sonic-dhcp-relay#52
Current PR is to add test for it to verify dhcp6relay would work well when LLA is missing

How did you do it?
Modify test_interface_binding:

Remove LLA for Vlans
Restart dhcp_relay container
Verify whether sockets for LLA are not established
Add LLA back
Verify whether sockets for LLA are established

How did you verify/test it?
Run test_dhcpv6_relay.py
mssonicbld added a commit to sonic-net/sonic-buildimage that referenced this pull request Jan 15, 2025
…ner (#21399)

<!--
 Please make sure you've read and understood our contributing guidelines:
 https://github.com/Azure/SONiC/blob/gh-pages/CONTRIBUTING.md

 failure_prs.log skip_prs.log Make sure all your commits include a signature generated with `git commit -s` **

 If this is a bug fix, make sure your description includes "fixes #xxxx", or
 "closes #xxxx" or "resolves #xxxx"

 Please provide the following information:
-->

#### Why I did it
There is wait in wait_for_intf.sh inside dhcp_relay container to wait all vlans' ipv6 link local address to be ready. Only after that, related dhcp relay processes could be started (i.e. dhcrelay, dhcp6relay, dhcpmon)
If ipv6 link local address for one vlan is not ready, it would block all vlans' dhcpv4 and dhcpv6 relay, which is unexpected.

##### Work item tracking
- Microsoft ADO **(number only)**: 30491632

#### How I did it
With current PR, remove wait LLA logic in this script.
Add wait LLA in dhcp6relay process sonic-net/sonic-dhcp-relay#52 (PR has been merged)

#### How to verify it
Install image and confirm

<!--
If PR needs to be backported, then the PR must be tested against the base branch and the earliest backport release branch and provide tested image version on these two branches. For example, if the PR is requested for master, 202211 and 202012, then the requester needs to provide test results on master and 202012.
-->

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

<!--
- Note we only backport fixes to a release branch, *not* features!
- Please also provide a reason for the backporting below.
- e.g.
- [x] 202006
-->

- [ ] 201811
- [ ] 201911
- [ ] 202006
- [ ] 202012
- [ ] 202106
- [ ] 202111
- [ ] 202205
- [ ] 202211
- [ ] 202305

#### Tested branch (Please provide the tested image version)

<!--
- Please provide tested image version
- e.g.
- [x] 20201231.100
-->

- [ ] <!-- image version 1 -->
- [ ] <!-- image version 2 -->

#### Description for the changelog
<!--
Write a short (one line) summary that describes the changes in this
pull request for inclusion in the changelog:
-->

<!--
 Ensure to add label/tag for the feature raised. example - PR#2174 under sonic-utilities repo. where, Generic Config and Update feature has been labelled as GCU.
-->

#### Link to config_db schema for YANG module changes
<!--
Provide a link to config_db schema for the table for which YANG model
is defined
Link should point to correct section on https://github.com/Azure/sonic-buildimage/blob/master/src/sonic-yang-models/doc/Configuration.md
-->

#### A picture of a cute animal (not mandatory but encouraged)
mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Jan 16, 2025
…nic-net#16494)

What is the motivation for this PR?
We add wait LLA logic in dhcp6relay with sonic-net/sonic-dhcp-relay#52
Current PR is to add test for it to verify dhcp6relay would work well when LLA is missing

How did you do it?
Modify test_interface_binding:

Remove LLA for Vlans
Restart dhcp_relay container
Verify whether sockets for LLA are not established
Add LLA back
Verify whether sockets for LLA are established

How did you verify/test it?
Run test_dhcpv6_relay.py
mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Jan 16, 2025
…nic-net#16494)

What is the motivation for this PR?
We add wait LLA logic in dhcp6relay with sonic-net/sonic-dhcp-relay#52
Current PR is to add test for it to verify dhcp6relay would work well when LLA is missing

How did you do it?
Modify test_interface_binding:

Remove LLA for Vlans
Restart dhcp_relay container
Verify whether sockets for LLA are not established
Add LLA back
Verify whether sockets for LLA are established

How did you verify/test it?
Run test_dhcpv6_relay.py
yaqiangz added a commit to yaqiangz/sonic-mgmt that referenced this pull request Jan 17, 2025
…nic-net#16494)

What is the motivation for this PR?
We add wait LLA logic in dhcp6relay with sonic-net/sonic-dhcp-relay#52
Current PR is to add test for it to verify dhcp6relay would work well when LLA is missing

How did you do it?
Modify test_interface_binding:

Remove LLA for Vlans
Restart dhcp_relay container
Verify whether sockets for LLA are not established
Add LLA back
Verify whether sockets for LLA are established

How did you verify/test it?
Run test_dhcpv6_relay.py
yaqiangz added a commit to yaqiangz/sonic-mgmt that referenced this pull request Jan 17, 2025
…ogic (sonic-net#16494)

What is the motivation for this PR?
We add wait LLA logic in dhcp6relay with sonic-net/sonic-dhcp-relay#52
Current PR is to add test for it to verify dhcp6relay would work well when LLA is missing

How did you do it?
Modify test_interface_binding:

Remove LLA for Vlans
Restart dhcp_relay container
Verify whether sockets for LLA are not established
Add LLA back
Verify whether sockets for LLA are established

How did you verify/test it?
Run test_dhcpv6_relay.py
mssonicbld pushed a commit to sonic-net/sonic-mgmt that referenced this pull request Jan 17, 2025
…6494)

What is the motivation for this PR?
We add wait LLA logic in dhcp6relay with sonic-net/sonic-dhcp-relay#52
Current PR is to add test for it to verify dhcp6relay would work well when LLA is missing

How did you do it?
Modify test_interface_binding:

Remove LLA for Vlans
Restart dhcp_relay container
Verify whether sockets for LLA are not established
Add LLA back
Verify whether sockets for LLA are established

How did you verify/test it?
Run test_dhcpv6_relay.py
bingwang-ms pushed a commit to sonic-net/sonic-mgmt that referenced this pull request Jan 17, 2025
…ogic (#16494) (#16567)

What is the motivation for this PR?
We add wait LLA logic in dhcp6relay with sonic-net/sonic-dhcp-relay#52
Current PR is to add test for it to verify dhcp6relay would work well when LLA is missing

How did you do it?
Modify test_interface_binding:

Remove LLA for Vlans
Restart dhcp_relay container
Verify whether sockets for LLA are not established
Add LLA back
Verify whether sockets for LLA are established

How did you verify/test it?
Run test_dhcpv6_relay.py
VladimirKuk pushed a commit to Marvell-switching/sonic-buildimage that referenced this pull request Jan 21, 2025
…ner (sonic-net#21182)

Why I did it
There is wait in wait_for_intf.sh inside dhcp_relay container to wait all vlans' ipv6 link local address to be ready. Only after that, related dhcp relay processes could be started (i.e. dhcrelay, dhcp6relay, dhcpmon)
If ipv6 link local address for one vlan is not ready, it would block all vlans' dhcpv4 and dhcpv6 relay, which is unexpected.

Work item tracking
Microsoft ADO (number only): 30491632

How I did it
With current PR, remove wait LLA logic in this script.
Add wait LLA in dhcp6relay process sonic-net/sonic-dhcp-relay#52 (PR has been merged)

How to verify it
Install image and confirm
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