-
Notifications
You must be signed in to change notification settings - Fork 1.8k
[Mellanox] Enabling Per-Queue, Per-Priority, Per-Direction QoS Buffer/Scheduler/WRED Configurations #22869
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
[Mellanox] Enabling Per-Queue, Per-Priority, Per-Direction QoS Buffer/Scheduler/WRED Configurations #22869
Changes from all commits
fa0bc04
1337dc7
4b421ab
3098b65
b37615f
a3e0270
38c5af3
206503f
d1322bb
ca0c44c
8afcf64
7d92b99
e98957f
a6e79e7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../../x86_64-nvidia_sn5600-r0/Mellanox-SN5600-C256S1/traffic_config.j2 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,6 +16,59 @@ | |
| limitations under the License. | ||
| #} | ||
|
|
||
| {% import 'traffic_config.j2' as traffic_config %} | ||
|
|
||
| {%- set PORT_ALL = [] %} | ||
| {%- set PORT_ACTIVE = [] %} | ||
| {%- set PORT_UPLINK = [] %} | ||
| {%- set PORT_DOWNLINK = [] %} | ||
|
|
||
| {# Initialize PORT_ALL and PORT_ACTIVE #} | ||
| {%- for port in PORT %} | ||
| {%- if not port.startswith('Ethernet-Rec') and not port.startswith('Ethernet-IB') %} | ||
| {%- if PORT_ALL.append(port) %}{% endif %} | ||
| {%- endif %} | ||
| {%- endfor %} | ||
|
|
||
| {%- if DEVICE_NEIGHBOR is not defined %} | ||
| {%- set PORT_ACTIVE = PORT_ALL %} | ||
| {%- else %} | ||
| {%- for port in DEVICE_NEIGHBOR.keys() %} | ||
| {%- if PORT_ACTIVE.append(port) %}{%- endif %} | ||
| {%- endfor %} | ||
| {%- endif %} | ||
|
|
||
| {# Generate uplink and downlink port lists based on router type and neighbors #} | ||
| {%- if DEVICE_METADATA is defined and DEVICE_METADATA['localhost'] is defined %} | ||
| {%- if 'type' in DEVICE_METADATA['localhost'] and DEVICE_NEIGHBOR is defined %} | ||
| {%- set local_router_type = DEVICE_METADATA['localhost']['type'] %} | ||
| {%- for port in PORT_ACTIVE %} | ||
| {%- if DEVICE_NEIGHBOR.get(port) and DEVICE_NEIGHBOR[port].name is defined and DEVICE_NEIGHBOR_METADATA is defined and DEVICE_NEIGHBOR[port].name in DEVICE_NEIGHBOR_METADATA %} | ||
| {%- set neighbor_info = DEVICE_NEIGHBOR_METADATA[DEVICE_NEIGHBOR[port].name] %} | ||
| {%- if local_router_type == 'LeafRouter' %} | ||
| {%- if neighbor_info.type == 'ToRRouter' %} | ||
| {%- if PORT_DOWNLINK.append(port) %}{%- endif %} | ||
| {%- elif neighbor_info.type == 'SpineRouter' %} | ||
| {%- if PORT_UPLINK.append(port) %}{%- endif %} | ||
| {%- endif %} | ||
| {%- elif local_router_type == 'ToRRouter' %} | ||
| {%- if neighbor_info.type == 'LeafRouter' %} | ||
| {%- if PORT_UPLINK.append(port) %}{%- endif %} | ||
| {%- else %} | ||
| {%- if PORT_DOWNLINK.append(port) %}{%- endif %} | ||
| {%- endif %} | ||
| {%- endif %} | ||
| {%- else %} | ||
| {%- if PORT_DOWNLINK.append(port) %}{%- endif %} | ||
| {%- endif %} | ||
| {%- endfor %} | ||
| {%- else %} | ||
| {%- for port in PORT_ACTIVE %} | ||
| {%- if PORT_DOWNLINK.append(port) %}{%- endif %} | ||
| {%- endfor %} | ||
| {%- endif %} | ||
| {%- endif %} | ||
|
|
||
| {%- macro generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) %} | ||
| "BUFFER_POOL": { | ||
| {% if dynamic_mode is not defined and port_names_inactive|length > 0 -%} | ||
|
|
@@ -57,11 +110,6 @@ | |
| "size":"0", | ||
| "dynamic_th":"-8" | ||
| }, | ||
| "egress_lossless_zero_profile" : { | ||
| "pool":"egress_lossless_pool", | ||
| "size":"0", | ||
| "dynamic_th":"-8" | ||
| }, | ||
| "egress_lossy_zero_profile" : { | ||
| "pool":"egress_lossy_pool", | ||
| "size":"0", | ||
|
|
@@ -73,50 +121,98 @@ | |
| "size":"0", | ||
| "dynamic_th":"7" | ||
| }, | ||
| "egress_lossless_profile": { | ||
| "pool":"egress_lossless_pool", | ||
| "size":"0", | ||
| "dynamic_th":"7" | ||
| }, | ||
| "egress_lossy_profile": { | ||
| "pool":"egress_lossy_pool", | ||
| "size":"9216", | ||
| "dynamic_th":"-6" | ||
| }, | ||
| "queue0_lossy_profile": { | ||
| "pool":"egress_lossy_pool", | ||
| "size":"0", | ||
| "dynamic_th":"0" | ||
| "queue0_downlink_lossy_profile": { | ||
| "dynamic_th": "0", | ||
| "size": "0", | ||
| "pool": "egress_lossy_pool" | ||
| }, | ||
| "queue1_lossy_profile": { | ||
| "pool":"egress_lossy_pool", | ||
| "size":"0", | ||
| "dynamic_th":"0" | ||
| "queue1_downlink_lossy_profile": { | ||
| {% if traffic_config.traffic_classification_enable %} | ||
| "packet_discard_action": "drop", | ||
| {% endif %} | ||
| "pool": "egress_lossy_pool", | ||
| "size": "0", | ||
| "dynamic_th": "0" | ||
| }, | ||
| "queue2_lossy_profile": { | ||
| "pool":"egress_lossy_pool", | ||
| "size":"0", | ||
| "dynamic_th":"0" | ||
| "queue2_downlink_lossy_profile": { | ||
| {% if traffic_config.traffic_classification_enable %} | ||
| "packet_discard_action": "drop", | ||
| {% endif %} | ||
| "pool": "egress_lossy_pool", | ||
| "size": "0", | ||
| "dynamic_th": "0" | ||
| }, | ||
| "queue3_lossy_profile": { | ||
| "pool":"egress_lossy_pool", | ||
| "size":"0", | ||
| "dynamic_th":"0" | ||
| "queue3_downlink_lossy_profile": { | ||
| {% if traffic_config.traffic_classification_enable %} | ||
| "packet_discard_action": "drop", | ||
| {% endif %} | ||
| "pool": "egress_lossy_pool", | ||
| "size": "0", | ||
| "dynamic_th": "0" | ||
| }, | ||
| "queue4_downlink_lossy_profile": { | ||
| "pool": "egress_lossy_pool", | ||
| "size": "0", | ||
| "dynamic_th": "7" | ||
| }, | ||
| "queue5_downlink_lossy_profile": { | ||
| "pool": "egress_lossy_pool", | ||
| "size": "0", | ||
| "dynamic_th": "-3" | ||
| }, | ||
| "queue6_downlink_lossy_profile": { | ||
| "pool": "egress_lossy_pool", | ||
| "size": "0", | ||
| "dynamic_th": "0" | ||
| }, | ||
| "queue0_uplink_lossy_profile": { | ||
| "pool": "egress_lossy_pool", | ||
| "size": "0", | ||
| "dynamic_th": "0" | ||
| }, | ||
| "queue1_uplink_lossy_profile": { | ||
| {% if traffic_config.traffic_classification_enable %} | ||
| "packet_discard_action": "drop", | ||
| {% endif %} | ||
| "pool": "egress_lossy_pool", | ||
| "size": "0", | ||
| "dynamic_th": "0" | ||
| }, | ||
| "queue2_uplink_lossy_profile": { | ||
| {% if traffic_config.traffic_classification_enable %} | ||
| "packet_discard_action": "drop", | ||
| {% endif %} | ||
| "pool": "egress_lossy_pool", | ||
| "size": "0", | ||
| "dynamic_th": "0" | ||
| }, | ||
| "queue3_uplink_lossy_profile": { | ||
| {% if traffic_config.traffic_classification_enable %} | ||
| "packet_discard_action": "drop", | ||
| {% endif %} | ||
| "pool": "egress_lossy_pool", | ||
| "size": "0", | ||
| "dynamic_th": "0" | ||
| }, | ||
| "queue4_lossy_profile": { | ||
| "queue4_uplink_lossy_profile": { | ||
| "pool": "egress_lossy_pool", | ||
| "size": "0", | ||
| "dynamic_th" : "7" | ||
| "dynamic_th": "7" | ||
| }, | ||
| "queue5_lossy_profile": { | ||
| "queue5_uplink_lossy_profile": { | ||
| "pool": "egress_lossy_pool", | ||
| "size": "0", | ||
| "dynamic_th" : "-3" | ||
| "dynamic_th": "-3" | ||
| }, | ||
| "queue6_lossy_profile": { | ||
| "queue6_uplink_lossy_profile": { | ||
| "pool": "egress_lossy_pool", | ||
| "size": "0", | ||
| "dynamic_th" : "0" | ||
| "dynamic_th": "0" | ||
| } | ||
| }, | ||
| {%- endmacro %} | ||
|
|
@@ -146,7 +242,7 @@ | |
| "BUFFER_PORT_EGRESS_PROFILE_LIST": { | ||
| {% for port in port_names_active.split(',') %} | ||
| "{{ port }}": { | ||
| "profile_list" : "egress_lossless_profile,egress_lossy_profile" | ||
| "profile_list" : "egress_lossy_profile" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why only egress_lossy_profile? how about queue[0-6]_lossy_profiles?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is BUFFER_PORT_EGRESS_PROFILE_LIST. it's for port instead of queue
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Makes sense, this is not the list of all the buffer profiles associated with the port. |
||
| }{% if not loop.last %},{% endif %} | ||
|
|
||
| {% endfor %} | ||
|
|
@@ -155,9 +251,9 @@ | |
| {% for port in port_names_inactive.split(',') %} | ||
| "{{ port }}": { | ||
| {% if dynamic_mode is defined %} | ||
| "profile_list" : "egress_lossless_profile,egress_lossy_profile" | ||
| "profile_list" : "egress_lossy_profile" | ||
| {% else %} | ||
| "profile_list" : "egress_lossless_zero_profile,egress_lossy_zero_profile" | ||
| "profile_list" : "egress_lossy_zero_profile" | ||
| {% endif %} | ||
| }{% if not loop.last %},{% endif %} | ||
|
|
||
|
|
@@ -169,53 +265,54 @@ | |
| {%- macro generate_queue_buffers(port_names_active, port_names_inactive) %} | ||
| "BUFFER_QUEUE": { | ||
| {% for port in port_names_active.split(',') %} | ||
| {%- set port_type = 'uplink' if port in PORT_UPLINK else 'downlink' %} | ||
| "{{ port }}|0": { | ||
| "profile" : "queue0_lossy_profile" | ||
| "profile" : "queue0_{{ port_type }}_lossy_profile" | ||
| }, | ||
| "{{ port }}|1": { | ||
| "profile" : "queue1_lossy_profile" | ||
| "profile" : "queue1_{{ port_type }}_lossy_profile" | ||
| }, | ||
| "{{ port }}|2": { | ||
| "profile" : "queue2_lossy_profile" | ||
| "profile" : "queue2_{{ port_type }}_lossy_profile" | ||
| }, | ||
| "{{ port }}|3": { | ||
| "profile" : "queue3_lossy_profile" | ||
| "profile" : "queue3_{{ port_type }}_lossy_profile" | ||
| }, | ||
| "{{ port }}|4": { | ||
| "profile" : "queue4_lossy_profile" | ||
| "profile" : "queue4_{{ port_type }}_lossy_profile" | ||
| }, | ||
| "{{ port }}|5": { | ||
| "profile" : "queue5_lossy_profile" | ||
| "profile" : "queue5_{{ port_type }}_lossy_profile" | ||
| }, | ||
| "{{ port }}|6": { | ||
| "profile" : "queue6_lossy_profile" | ||
| "profile" : "queue6_{{ port_type }}_lossy_profile" | ||
| }{% if not loop.last %},{% endif %} | ||
|
|
||
| {% endfor %} | ||
| {% if port_names_inactive|length > 0 %} | ||
| {% if dynamic_mode is defined %} | ||
| {% if port_names_active.split(',')|length > 0 %},{% endif %} | ||
| {% for port in port_names_inactive.split(',') %} | ||
| {%- set port_type = 'uplink' if port in PORT_UPLINK else 'downlink' %} | ||
| "{{ port }}|0": { | ||
| "profile" : "queue0_lossy_profile" | ||
| "profile" : "queue0_{{ port_type }}_lossy_profile" | ||
| }, | ||
| "{{ port }}|1": { | ||
| "profile" : "queue1_lossy_profile" | ||
| "profile" : "queue1_{{ port_type }}_lossy_profile" | ||
| }, | ||
| "{{ port }}|2": { | ||
| "profile" : "queue2_lossy_profile" | ||
| "profile" : "queue2_{{ port_type }}_lossy_profile" | ||
| }, | ||
| "{{ port }}|3": { | ||
| "profile" : "queue3_lossy_profile" | ||
| "profile" : "queue3_{{ port_type }}_lossy_profile" | ||
| }, | ||
| "{{ port }}|4": { | ||
| "profile" : "queue4_lossy_profile" | ||
| "profile" : "queue4_{{ port_type }}_lossy_profile" | ||
| }, | ||
| "{{ port }}|5": { | ||
| "profile" : "queue5_lossy_profile" | ||
| "profile" : "queue5_{{ port_type }}_lossy_profile" | ||
| }, | ||
| "{{ port }}|6": { | ||
| "profile" : "queue6_lossy_profile" | ||
| "profile" : "queue6_{{ port_type }}_lossy_profile" | ||
| }{% if not loop.last %},{% endif %} | ||
| {% endfor %} | ||
| {% else %} | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this intended? over
trimThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes. @kperumalbfn could you please confirm?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please keep "drop"