Skip to content

Fix for SFLOW-1 to work with non-default sampling rate#3978

Merged
dplore merged 2 commits intoopenconfig:mainfrom
b4firex:singh-prem/sflow_1
Jul 30, 2025
Merged

Fix for SFLOW-1 to work with non-default sampling rate#3978
dplore merged 2 commits intoopenconfig:mainfrom
b4firex:singh-prem/sflow_1

Conversation

@singh-prem
Copy link
Copy Markdown
Contributor

This PR adds a deviation to allow a different ingress sampling rate than 1/1,000,000 for platforms.
No change is needed for a platform that supports default ingress sampling rate.

@singh-prem singh-prem requested a review from a team as a code owner March 12, 2025 12:29
@OpenConfigBot
Copy link
Copy Markdown

OpenConfigBot commented Mar 12, 2025

Pull Request Functional Test Report for #3978 / ec04da6

Virtual Devices

Device Test Test Documentation Job Raw Log
Arista cEOS status
SFLOW-1: sFlow Configuration and Sampling
Cisco 8000E status
SFLOW-1: sFlow Configuration and Sampling
Cisco XRd status
SFLOW-1: sFlow Configuration and Sampling
Juniper ncPTX status
SFLOW-1: sFlow Configuration and Sampling
Nokia SR Linux status
SFLOW-1: sFlow Configuration and Sampling
Openconfig Lemming status
SFLOW-1: sFlow Configuration and Sampling

Hardware Devices

Device Test Test Documentation Raw Log
Arista 7808 status
SFLOW-1: sFlow Configuration and Sampling
Cisco 8808 status
SFLOW-1: sFlow Configuration and Sampling
Juniper PTX10008 status
SFLOW-1: sFlow Configuration and Sampling
Nokia 7250 IXR-10e status
SFLOW-1: sFlow Configuration and Sampling

Help

Copy link
Copy Markdown

@masood-shah masood-shah left a comment

Choose a reason for hiding this comment

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

this implements the use of the deviation but doesnt explain why the default might be unsupported or where the value 262144 comes from. could you please link the specific technical reference (eg, Cisco doc ID, bug) that documents this platform's min supported ingress sFlow sampling rate and the technical justification for its deviation from the default within this test suite?

@dplore
Copy link
Copy Markdown
Member

dplore commented Apr 16, 2025

this implements the use of the deviation but doesnt explain why the default might be unsupported or where the value 262144 comes from. could you please link the specific technical reference (eg, Cisco doc ID, bug) that documents this platform's min supported ingress sFlow sampling rate and the technical justification for its deviation from the default within this test suite?

We need to decide if the deviated sample rate is acceptable for this test? The 1/1,000,000 rate was our operational standard. If we want to allow different rates or a range of rates, this test is the place to specify it. Can you help figure out our requirement @masood-shah ?

@masood-shah
Copy link
Copy Markdown

this implements the use of the deviation but doesnt explain why the default might be unsupported or where the value 262144 comes from. could you please link the specific technical reference (eg, Cisco doc ID, bug) that documents this platform's min supported ingress sFlow sampling rate and the technical justification for its deviation from the default within this test suite?

We need to decide if the deviated sample rate is acceptable for this test? The 1/1,000,000 rate was our operational standard. If we want to allow different rates or a range of rates, this test is the place to specify it. Can you help figure out our requirement @masood-shah ?

this implements the use of the deviation but doesnt explain why the default might be unsupported or where the value 262144 comes from. could you please link the specific technical reference (eg, Cisco doc ID, bug) that documents this platform's min supported ingress sFlow sampling rate and the technical justification for its deviation from the default within this test suite?

We need to decide if the deviated sample rate is acceptable for this test? The 1/1,000,000 rate was our operational standard. If we want to allow different rates or a range of rates, this test is the place to specify it. Can you help figure out our requirement @masood-shah ?

Happy to help, but first, could someone explain how the values 1/1,000,000 and 262,144 were derived or determined?

@arvbaska1
Copy link
Copy Markdown
Contributor

this implements the use of the deviation but doesnt explain why the default might be unsupported or where the value 262144 comes from. could you please link the specific technical reference (eg, Cisco doc ID, bug) that documents this platform's min supported ingress sFlow sampling rate and the technical justification for its deviation from the default within this test suite?

the min. and max. supported sample rate can differ based on platforms, for 8000 it can sample from 1:1 to 1:262144
sample rate. This documented below.
https://www.cisco.com/c/en/us/td/docs/iosxr/cisco8000/netflow/configuration/b-netflow-configuration-ios-xr-8000/netflow-sflow-key-concepts.html#flow-sampler

Comment thread internal/cfgplugins/sflow.go Outdated
c.SampleSize = ygot.Uint16(256)
c.IngressSamplingRate = ygot.Uint32(1000000)
// override ingress sampling rate if default value of 1000000 is not supported
c.SetIngressSamplingRate(deviations.SflowIngressMinSamplingRate(d))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This needs to be wrapped with a conditional (if the deviation exists, then use it).
for example:

		if deviations.SflowIngressMinSamplingRate(d) {
			switch d.Vendor() {
			case ondatra.CISCO:
             		        c.SetIngressSamplingRate(deviations.SflowIngressMinSamplingRate(d))
			}
		} else {
		        c.IngressSamplingRate = ygot.Uint32(1000000)
		}

It is still up to @masood-shah to decide to approve

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Masood approved, so we just need to see the if statement implemented and then we can merge it

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

sure, ack.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@dplore Could you help review the PR (run the checks) , the requested changes have been made

@singh-prem singh-prem reopened this Jul 30, 2025
@coveralls
Copy link
Copy Markdown

coveralls commented Jul 30, 2025

Pull Request Test Coverage Report for Build 16622485930

Details

  • 0 of 84 (0.0%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.05%) to 13.559%

Changes Missing Coverage Covered Lines Changed/Added Lines %
internal/deviations/deviations.go 0 3 0.0%
internal/cfgplugins/sflow.go 0 8 0.0%
proto/metadata_go_proto/metadata.pb.go 0 73 0.0%
Totals Coverage Status
Change from base Build 16612959286: -0.05%
Covered Lines: 2093
Relevant Lines: 15436

💛 - Coveralls

@dplore dplore merged commit 940ded3 into openconfig:main Jul 30, 2025
27 checks passed
goabhinav pushed a commit to goabhinav/featureprofiles that referenced this pull request Aug 19, 2025
nikunj-arista pushed a commit to nikunj-arista/featureprofiles that referenced this pull request Aug 21, 2025
nsadhasivam pushed a commit to nsadhasivam/featureprofiles that referenced this pull request Oct 26, 2025
priyaranjannanda pushed a commit to priyaranjannanda/featureprofiles that referenced this pull request Jan 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants