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 'default' option for sFlow. #1606

Merged
merged 2 commits into from
May 12, 2021
Merged

Conversation

venkatmahalingam
Copy link
Contributor

@venkatmahalingam venkatmahalingam commented May 10, 2021

Signed-off-by: Venkatesan Mahalingam [email protected]

The changes are copied from #845 to resolve the conflict.

The dependent swss PR : sonic-net/sonic-swss#1728

Adding the 'default' option to allow user to set an interface's
sFlow sampling-rate back to default.

  • What I did
    Add a 'default' option so users can revert to the default sFlow sampling-rate on an interface.

  • How I did it
    Updated the config script in config/main.py.

  • How to verify it
    Unit-test:


root@sonic:~# show sflow interface | less

sFlow interface configurations
+-------------+---------------+-----------------+
| Interface   | Admin State   |   Sampling Rate |
+=============+===============+=================+
| Ethernet0   | up            |            4000 |
+-------------+---------------+-----------------+
| Ethernet4   | up            |            4000 |
+-------------+---------------+-----------------+
| Ethernet8   | up            |            4000 |
+-------------+---------------+-----------------+
| Ethernet12  | up            |            4000 |
+-------------+---------------+-----------------+
| Ethernet16  | up            |            4000 |
+-------------+---------------+-----------------+

root@sonic:~# config sflow interface sample-rate Ethernet0 222
Error: Sample rate must be between 256 and 8388608 or default
root@sonic:~# config sflow interface sample-rate Ethernet0 333
root@sonic:~# config sflow interface sample-rate Ethernet4 444
root@sonic:~# show sflow interface | less

sFlow interface configurations
+-------------+---------------+-----------------+
| Interface   | Admin State   |   Sampling Rate |
+=============+===============+=================+
| Ethernet0   | up            |             333 |
+-------------+---------------+-----------------+
| Ethernet4   | up            |             444 |
+-------------+---------------+-----------------+


root@sonic:~# config sflow interface sample-rate Ethernet0 default
root@sonic:~# config sflow interface sample-rate Ethernet4 default
root@sonic:~# config sflow interface sample-rate Ethernet8 default
root@sonic:~# show sflow interface | less

sFlow interface configurations
+-------------+---------------+-----------------+
| Interface   | Admin State   |   Sampling Rate |
+=============+===============+=================+
| Ethernet0   | up            |            4000 |
+-------------+---------------+-----------------+
| Ethernet4   | up            |            4000 |
+-------------+---------------+-----------------+
| Ethernet8   | up            |            4000 |
+-------------+---------------+-----------------+

Notice Ethernet0/4 has their sampling-rate restored to default (4000), but if I apply 'default' to a interface (Ethernet8) t


Signed-off-by: Venkatesan Mahalingam <[email protected]>
@prsunny
Copy link
Contributor

prsunny commented May 10, 2021

Could you please add a unit test for default ?

Signed-off-by: Venkatesan Mahalingam <[email protected]>
@venkatmahalingam
Copy link
Contributor Author

Could you please add a unit test for default ?

Done, please review the PR and merge if changes look good.

@prsunny prsunny merged commit 0904b85 into sonic-net:master May 12, 2021
gitsabari pushed a commit to gitsabari/sonic-utilities that referenced this pull request Jun 15, 2021
* Add 'default' option for sFlow.
Signed-off-by: Venkatesan Mahalingam <[email protected]>
stepanblyschak pushed a commit to stepanblyschak/sonic-utilities that referenced this pull request Apr 28, 2022
901e2efb4f5c6a1179068b43e6a837dfff19d9d9 (HEAD -> 201911, origin/201911) [fpmsyncd] Skip routes to eth0 or docker0 (sonic-net#1606)
6c6f4fbbeb24b6e16a2bffdee760ba6a95e2ceb3 configure extra inc/lib directory for build (sonic-net#1247)
cccb59efa031b817c1936a74db969debbb9b2775 [201911][Cherry-pick] [acl mirror action] Mirror session ref count fix at acl rule attachment (sonic-net#1896)
62dc36d9da988807c7a397fd90ac2859a5a07699 [ci]: Support Azure pipelines on 201911 branch (sonic-net#1806)

Signed-off-by: Abhishek Dosi <[email protected]>
stepanblyschak pushed a commit to stepanblyschak/sonic-utilities that referenced this pull request Apr 28, 2022
ea9c6690cafb959d28c90fd5d01fce5bbb5f899b (HEAD -> 201911, origin/201911) Revert "[fpmsyncd] Skip routes to eth0 or docker0 (sonic-net#1606)"
Signed-off-by: Abhishek Dosi <[email protected]>
stepanblyschak pushed a commit to stepanblyschak/sonic-utilities that referenced this pull request Apr 28, 2022
    [fpmsyncd] Skip routes to eth0 or docker0 (sonic-net#1606)

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

2 participants