Skip to content

[sflow] Add egress sflow support.#14630

Merged
prsunny merged 2 commits intosonic-net:masterfrom
rajkumar38:master
Jun 6, 2023
Merged

[sflow] Add egress sflow support.#14630
prsunny merged 2 commits intosonic-net:masterfrom
rajkumar38:master

Conversation

@rajkumar38
Copy link
Copy Markdown
Contributor

  • Updated sonic-yang-model
  • change hsflowd version to 2.0.45

Why I did it

New enhancement added to current sflow to support egress sampling at port level.
sonic-net/SONiC#1268

Work item tracking
  • Microsoft ADO (number only):

How I did it

Added new command, yang and swss changes.
sonic-net/sonic-utilities#2790
sonic-net/sonic-swss#2731

How to verify it

Compile and loaded the sonic bin with all changes.

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211

Tested branch (Please provide the tested image version)

Description for the changelog

Egress Sflow support.

Link to config_db schema for YANG module changes

https://github.com/sonic-net/sonic-buildimage/blob/master/src/sonic-yang-models/doc/Configuration.md#sflow

A picture of a cute animal (not mandatory but encouraged)

- Updated sonic-yang-model
- change hsflowd version to 2.0.45

Signed-off-by: rajkumar38 <[email protected]>
@@ -1,6 +1,6 @@
# host-sflow package

HSFLOWD_VERSION = 2.0.35
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.

Any reason for not using latest version 2.0.51 ? or stable previous versions such as 2.0.49?

Copy link
Copy Markdown
Contributor Author

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.


description "SFLOW yang Module for SONiC OS";

revision 2023-04-11 {
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.

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?

Copy link
Copy Markdown
Contributor Author

@rajkumar38 rajkumar38 Apr 19, 2023

Choose a reason for hiding this comment

The 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 "First Revision";
}

typedef sample_direction {
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.

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The 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.

@prsunny
Copy link
Copy Markdown
Contributor

prsunny commented May 30, 2023

@Gokulnath-Raja , please signoff

@rajkumar38
Copy link
Copy Markdown
Contributor Author

@qiluo-msft @xumia @lguohan
Can you pls review/approve this PR .

@prsunny prsunny merged commit 94790be into sonic-net:master Jun 6, 2023
sonic-otn pushed a commit to sonic-otn/sonic-buildimage that referenced this pull request Sep 20, 2023
* [sflow] Add egress sflow support.
- Updated sonic-yang-model
- change hsflowd version to 2.0.45
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.

4 participants