-
Notifications
You must be signed in to change notification settings - Fork 1.8k
[sflow] Add egress sflow support. #14630
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,10 +32,28 @@ module sonic-sflow{ | |
|
|
||
| description "SFLOW yang Module for SONiC OS"; | ||
|
|
||
| revision 2023-04-11 { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In https://github.com/openconfig/public/blob/master/release/models/sampling/openconfig-sampling-sflow.yang egress-sampling-rate supported at global level and per interface level ? How do we map sonic-sflow.yang to https://github.com/openconfig/public/blob/master/release/models/sampling/openconfig-sampling-sflow.yang ? or we don't support egress-sampling-rate configuration at all in SONIC?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As per sflow spec, sampling rate has to be symmetrical on an interface. Pls check the review discussion in HLD. And openconfig model is not aligned to this. Based on the discussion, it was decided to have single sample-rate variable and manage the direction using "sample-direction" which is available at global and interface level. With this model, egress sampling is achieved by setting sample-direction to either "tx" or "both". |
||
| description "Add direction command to support egress sflow"; | ||
| } | ||
|
|
||
| revision 2021-04-26 { | ||
| description "First Revision"; | ||
| } | ||
|
|
||
| typedef sample_direction { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As per https://github.com/openconfig/public/blob/master/release/models/sampling/openconfig-sampling-sflow.yang it assumes that the interface will perform both ingress and egress sampling without the need of direction leaf? If that is the case when we support latest https://github.com/openconfig/public/blob/master/release/models/sampling/openconfig-sampling-sflow.yang in community sonic we should always populate direction as "both" in sonic-flow.yang?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As mentioned in above comment, as per sflow spec, an interface must have same sample-rate on ingress and egress. Since initial support in SONiC was handling only Ingress, default value is set to "rx" for backward compatibility. Pls check HLD for more info. |
||
| type enumeration { | ||
| enum rx { | ||
| description "rx direction"; | ||
| } | ||
| enum tx { | ||
| description "tx direction"; | ||
| } | ||
| enum both { | ||
| description "Both tx and rx direction"; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| container sonic-sflow { | ||
|
|
||
| container SFLOW_COLLECTOR { | ||
|
|
@@ -111,6 +129,13 @@ module sonic-sflow{ | |
| } | ||
| description "Sets the packet sampling rate. The rate is expressed as an integer N, where the intended sampling rate is 1/N packets."; | ||
| } | ||
|
|
||
| leaf sample_direction { | ||
| type sample_direction; | ||
| default "rx"; | ||
| description "sflow sample direction"; | ||
| } | ||
|
|
||
| } /* end of list SFLOW_SESSION_LIST */ | ||
| } /* end of container SFLOW_SESSION */ | ||
|
|
||
|
|
@@ -156,6 +181,13 @@ module sonic-sflow{ | |
| } | ||
| description "Interface name"; | ||
| } | ||
|
|
||
| leaf sample_direction { | ||
| type sample_direction; | ||
| default "rx"; | ||
| description "sflow sample direction"; | ||
| } | ||
|
|
||
| } /* end of container global */ | ||
| } /* end of container SFLOW */ | ||
|
|
||
|
|
||
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.
Any reason for not using latest version 2.0.51 ? or stable previous versions such as 2.0.49?
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.
No specific reason. Egress sample support was added in 2.0.45. Hence updated to this version.