-
Notifications
You must be signed in to change notification settings - Fork 580
Fix sFlow sampling-rate and admin-state #1728
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
Conversation
…ed but there are local sampling-rate configurations. Signed-off-by: Venkatesan Mahalingam <[email protected]>
Signed-off-by: Venkatesan Mahalingam <[email protected]>
@prsunny @dgsudharsan Please review this PR. |
@venkatmahalingam can you please verify if this can be taken to 202012? |
@liat-grozovik Cherry-pick to 202012 works fine if we do it in the PR merge order i.e first Vivek's commit and then this PR commit.
|
Signed-off-by: Venkatesan Mahalingam <[email protected]>
This pull request introduces 1 alert when merging 2efe415 into b962a60 - view on LGTM.com new alerts:
|
@dgsudharsan, please review |
The PR is failing on VS test
|
Signed-off-by: Venkatesan Mahalingam <[email protected]>
Yes, looking into the failures. |
cfgmgr/sflowmgr.cpp
Outdated
@@ -108,7 +109,8 @@ void SflowMgr::sflowUpdatePortInfo(Consumer &consumer) | |||
if (m_gEnable && m_intfAllConf) | |||
{ | |||
// If the Local Conf is already present, dont't override it even though the speed is changed | |||
if (new_port || (speed_change && !m_sflowPortConfMap[key].local_conf)) | |||
if (new_port || (speed_change && | |||
!(m_sflowPortConfMap[key].local_rate_cfg || m_sflowPortConfMap[key].local_admin_cfg))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be removed "|| m_sflowPortConfMap[key].local_admin_cfg" as the rate update based on speed change is only blocked if there is any local_rate_cfg. It doesn't depend on local_admin_cfg.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
Signed-off-by: Venkatesan Mahalingam <[email protected]>
Signed-off-by: Venkatesan Mahalingam <[email protected]>
Signed-off-by: Venkatesan Mahalingam <[email protected]>
Signed-off-by: Venkatesan Mahalingam <[email protected]>
Signed-off-by: Venkatesan Mahalingam <[email protected]>
@prsunny @dgsudharsan @vivekreddynv This PR is ready to merge, please review and approve the same. Also, the below PRs for SONiC CLI & HLD changes. |
@prsunny @venkatmahalingam Request for cherry-pick to 202012 |
* Fixed incorrect interface admin-status when 'all' interface is disabled but there are local sampling-rate configurations. Signed-off-by: Venkatesan Mahalingam <[email protected]>
In order to include the following commits: d29a49a 2021-08-25 [ACL] Match TCP protocol while matching TCP_FLAG (sonic-net/sonic-swss#1854) 2569ad9 2021-08-25 Fix sFlow sampling-rate and admin-state (sonic-net/sonic-swss#1728) 8908a8f 2021-08-19 Change rif_rates.lua and port_rates.lua scripts to calculate rates correct (sonic-net/sonic-swss#1848) b42c2fb 2021-08-19 [VS Test] Skip flaky tests (sonic-net/sonic-swss#1875)
* Fixed incorrect interface admin-status when 'all' interface is disabled but there are local sampling-rate configurations. Signed-off-by: Venkatesan Mahalingam <[email protected]>
Fixed incorrect interface admin-status when 'all' interface is disabled but there are local sampling-rate configurations.
The original changes are present in the PR
Signed-off-by: Venkatesan Mahalingam [email protected]
What I did
Fixed a bug where the interface sFlow admin-status is not correct if the user configures a custom sFlow sampling-rate. (UT performed here)
As a side-effect of this fix, users can now restore the default sFlow sampling-rate with the default option using: config sflow interface sampling-rate Ethernet4 default
This is not tested here but will be tested when the config script update PR is submitted to sonic-utilities. The sFlow corresponding HLD and command-line reference will also be updated.
Why I did it
If the user ONLY configures a custom (local) sFlow sampling-rate for a interface, the interface's admin-status should still adhere to the global interface admin-status.
How I verified it