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

[counter] Clear counter table when dhcpmon init #14

Merged
merged 1 commit into from
Jan 5, 2024

Conversation

yaqiangz
Copy link
Collaborator

@yaqiangz yaqiangz commented Dec 27, 2023

Why I did it

Fix issue sonic-net/sonic-buildimage#15047
dhcp counter didn't restore after config reload

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

How I did it

  1. Clear all counters when dhcpmon start
  2. Remove clear counter in initialize_counter since they are cleared in previous

How to verify it

  1. Build debian packet and install in DUT do manually testing
  2. Run dhcp_relay test, all passed
collected 22 items                                                                                                                                                                           

dhcp_relay/test_dhcp_pkt_fwd.py::TestDhcpPktFwd::testDhcpPacketForwarding[pktInfo0] PASSED                                                                                             [  4%]
dhcp_relay/test_dhcp_pkt_fwd.py::TestDhcpPktFwd::testDhcpPacketForwarding[pktInfo1] PASSED                                                                                             [  9%]
dhcp_relay/test_dhcp_pkt_fwd.py::TestDhcpPktFwd::testDhcpPacketForwarding[pktInfo2] PASSED                                                                                             [ 13%]
dhcp_relay/test_dhcp_pkt_fwd.py::TestDhcpPktFwd::testDhcpPacketForwarding[pktInfo3] PASSED                                                                                             [ 18%]
dhcp_relay/test_dhcp_relay.py::test_interface_binding PASSED                                                                                                                           [ 22%]
dhcp_relay/test_dhcp_relay.py::test_dhcp_relay_default[single] PASSED                                                                                                                  [ 27%]
dhcp_relay/test_dhcp_relay.py::test_dhcp_relay_after_link_flap[single] PASSED                                                                                                          [ 31%]
dhcp_relay/test_dhcp_relay.py::test_dhcp_relay_start_with_uplinks_down[single] PASSED                                                                                                  [ 36%]
dhcp_relay/test_dhcp_relay.py::test_dhcp_relay_unicast_mac[single] PASSED                                                                                                              [ 40%]
dhcp_relay/test_dhcp_relay.py::test_dhcp_relay_random_sport[single] PASSED                                                                                                             [ 45%]
dhcp_relay/test_dhcp_relay.py::test_dhcp_relay_counter[single] PASSED                                                                                                                  [ 50%]
dhcp_relay/test_dhcp_relay.py::test_dhcp_relay_default[dual] SKIPPED (skip DUAL_TOR_MODE tests on Single ToR testbeds)                                                                 [ 54%]
dhcp_relay/test_dhcp_relay.py::test_dhcp_relay_after_link_flap[dual] SKIPPED (skip DUAL_TOR_MODE tests on Single ToR testbeds)                                                         [ 59%]
dhcp_relay/test_dhcp_relay.py::test_dhcp_relay_start_with_uplinks_down[dual] SKIPPED (skip DUAL_TOR_MODE tests on Single ToR testbeds)                                                 [ 63%]
dhcp_relay/test_dhcp_relay.py::test_dhcp_relay_unicast_mac[dual] SKIPPED (skip DUAL_TOR_MODE tests on Single ToR testbeds)                                                             [ 68%]
dhcp_relay/test_dhcp_relay.py::test_dhcp_relay_random_sport[dual] SKIPPED (skip DUAL_TOR_MODE tests on Single ToR testbeds)                                                            [ 72%]
dhcp_relay/test_dhcp_relay.py::test_dhcp_relay_counter[dual] SKIPPED (skip DUAL_TOR_MODE tests on Single ToR testbeds)                                                                 [ 77%]
dhcp_relay/test_dhcpv6_relay.py::test_interface_binding PASSED                                                                                                                         [ 81%]
dhcp_relay/test_dhcpv6_relay.py::test_dhcpv6_relay_counter PASSED                                                                                                                      [ 86%]
dhcp_relay/test_dhcpv6_relay.py::test_dhcp_relay_default PASSED                                                                                                                        [ 90%]
dhcp_relay/test_dhcpv6_relay.py::test_dhcp_relay_after_link_flap PASSED                                                                                                                [ 95%]
dhcp_relay/test_dhcpv6_relay.py::test_dhcp_relay_start_with_uplinks_down PASSED                                                                                                        [100%]

@yaqiangz yaqiangz marked this pull request as ready for review December 27, 2023 10:52
@yaqiangz
Copy link
Collaborator Author

@kellyyeh Could you help to review this PR?

@dgsudharsan
Copy link

@yaqiangz This issue exists in 202205. In 202205 we don't have the submodule for dhcpmon. Please raise a separate PR against build image
@yxieca For visibility.

@kellyyeh kellyyeh merged commit bace2e0 into sonic-net:master Jan 5, 2024
5 checks passed
yaqiangz added a commit to yaqiangz/sonic-dhcpmon that referenced this pull request Jan 8, 2024
yaqiangz added a commit that referenced this pull request Jan 10, 2024
[202311][counter] Clear counter table when dhcpmon init (#14)

Cherry-pick from #14

Why I did it
Fix issue sonic-net/sonic-buildimage#15047
dhcp counter didn't restore after config reload

Work item tracking
Microsoft ADO (number only): 26270786
How I did it
Clear all counters when dhcpmon start
Remove clear counter in initialize_counter since they are cleared in previous
How to verify it
Build debian packet and install in DUT do manually testing
Run dhcp_relay test, all passed

Signed-off-by: Yaqiang Zhu <yaqiangzhu@microsoft.com>
yaqiangz added a commit that referenced this pull request Jan 10, 2024
Cherry-pick from #14

Why I did it
Fix issue sonic-net/sonic-buildimage#15047
dhcp counter didn't restore after config reload

Work item tracking
Microsoft ADO (number only): 26270786
How I did it
Clear all counters when dhcpmon start
Remove clear counter in initialize_counter since they are cleared in previous
How to verify it
Build debian packet and install in DUT do manually testing
Run dhcp_relay test, all passed
@dgsudharsan
Copy link

@yaqiangz @StormLiangMS This fix is not included in 202305 branch. Can you please update submodule in 202305?

@yaqiangz
Copy link
Collaborator Author

yaqiangz commented Feb 1, 2024

@yaqiangz @StormLiangMS This fix is not included in 202305 branch. Can you please update submodule in 202305?

sonic-net/sonic-buildimage#17952
PR raised

yaqiangz added a commit to yaqiangz/sonic-dhcpmon that referenced this pull request Feb 29, 2024
yaqiangz added a commit to yaqiangz/sonic-dhcpmon that referenced this pull request Mar 5, 2024
kellyyeh added a commit to kellyyeh/sonic-dhcpmon that referenced this pull request Mar 6, 2024
kellyyeh added a commit that referenced this pull request Mar 6, 2024
* Revert "[counter] Clear counter table when dhcpmon init (#14)"

This reverts commit bace2e0.

* Revert "Merge pull request #13 from jcaiMR/dev/jcai_master_interface_counter"

This reverts commit 7c55e50, reversing
changes made to a3c5381.

* Revert "refine counting logic"

This reverts commit 085a087.
yaqiangz pushed a commit to yaqiangz/sonic-dhcpmon that referenced this pull request May 31, 2024
* Revert "[counter] Clear counter table when dhcpmon init (sonic-net#14)"

This reverts commit bace2e0.

* Revert "Merge pull request sonic-net#13 from jcaiMR/dev/jcai_master_interface_counter"

This reverts commit 7c55e50, reversing
changes made to a3c5381.

* Revert "refine counting logic"

This reverts commit 085a087.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants