Skip to content

Commit b23ad67

Browse files
authored
[Arista] Add QOS and buffer profiles for SKU Arista-7800R3-48CQM2-C48 (#10752)
* Add QOS and buffer profiles for Arista SKU. * Add unit test for SKU Arista-7800R3-48CQM2-C48.
1 parent 70e2727 commit b23ad67

File tree

5 files changed

+119
-2
lines changed

5 files changed

+119
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
{%- set default_topo = 't2' %}
2+
{%- include 'buffers_config.j2' %}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{%- set default_cable = '5m' %}
2+
3+
{%- macro generate_port_lists(PORT_ALL) %}
4+
{# Generate list of ports #}
5+
{%- for port_idx in range(0,192,4) %}
6+
{%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %}
7+
{%- endfor %}
8+
{%- endmacro %}
9+
10+
{%- macro generate_buffer_pool_and_profiles() %}
11+
"BUFFER_POOL": {
12+
"ingress_lossless_pool": {
13+
"size": "3220805000",
14+
"type": "both",
15+
"mode": "dynamic",
16+
"xoff": "2102272"
17+
}
18+
},
19+
"BUFFER_PROFILE": {
20+
"ingress_lossless_profile": {
21+
"pool":"ingress_lossless_pool",
22+
"size":"1280",
23+
"dynamic_th":"-2",
24+
"xon_offset":"2560",
25+
"xon":"0",
26+
"xoff":"66048"
27+
},
28+
"ingress_lossy_profile": {
29+
"pool":"ingress_lossless_pool",
30+
"size":"0",
31+
"xon_offset":"0",
32+
"static_th":"30535680"
33+
},
34+
"egress_lossless_profile": {
35+
"pool":"ingress_lossless_pool",
36+
"size":"0",
37+
"static_th":"33030144"
38+
},
39+
"egress_lossy_profile": {
40+
"pool":"ingress_lossless_pool",
41+
"size":"0",
42+
"dynamic_th":"-1"
43+
}
44+
},
45+
{%- endmacro %}
46+
47+
{%- macro generate_queue_buffers(port_names) %}
48+
"BUFFER_QUEUE": {
49+
{% for port in port_names.split(',') %}
50+
"{{ port }}|3-4": {
51+
"profile" : "ingress_lossless_profile"
52+
},
53+
{% endfor %}
54+
{% for port in port_names.split(',') %}
55+
"{{ port }}|0-2": {
56+
"profile" : "egress_lossy_profile"
57+
},
58+
{% endfor %}
59+
{% for port in port_names.split(',') %}
60+
"{{ port }}|5-6": {
61+
"profile" : "egress_lossy_profile"
62+
}{% if not loop.last %},{% endif %}
63+
{% endfor %}
64+
}
65+
{%- endmacro %}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# PG lossless profiles.
2+
# speed cable size xon xoff threshold xon_offset
3+
10000 5m 1280 2560 45506 0 1280
4+
25000 5m 1280 2560 49152 0 1280
5+
40000 5m 1280 2560 49152 0 1280
6+
50000 5m 1280 2560 53248 0 1280
7+
100000 5m 1280 2560 65536 0 1280
8+
200000 5m 1280 2560 90112 0 1280
9+
400000 5m 1280 2560 135168 0 1280
10+
10000 40m 1280 2560 45506 0 1280
11+
25000 40m 1280 2560 49152 0 1280
12+
40000 40m 1280 2560 53248 0 1280
13+
50000 40m 1280 2560 57344 0 1280
14+
100000 40m 1280 2560 69632 0 1280
15+
200000 40m 1280 2560 102400 0 1280
16+
400000 40m 1280 2560 159744 0 1280
17+
10000 300m 1280 2560 49152 0 1280
18+
25000 300m 1280 2560 61440 0 1280
19+
40000 300m 1280 2560 69632 0 1280
20+
50000 300m 1280 2560 77824 0 1280
21+
100000 300m 1280 2560 114688 0 1280
22+
200000 300m 1280 2560 188416 0 1280
23+
400000 300m 1280 2560 331776 0 1280
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{%- macro generate_wred_profiles() %}
2+
"WRED_PROFILE": {
3+
"AZURE_LOSSLESS" : {
4+
"wred_green_enable" : "true",
5+
"wred_yellow_enable" : "true",
6+
"wred_red_enable" : "true",
7+
"ecn" : "ecn_all",
8+
"green_max_threshold" : "2097152",
9+
"green_min_threshold" : "250000",
10+
"yellow_max_threshold" : "2097152",
11+
"yellow_min_threshold" : "1048576",
12+
"red_max_threshold" : "2097152",
13+
"red_min_threshold" : "1048576",
14+
"green_drop_probability" : "5",
15+
"yellow_drop_probability": "5",
16+
"red_drop_probability" : "5"
17+
}
18+
},
19+
{%- endmacro %}
20+
21+
{%- include 'qos_config.j2' %}

src/sonic-config-engine/tests/test_j2files.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,8 @@ def test_qos_arista7050_render_template(self):
212212
sample_output_file = os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, 'qos-arista7050.json')
213213
assert utils.cmp(sample_output_file, self.output_file), self.run_diff(sample_output_file, self.output_file)
214214

215-
def test_qos_and_buffer_arista7800r3_48cq2_lc_render_template(self):
216-
arista_dir_path = os.path.join(self.test_dir, '..', '..', '..', 'device', 'arista', 'x86_64-arista_7800r3_48cq2_lc', 'Arista-7800R3-48CQ2-C48')
215+
def do_test_qos_and_buffer_arista7800r3_48cq2_lc_render_template(self, platform, hwsku):
216+
arista_dir_path = os.path.join(self.test_dir, '..', '..', '..', 'device', 'arista', platform, hwsku)
217217
qos_file = os.path.join(arista_dir_path, 'qos.json.j2')
218218
buffer_file = os.path.join(arista_dir_path, 'buffers.json.j2')
219219
port_config_ini_file = os.path.join(arista_dir_path, 'port_config.ini')
@@ -236,6 +236,12 @@ def test_qos_and_buffer_arista7800r3_48cq2_lc_render_template(self):
236236
sample_output_file = os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, sample_output_file)
237237
assert utils.cmp(sample_output_file, self.output_file), self.run_diff(sample_output_file, self.output_file)
238238

239+
def test_qos_and_buffer_arista7800r3_48cq2_lc_render_template(self):
240+
self.do_test_qos_and_buffer_arista7800r3_48cq2_lc_render_template('x86_64-arista_7800r3_48cq2_lc', 'Arista-7800R3-48CQ2-C48')
241+
242+
def test_qos_and_buffer_arista7800r3_48cqm2_lc_render_template(self):
243+
self.do_test_qos_and_buffer_arista7800r3_48cq2_lc_render_template('x86_64-arista_7800r3_48cqm2_lc', 'Arista-7800R3-48CQM2-C48')
244+
239245
def test_qos_dell9332_render_template(self):
240246
dell_dir_path = os.path.join(self.test_dir, '..', '..', '..', 'device', 'dell', 'x86_64-dellemc_z9332f_d1508-r0', 'DellEMC-Z9332f-O32')
241247
qos_file = os.path.join(dell_dir_path, 'qos.json.j2')

0 commit comments

Comments
 (0)