[sflow] Add egress sflow support. (#14630)

* [sflow] Add egress sflow support.
- Updated sonic-yang-model
- change hsflowd version to 2.0.45
This commit is contained in:
Rajkumar-Marvell 2023-06-06 23:53:39 +05:30 committed by GitHub
parent 084d012749
commit 94790bef04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 39 additions and 3 deletions

View File

@ -1,6 +1,6 @@
# host-sflow package # host-sflow package
HSFLOWD_VERSION = 2.0.35 HSFLOWD_VERSION = 2.0.45
HSFLOWD_SUBVERSION = 1 HSFLOWD_SUBVERSION = 1
export ENABLE_SFLOW_DROPMON export ENABLE_SFLOW_DROPMON

View File

@ -1776,7 +1776,8 @@ SFLOW
| Field | Description | Mandatory | Default | Reference | | Field | Description | Mandatory | Default | Reference |
|------------------|-----------------------------------------------------------------------------------------|-------------|-----------|-------------------------------------------| |------------------|-----------------------------------------------------------------------------------------|-------------|-----------|-------------------------------------------|
| admin_state | Global sflow admin state | | down | | | admin_state | Global sflow admin state | | down |
| sample_direction | Global sflow sample direction | | rx | |
| polling_interval | The interval within which sFlow data is collected and sent to the configured collectors | | 20 | | | polling_interval | The interval within which sFlow data is collected and sent to the configured collectors | | 20 | |
| agent_id | Interface name | | | PORT:name,PORTCHANNEL:name,MGMT_PORT:name, VLAN:name | | agent_id | Interface name | | | PORT:name,PORTCHANNEL:name,MGMT_PORT:name, VLAN:name |
@ -1788,7 +1789,7 @@ key - port
| port | Sets sflow session table attributes for either all interfaces or a specific Ethernet interface. | | | PORT:name | | port | Sets sflow session table attributes for either all interfaces or a specific Ethernet interface. | | | PORT:name |
| admin_state | Per port sflow admin state | | up | | | admin_state | Per port sflow admin state | | up | |
| sample_rate | Sets the packet sampling rate. The rate is expressed as an integer N, where the intended sampling rate is 1/N packets. | | | | | sample_rate | Sets the packet sampling rate. The rate is expressed as an integer N, where the intended sampling rate is 1/N packets. | | | |
| sample_direction| Per port sflow sample direction | | rx
SFLOW_COLLECTOR SFLOW_COLLECTOR
key - name key - name

View File

@ -144,6 +144,7 @@
{ {
"port": "Ethernet0", "port": "Ethernet0",
"admin_state": "up", "admin_state": "up",
"sample_direction": "both",
"sample_rate": "40000" "sample_rate": "40000"
} }
] ]
@ -158,6 +159,7 @@
{ {
"port": "Ethernet4", "port": "Ethernet4",
"admin_state": "down", "admin_state": "down",
"sample_direction": "tx",
"sample_rate": "32768" "sample_rate": "32768"
} }
] ]
@ -242,6 +244,7 @@
"global": { "global": {
"agent_id": "Ethernet0", "agent_id": "Ethernet0",
"admin_state": "up", "admin_state": "up",
"sample_direction": "both",
"polling_interval": "20" "polling_interval": "20"
} }
} }

View File

@ -32,10 +32,28 @@ module sonic-sflow{
description "SFLOW yang Module for SONiC OS"; description "SFLOW yang Module for SONiC OS";
revision 2023-04-11 {
description "Add direction command to support egress sflow";
}
revision 2021-04-26 { revision 2021-04-26 {
description "First Revision"; description "First Revision";
} }
typedef sample_direction {
type enumeration {
enum rx {
description "rx direction";
}
enum tx {
description "tx direction";
}
enum both {
description "Both tx and rx direction";
}
}
}
container sonic-sflow { container sonic-sflow {
container SFLOW_COLLECTOR { container SFLOW_COLLECTOR {
@ -111,6 +129,13 @@ module sonic-sflow{
} }
description "Sets the packet sampling rate. The rate is expressed as an integer N, where the intended sampling rate is 1/N packets."; description "Sets the packet sampling rate. The rate is expressed as an integer N, where the intended sampling rate is 1/N packets.";
} }
leaf sample_direction {
type sample_direction;
default "rx";
description "sflow sample direction";
}
} /* end of list SFLOW_SESSION_LIST */ } /* end of list SFLOW_SESSION_LIST */
} /* end of container SFLOW_SESSION */ } /* end of container SFLOW_SESSION */
@ -156,6 +181,13 @@ module sonic-sflow{
} }
description "Interface name"; description "Interface name";
} }
leaf sample_direction {
type sample_direction;
default "rx";
description "sflow sample direction";
}
} /* end of container global */ } /* end of container global */
} /* end of container SFLOW */ } /* end of container SFLOW */