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

Correct the sflow default sample rate #1623

Merged
merged 4 commits into from
Apr 1, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions cfgmgr/sflowmgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,13 @@ namespace swss {
#define SFLOW_SAMPLE_RATE_KEY_10G "10000"
#define SFLOW_SAMPLE_RATE_KEY_1G "1000"

#define SFLOW_SAMPLE_RATE_VALUE_400G "40000"
#define SFLOW_SAMPLE_RATE_VALUE_200G "20000"
#define SFLOW_SAMPLE_RATE_VALUE_100G "10000"
#define SFLOW_SAMPLE_RATE_VALUE_50G "5000"
#define SFLOW_SAMPLE_RATE_VALUE_40G "4000"
#define SFLOW_SAMPLE_RATE_VALUE_25G "2500"
#define SFLOW_SAMPLE_RATE_VALUE_10G "1000"
#define SFLOW_SAMPLE_RATE_VALUE_1G "100"
#define SFLOW_SAMPLE_RATE_VALUE_400G "400000"
#define SFLOW_SAMPLE_RATE_VALUE_100G "100000"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add 200G speed sample rate value. It got missed in the merge I assume

#define SFLOW_SAMPLE_RATE_VALUE_50G "50000"
#define SFLOW_SAMPLE_RATE_VALUE_40G "40000"
#define SFLOW_SAMPLE_RATE_VALUE_25G "25000"
#define SFLOW_SAMPLE_RATE_VALUE_10G "10000"
#define SFLOW_SAMPLE_RATE_VALUE_1G "1000"

#define SFLOW_ERROR_SPEED_STR "error"

Expand Down
14 changes: 7 additions & 7 deletions tests/test_sflow.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
class TestSflow:
speed_rate_table = {
"400000": "40000",
"100000": "10000",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add 200G here too?

"50000": "5000",
"40000": "4000",
"25000": "2500",
"10000": "1000",
"1000": "100"
"400000": "400000",
"100000": "100000",
"50000": "50000",
"40000": "40000",
"25000": "25000",
"10000": "10000",
"1000": "1000"
}

def setup_sflow(self, dvs):
Expand Down