Skip to content

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

Merged
lguohan merged 3 commits intosonic-net:masterfrom
rakeshdatta:sflow-vslib
Sep 15, 2019
Merged

For sflow feature, SAI changes needed for sonic-vs platform#498
lguohan merged 3 commits intosonic-net:masterfrom
rakeshdatta:sflow-vslib

Conversation

@rakeshdatta
Copy link
Copy Markdown
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
Copy Markdown

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]>
 * 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