Skip to content

[sFlow] Fix sFlow CLI cannot use parameter "all" to disable sFlow on all interfaces. #1749

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

Closed
wants to merge 2 commits into from

Conversation

steven-guo-ec
Copy link

@steven-guo-ec steven-guo-ec commented Aug 9, 2021

  • What I did
    Fix the following issue that CLI command cannot use parameter "all" to disable sFlow on all interfaces.
admin@sonic:~$ show sflow interface

sFlow interface configurations
+-------------+---------------+-----------------+
| Interface   | Admin State   | Sampling Rate   |
+=============+===============+=================+
+-------------+---------------+-----------------+
admin@sonic:~$ sudo config sflow interface enable Ethernet0
admin@sonic:~$ show sflow interface

sFlow interface configurations
+-------------+---------------+-----------------+
| Interface   | Admin State   |   Sampling Rate |
+=============+===============+=================+
| Ethernet0   | up            |           10000 |
+-------------+---------------+-----------------+
admin@sonic:~$ sudo config sflow interface disable all
admin@sonic:~$ show sflow interface

sFlow interface configurations
+-------------+---------------+-----------------+
| Interface   | Admin State   |   Sampling Rate |
+=============+===============+=================+
| Ethernet0   | up            |           10000 |
+-------------+---------------+-----------------+
admin@sonic:~$

When configuring sFlow on all interface, expand the sFlow to all interface instead of add a 'SFLOW_SESSION|all' entry in CONFIG_DB.

  • Why I did it
    The 'all' parameter in 'config sflow interface' command doesn't work to disable sFlow on all interfaces.

  • How I verified it
    Verified the change by following testing procedures:

    • Enable on an interface -> enable all interfaces
    • Enable on an interface -> disable all interfaces
    • Disable on an interface -> enable all interfaces
    • Disable on an interface -> disable all interfaces
    • Enable all interfaces -> enable on an interface
    • Enable all interfaces -> disable on an interface
    • Disable all interfaces -> enable on an interface
    • Disable all interfaces -> disable on an interface

@steven-guo-ec steven-guo-ec changed the title Fix sFlow CLI cannot use parameter "all" to disable sFlow on all interfaces. [sFlow] Fix sFlow CLI cannot use parameter "all" to disable sFlow on all interfaces. Aug 9, 2021
Signed-off-by: Steven Guo <[email protected]>
@liat-grozovik
Copy link
Collaborator

@vivekreddynv can you please review?

@vivekrnv
Copy link
Contributor

vivekrnv commented Sep 2, 2021

Hi @steven-guo-ec,

This is an expected behavior i.e. local config takes precedence over global config, so there's nothing to fix here. This is not documented in the HLD. I've raised a PR to document this behavior. PR

@liat-grozovik
Copy link
Collaborator

@dgsudharsan could you please help to review this one?

@dgsudharsan
Copy link
Collaborator

@liat-grozovik As Vivek explained this is an expected behavior. We updated the HLD. The PR is not needed and I would recommend the author to close this PR

@liat-grozovik
Copy link
Collaborator

thanks. i missed it.

@steven-guo-ec
Copy link
Author

Got it, thanks.

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