Skip to content

Commit

Permalink
[qos] add raw tag around the jinja2 sample code (#984)
Browse files Browse the repository at this point in the history
Signed-off-by: Ying Xie <ying.xie@microsoft.com>
  • Loading branch information
yxieca committed Apr 15, 2022
1 parent 5edbb79 commit 8837dc2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
12 changes: 12 additions & 0 deletions doc/qos/reclaim-reserved-buffer.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ The following snippet of code is to generate `PORT_INACTIVE` which contains all
They need to be moved from the middle of `buffer_template.j2` to the place just before the vendor specific template is imported, so that the vendor specific template has access to `PORT_INACTIVE`.

```json
{% raw %} # ignore this line please
{%- set PORT_ALL = [] %}

{%- if PORT is not defined %}
Expand All @@ -192,16 +193,19 @@ They need to be moved from the middle of `buffer_template.j2` to the place just

{# Import default values from device HWSKU folder #}
{%- import 'buffers_defaults_%s.j2' % filename_postfix as defs with context %}
{% endraw %} # ignore this line please
```

The vairable `port_names_inactive` also need to be generated by the following snipped of code.

```json
{% raw %} # ignore this line please
{%- set port_names_list_inactive = [] %}
{%- for port in PORT_INACTIVE %}
{%- if port_names_list_inactive.append(port) %}{%- endif %}
{%- endfor %}
{%- set port_names_inactive = port_names_list_inactive | join(',') %}
{% endraw %} # ignore this line please
```

##### 7.1.1.2 Macro to generate buffer pool and profiles #####
Expand All @@ -211,6 +215,7 @@ Zero buffer profiles should be defined for ingress/egress and lossless/lossy tra
This macro is defined in vendor specific buffer template files.

```json
{% raw %} # ignore this line please
{%- macro generate_buffer_pool_and_profiles() %}
"BUFFER_POOL": {
{%- if dynamic_mode is not defined and PORT_INACTIVE is defined and PORT_INACTIVE|length > 0 %}
Expand Down Expand Up @@ -302,6 +307,7 @@ This macro is defined in vendor specific buffer template files.
}
},
{%- endmacro %}
{% endraw %} # ignore this line please
```

##### 7.1.1.3 Macro to apply zero buffer profiles to inactive ports #####
Expand All @@ -321,6 +327,7 @@ These macros are defined in vendor specific buffer template files.
generate_profile_lists_with_inactive_ports:

```json
{% raw %} # ignore this line please
{%- macro generate_profile_lists_with_inactive_ports(port_names_active, port_names_inactive) %}
"BUFFER_PORT_INGRESS_PROFILE_LIST": {
{% for port in port_names_active.split(',') %}
Expand Down Expand Up @@ -365,11 +372,13 @@ generate_profile_lists_with_inactive_ports:
{% endif %}
}
{%- endmacro %}
{% endraw %} # ignore this line please
```

generate_pg_profiles_with_inactive_ports:

```json
{% raw %} # ignore this line please
{%- macro generate_pg_profiles(port_names_active, port_names_inactive) %}
"BUFFER_PG": {
{% for port in port_names_active.split(',') %}
Expand Down Expand Up @@ -403,11 +412,13 @@ generate_pg_profiles_with_inactive_ports:
{% endif %}
}
{%- endmacro %}
{% endraw %} # ignore this line please
```

generate_queue_buffers_with_inactive_ports:

```json
{% raw %} # ignore this line please
{%- macro generate_queue_buffers(port_names_active, port_names_inactive) %}
"BUFFER_QUEUE": {
{% for port in port_names_active.split(',') %}
Expand Down Expand Up @@ -466,6 +477,7 @@ generate_queue_buffers_with_inactive_ports:
{% endif %}
}
{%- endmacro %}
{% endraw %} # ignore this line please
```

Assume port `Ethernet0` is admin down, an example is:
Expand Down
2 changes: 1 addition & 1 deletion doc/subport/sonic-sub-port-intf-hld.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ Example configuration:
"Ethernet0.100|192.0.0.1/21": {},
"Ethernet0.100|fc0a::/112": {}
"Eth64.10": {
vlan : 100,
"vlan" : 100,
"admin_status" : "up"
},
"Eth64.10|192.168.0.1/21": {},
Expand Down
2 changes: 2 additions & 0 deletions doc/vxlan/Overlay ECMP with BFD.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,15 @@ VNET_ROUTE_TUNNEL_TABLE:{{vnet_name}}:{{prefix}}

Proposed:
```
{% raw %} # ignore this line please
VNET_ROUTE_TUNNEL_TABLE:{{vnet_name}}:{{prefix}}
"endpoint": {{ip_address1},{ip_address2},...}
"endpoint_monitor": {{ip_address1},{ip_address2},...} (OPTIONAL)
"mac_address":{{mac_address1},{mac_address2},...} (OPTIONAL)
"vni": {{vni1},{vni2},...} (OPTIONAL)
"weight": {{w1},{w2},...} (OPTIONAL)
“profile”: {{profile_name}} (OPTIONAL)
{% endraw %} # ignore this line please
```

```
Expand Down

0 comments on commit 8837dc2

Please sign in to comment.