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

[Dynamic buffer calc] Add table descriptions for dynamic buffer calculation to the documents #1664

Merged
merged 1 commit into from
Mar 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 98 additions & 2 deletions doc/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@ Table of Contents
* [Cable length](#cable-length)
* [COPP_TABLE](#copp_table)
* [CRM](#crm)
* [Data Plane L3 Interfaces](#data-plane-l3-interfaces)
* [Data Plane L3 Interfaces](#data-plane-l3-interfaces)
* [DEFAULT_LOSSLESS_BUFFER_PARAMETER](#DEFAULT_LOSSLESS_BUFFER_PARAMETER)
* [Device Metadata](#device-metadata)
* [Device neighbor metada](#device-neighbor-metada)
* [DSCP_TO_TC_MAP](#dscp_to_tc_map)
* [FLEX_COUNTER_TABLE](#flex_counter_table)
* [L2 Neighbors](#l2-neighbors)
* [Loopback Interface](#loopback-interface)
* [LOSSLESS_TRAFFIC_PATTERN](#LOSSLESS_TRAFFIC_PATTERN)
* [Management Interface](#management-interface)
* [Management port](#management-port)
* [Management VRF](#management-vrf)
Expand Down Expand Up @@ -334,6 +336,8 @@ group name and IP ranges in **BGP_PEER_RANGE** table.

### BUFFER_PG

When the system is running in traditional buffer model, profiles needs to explicitly configured:

```
{
"BUFFER_PG": {
Expand All @@ -351,8 +355,32 @@ group name and IP ranges in **BGP_PEER_RANGE** table.

```

When the system is running in dynamic buffer model, profiles can be:

- either calculated dynamically according to ports' configuration and just configured as "NULL";
- or configured explicitly.

```
{
"BUFFER_PG": {
"Ethernet0|3-4": {
"profile": "NULL"
},
"Ethernet1|3-4": {
"profile": "NULL"
},
"Ethernet2|3-4": {
"profile": "[BUFFER_PROFILE|static_profile]"
}
}
}

```

### Buffer pool

When the system is running in traditional buffer model, the size of all of the buffer pools and xoff of ingress_lossless_pool need to be configured explicitly.

```
{
"BUFFER_POOL": {
Expand All @@ -377,6 +405,29 @@ group name and IP ranges in **BGP_PEER_RANGE** table.

```

When the system is running in dynamic buffer model, the size of some of the buffer pools can be omitted and will be dynamically calculated.

```
{
"BUFFER_POOL": {
"egress_lossless_pool": {
"type": "egress",
"mode": "static",
"size": "15982720"
},
"egress_lossy_pool": {
"type": "egress",
"mode": "dynamic",
},
"ingress_lossless_pool": {
"type": "ingress",
"mode": "dynamic",
}
}
}

```


### Buffer profile

Expand Down Expand Up @@ -419,6 +470,19 @@ group name and IP ranges in **BGP_PEER_RANGE** table.

```

When the system is running in dynamic buffer model and the headroom_type is dynamic, only dynamic_th needs to be configured and rest of fields can be omitted.
This kind of profiles will be handled by buffer manager and won't be applied to SAI.

```
{
{
"non_default_dynamic_th_profile": {
"dynamic_th": 1,
"headroom_type": "dynamic"
}
}
}
```

### Buffer queue

Expand Down Expand Up @@ -588,6 +652,21 @@ attributes.
```


### DEFAULT_LOSSLESS_BUFFER_PARAMETER

This table stores the default lossless buffer parameters for dynamic buffer calculation.

```
{
"DEFAULT_LOSSLESS_BUFFER_PARAMETER": {
"AZURE": {
"default_dynamic_th": "0",
"over_subscribe_ratio": "2"
}
}
}
```

### Device Metadata

The **DEVICE_METADATA** table contains only one object named
Expand All @@ -609,7 +688,8 @@ instance is supported in SONiC.
"default_pfcwd_status": "disable",
"bgp_asn": "65100",
"deployment_id": "1",
"type": "ToRRouter"
"type": "ToRRouter",
"buffer_model": "traditional"
}
}
}
Expand Down Expand Up @@ -746,6 +826,22 @@ interface objects.

```

### LOSSLESS_TRAFFIC_PATTERN

The LOSSLESS_TRAFFIC_PATTERN table stores parameters related to
lossless traffic for dynamic buffer calculation

```
{
"LOSSLESS_TRAFFIC_PATTERN": {
"AZURE": {
"mtu": "1024",
"small_packet_percentage": "100"
}
}
}
```

### Management Interface

Management interfaces are defined in **MGMT_INTERFACE** table. Object
Expand Down
61 changes: 61 additions & 0 deletions doc/swss-schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -803,6 +803,59 @@ packet_action = "drop" | "forward" | "copy" | "copy_cancel" | "trap" | "log" | "
nexthop = IP ; Nexthop IP address (Optional)
ifname = ifname ; Interface name

### BUFFER_POOL_TABLE
;Stores buffer pools

key = BUFFER_POOL_TABLE:poolname ; The poolname can be one of ingress_lossless_pool, ingress_lossy_pool, egress_lossless_pool, and egress_lossy_pool or other used-defined pools.
mode = "dynamic" / "static" ; Whether the pool uses dynamic threshold or static threshold.
type = "ingress" / "egress" ; Whether the pool serves for ingress or egress traffic
size = 1*10DIGIT ; The size of the shared buffer pool
xoff = 1*10DIGIT ; The size of the shared headroom pool. Available only for ingress_lossless_pool.

### BUFFER_PROFILE_TABLE
;Stores buffer profiles

key = BUFFER_PROFILE_TABLE:profilename ; profile name can be predefined or dynamically generated with name convention "pg_lossless_<speed>_<cable_length>_profile"
pool = reference to BUFFER_POOL_TABLE object
xon = 1*6DIGIT ; The xon threshold. The switch stops sending PFC frame when the buffer occupancy drops to this threshold.
xon_offset = 1*6DIGIT ; The xon offset. If both xon and xon_offset have been defined, the switch stops sending PFC frame
; when the buffer occupancy drops to xon or size of buffer pool size minus xon_offset, whichever is larger.
xoff = 1*6DIGIT ; The xoff threshold. The switch starts sending PFC frame when the buffer occupancy rises to this threshold.
size = 1*6DIGIT ; The reserved size of the PG or queue referencing this buffer profile.
dynamic_th = 1*2DIGIT ; For dynamic pools, representing the proportion of currently available memory in the pool the PG or queue can occupy.
; It is calculated as:
; alpha = 2 ^ dynamic_th;
; proportion = alpha / (1 + alpha)
static_th = 1*10DIGIT ; For static pools, representing the threshold in bytes the PG or queue can occupy.

### BUFFER_PG_TABLE
;Stores buffer PG (priority-groups)

key = BUFFER_PG_TABLE:port_name:pg ; The pg consists of a single number representing a single priority or two numbers connected by a dash representing a range of priorities.
; By default, PG 0 for lossy traffic and PG 3-4 for lossless traffic.
profile = reference to BUFFER_PROFILE_TABLE object

### BUFFER_QUEUE_TABLE
;Stores buffer queue

key = BUFFER_QUEUE_TABLE:port_name:queue ; The queue consists of a single number representing a single priority or two numbers connected by a dash representing a range of priorities.
; By default, queue 0-2 and 5-6 for lossy traffic and queue 3-4 for lossless traffic
profile = reference to BUFFER_PROFILE_TABLE object

### BUFFER_PORT_INGRESS_PROFILE_LIST_TABLE
;Stores per port buffer threshold on ingress side

key = BUFFER_PORT_INGRESS_PROFILE_LIST_TABLE:port_name
profile_list = a list of references to BUFFER_PROFILE_TABLE object ; Typically, for each ingress buffer pools there should be a buffer profile referencing the pool in the list.
; For example, if there are two ingress buffer pools in the system, ingress_lossless_pool and ingress_lossy_pool,
; there should be two profiles in the list: ingress_lossless_profile and ingress_lossy_profile

### BUFFER_PORT_EGRESS_PROFILE_LIST_TABLE
;Stores per port buffer threshold on egress side

key = BUFFER_PORT_EGRESS_PROFILE_LIST_TABLE:port_name
profile_list = a list of references to BUFFER_PROFILE_TABLE object ; Similar to profile_list in BUFFER_PORT_INGRESS_PROFILE_LIST_TABLE but on egress side.

## Configuration DB schema

### PORT_TABLE
Expand Down Expand Up @@ -994,6 +1047,14 @@ Stores information for physical switch ports managed by the switch chip. Ports t
key = VRF_OBJECT_TABLE|vrf_name ; vrf_name start with 'Vrf' prefix
state = "ok" ; vrf entry exist in orchagent

### BUFFER_MAX_PARAM_TABLE
;Available only when the switch is running in dynamic buffer model
;Stores the maximum available buffer on a global or per-port basis

key = BUFFER_MAX_PARAM_TABLE|ifname ; The maximum headroom of the port. The ifname should be the name of a physical port.
BUFFER_MAX_PARAM_TABLE|global ; The maximum available of the system.
mmu_size = 1*10DIGIT ; The maximum available of the system. Available only when the key is "global".
max_headroom_size = 1*10DIGIT ; The maximum headroom of the port. Available only when the key is ifname.

## Configuration files
What configuration files should we have? Do apps, orch agent each need separate files?
Expand Down