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_relay] Fix dhcp_relay counter display issue #3054

Merged
merged 1 commit into from
Nov 29, 2023

Conversation

yaqiangz
Copy link
Contributor

@yaqiangz yaqiangz commented Nov 29, 2023

MSFT work item: 25971672

Why I did it

Fix issue: sonic-net/sonic-buildimage#15047 of after deleting vlan member and vlan, the counters for for vlan / vlan member are still seen.

How I did it

Delete related counter entry in state_db when deleting vlan and vlan members.

How to verify it

  1. All UTs passed
  2. Manually test
admin@sonic:~$ show dhcp_relay ipv4 counter -i Vlan1001
  Message Type    Vlan1001(RX)
--------------  --------------
           Ack               0
       Decline               0
      Discover               2
        Inform               0
           Nak               0
         Offer               0
       Release               0
       Request               0
       Unknown               0

  Message Type    Vlan1001(TX)
--------------  --------------
       Unknown               0
      Discover               0
         Offer               0
       Request               0
       Decline               0
           Ack               0
           Nak               0
       Release               0
        Inform               0

admin@sonic:~$ show dhcp_relay ipv4 counter -i Ethernet45
  Message Type    Ethernet45(RX)
--------------  ----------------
           Ack                 0
       Decline                 0
      Discover                 2
        Inform                 0
           Nak                 0
         Offer                 0
       Release                 0
       Request                 0
       Unknown                 0

  Message Type    Ethernet45(TX)
--------------  ----------------
       Unknown                 0
      Discover                 0
         Offer                 0
       Request                 0
       Decline                 0
           Ack                 0
           Nak                 0
       Release                 0
        Inform                 0

admin@sonic:~$ show dhcp_relay ipv6 counter -i Vlan1001
       Message Type    Vlan1001(RX)
-------------------  --------------
          Advertise               0
            Confirm               0
            Decline               0
Information-Request               0
          Malformed               0
             Rebind               0
        Reconfigure               0
      Relay-Forward               0
        Relay-Reply               0
            Release               0
              Renew               0
              Reply               0
            Request               0
            Solicit               4
            Unknown               0

       Message Type    Vlan1001(TX)
-------------------  --------------
          Advertise               0
            Confirm               0
            Decline               0
Information-Request               0
          Malformed               0
             Rebind               0
        Reconfigure               0
      Relay-Forward               4
        Relay-Reply               0
            Release               0
              Renew               0
              Reply               0
            Request               0
            Solicit               0
            Unknown               0

admin@sonic:~$ show dhcp_relay ipv6 counter -i Ethernet45
       Message Type    Ethernet45(RX)
-------------------  ----------------
          Advertise                 0
            Confirm                 0
            Decline                 0
Information-Request                 0
          Malformed                 0
             Rebind                 0
        Reconfigure                 0
      Relay-Forward                 0
        Relay-Reply                 0
            Release                 0
              Renew                 0
              Reply                 0
            Request                 0
            Solicit                 4
            Unknown                 0

       Message Type    Ethernet45(TX)
-------------------  ----------------
            Unknown                 0
            Solicit                 0
          Advertise                 0
            Request                 0
            Confirm                 0
              Renew                 0
             Rebind                 0
              Reply                 0
            Release                 0
            Decline                 0
        Reconfigure                 0
Information-Request                 0
      Relay-Forward                 0
        Relay-Reply                 0
          Malformed                 0

admin@sonic:~$ sudo config dhcp_relay ipv6 destination del 1001 fc05:5000::1 && sudo config dhcp_relay ipv4 helper del 1001 192.0.0.1 && sudo config vlan member del 1001 Ethernet45 && sudo config interface ip remove Vlan1001 fc05:1000::1 && sudo config interface ip remove Vlan1001 193.168.0.1/24 && sudo config vlan del 1001
Removed DHCP relay address [fc05:5000::1] from Vlan1001
Restarting DHCP relay service...
Removed DHCP relay address [192.0.0.1] from Vlan1001
Restarting DHCP relay service...
admin@sonic:~$ show dhcp_relay ipv4 counter -i Vlan1001
  Message Type    Vlan1001(RX)
--------------  --------------

  Message Type    Vlan1001(TX)
--------------  --------------

admin@sonic:~$ show dhcp_relay ipv4 counter -i Ethernet45
  Message Type    Ethernet45(RX)
--------------  ----------------

  Message Type    Ethernet45(TX)
--------------  ----------------

admin@sonic:~$ show dhcp_relay ipv6 counter -i Vlan1001
  Message Type    Vlan1001(RX)
--------------  --------------

  Message Type    Vlan1001(TX)
--------------  --------------

admin@sonic:~$ show dhcp_relay ipv6 counter -i Ethernet45
  Message Type    Ethernet45(RX)
--------------  ----------------

  Message Type    Ethernet45(TX)
--------------  ----------------

admin@sonic:~$

Previous command output (if the output of a command-line utility has changed)

New command output (if the output of a command-line utility has changed)

@yaqiangz yaqiangz requested a review from Blueve November 29, 2023 05:05
@yaqiangz yaqiangz force-pushed the master_dhcpv6_counter branch from 9c25fda to c43a7e6 Compare November 29, 2023 05:21
@yaqiangz yaqiangz merged commit 96dd555 into sonic-net:master Nov 29, 2023
5 checks passed
@yaqiangz
Copy link
Contributor Author

@StormLiangMS Could you help to backport this PR?

StormLiangMS pushed a commit that referenced this pull request Nov 30, 2023
Why I did it
Fix issue: sonic-net/sonic-buildimage#15047 of after deleting vlan member and vlan, the counters for for vlan / vlan member are still seen.

How I did it
Delete related counter entry in state_db when deleting vlan and vlan members.

How to verify it
All UTs passed
Manually test

Signed-off-by: Yaqiang Zhu <[email protected]>
yxieca pushed a commit that referenced this pull request Dec 14, 2023
Why I did it
Fix issue: sonic-net/sonic-buildimage#15047 of after deleting vlan member and vlan, the counters for for vlan / vlan member are still seen.

How I did it
Delete related counter entry in state_db when deleting vlan and vlan members.

How to verify it
All UTs passed
Manually test

Signed-off-by: Yaqiang Zhu <[email protected]>
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.

3 participants