[sflow] Add egress sflow support.#14630
[sflow] Add egress sflow support.#14630prsunny merged 2 commits intosonic-net:masterfrom rajkumar38:master
Conversation
- Updated sonic-yang-model - change hsflowd version to 2.0.45 Signed-off-by: rajkumar38 <[email protected]>
Signed-off-by: rajkumar38 <[email protected]>
| @@ -1,6 +1,6 @@ | |||
| # host-sflow package | |||
|
|
|||
| HSFLOWD_VERSION = 2.0.35 | |||
There was a problem hiding this comment.
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.
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 { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
|
@Gokulnath-Raja , please signoff |
|
@qiluo-msft @xumia @lguohan |
* [sflow] Add egress sflow support. - 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
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)
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)