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

For sflow feature, SAI changes needed for sonic-vs platform #498

Merged
merged 3 commits into from
Sep 15, 2019

Conversation

rakeshdatta
Copy link
Contributor

@rakeshdatta rakeshdatta commented Jul 31, 2019

  • What I did

Add SAI library changes to support sflow in sonic-vs.

  • How I did it

When sflow is configured using CLI or other supported mechanisms, the orch-agent invokes
the SAI API set_port_attribute(). For the sflow feature, his API is used to set the SAI_PORT_ATTR_INGRESS_SAMPLEPACKET_ENABLE attribute of a netdev port. The value stored for this attribute is a samplepacket object, which essentially contains various sampling attributes (sampling rate, sampler group etc.) associated with the port.

When sampling is disabled on a port, the SAI_PORT_ATTR_INGRESS_SAMPLEPACKET_ENABLE attribute is set to a null object.
When sampling is enabled on a port, the SAI_PORT_ATTR_INGRESS_SAMPLEPACKET_ENABLE attribute is set to a valid samplepacket object.

For sonic-vs, in the absence of a real ASIC programming, the 'tc' command is used instead to configure the sampling parameters inside the kernel. In this PR we invoke the appropriate 'tc' command, based on the requested config actions (disable or enable or update).

Signed-off-by: Rakesh Datta [email protected]

…ling is configured on a port.

          This is applicable only for sflow feature running on sonic VS.

Signed-off-by: Rakesh Datta <[email protected]>
@msftclas
Copy link

msftclas commented Jul 31, 2019

CLA assistant check
All CLA requirements met.

@lguohan lguohan requested a review from kcudnik July 31, 2019 20:42
@rakeshdatta rakeshdatta changed the title [WIP] sflow related SAI changes for sonic-vs platform [WIP]For sflow feature, SAI changes needed for sonic-vs platform Jul 31, 2019
* Update: modified some words to pass the spell-check error

Signed-off-by: Rakesh Datta <[email protected]>
vslib/inc/sai_vs_state.h Show resolved Hide resolved
vslib/src/sai_vs_switch.cpp Outdated Show resolved Hide resolved
 * Bugfix: Updation of sampling rate is creating multiple 'tc filter' entries

Signed-off-by: Rakesh Datta <[email protected]>
@rakeshdatta rakeshdatta changed the title [WIP]For sflow feature, SAI changes needed for sonic-vs platform For sflow feature, SAI changes needed for sonic-vs platform Sep 4, 2019
@lguohan lguohan merged commit 38c6945 into sonic-net:master Sep 15, 2019
pettershao-ragilenetworks pushed a commit to pettershao-ragilenetworks/sonic-sairedis that referenced this pull request Nov 18, 2022
When sflow is configured using CLI or other supported mechanisms, the orch-agent invokes
the SAI API set_port_attribute(). For the sflow feature, his API is used to set the SAI_PORT_ATTR_INGRESS_SAMPLEPACKET_ENABLE attribute of a netdev port. The value stored for this attribute is a samplepacket object, which essentially contains various sampling attributes (sampling rate, sampler group etc.) associated with the port.

When sampling is disabled on a port, the SAI_PORT_ATTR_INGRESS_SAMPLEPACKET_ENABLE attribute is set to a null object.
When sampling is enabled on a port, the SAI_PORT_ATTR_INGRESS_SAMPLEPACKET_ENABLE attribute is set to a valid samplepacket object.

For sonic-vs, in the absence of a real ASIC programming, the 'tc' command is used instead to configure the sampling parameters inside the kernel. In this PR we invoke the appropriate 'tc' command, based on the requested config actions (disable or enable or update).

Signed-off-by: Rakesh Datta <[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.

5 participants