blob: 27a7aeb739b5115ec1ce4ec28bedd7235dd7cea9 [file] [log] [blame]
Charles Chancaebcf32021-09-20 22:17:52 -07001QoS and Slicing
2===============
Daniele Moroed033562021-10-04 16:12:31 +02003
4.. _qos_configuration:
5
6Configuration
7-------------
8.. note:: QoS and slicing configuration is currently statically configured at switch startup.
9 Dynamic configuration will be supported in a next SD-Fabric release.
10
11QoS and Slicing is configured via the ``vendor_config`` portion of the Stratum Chassis Config (see :ref:`stratum_chassis_config`),
12where the queues and schedulers can be configured.
13We provide a convenient `script <https://github.com/stratum/fabric-tna/blob/main/util/gen-stratum-qos-config.py>`_
14to generate the configuration starting from a higher-level description provided via a YAML file.
15This file allows to configure the parameters for the traffic classes listed in the previous sections.
16
17Here's a list of parameters that you can configure via the YAML QoS configuration file:
18
19* ``max_cells``: Maximum number of buffer cells, depends on the ASIC SKU/revision.
20
21* ``pool_allocations``: Percentage of buffer cells allocated to each traffic class.
22 The sum should be 100. Usually, we leave a portion of the buffer ``unassigned``
23 for queues that do not have a pool (yet).
24 Example of such queues are those for the recirculation port, CPU port, etc.
25
26 .. code-block:: yaml
27
28 pool_allocations:
29 control: 1
30 realtime: 9
31 elastic: 80
32 besteffort: 9
33 unassigned: 1
34
35* **Control** Traffic Class: The available bandwidth dedicated to Control traffic is divided in *slots*.
36 Each slot has a maximum rate and burst (in packets of the given MTU).
37 A slice can use one or more slots by appropriately configuring meters in the fabric ingress pipeline.
38
39 * ``control_slot_count``: Number of slots.
40 * ``control_slot_rate_pps``: Packet per second rate of each slot.
41 * ``control_slot_burst_pkts``: Number of packets per burst of each slot.
42 * ``control_mtu_bytes``: MTU of packets for the PPS and burst values.
43
44 .. code-block:: yaml
45
46 control_slot_count: 50
47 control_slot_rate_pps: 100
48 control_slot_burst_pkts: 10
49 control_mtu_bytes: 1500
50
51* **Real-Time** Traffic Class Configuration:
52
53 * ``realtime_max_rates_bps``: List of maximum shaping rates for Real-Time queues,
54 one per slice requesting such service.
55
56 * ``realtime_max_burst_s``: Maximum amount of time that a Real-Time queue can
57 burst at the port speed. This parameter is used to limit delay for Elastic
58 queues.
59
60 .. code-block:: yaml
61
62 realtime_max_rates_bps:
63 - 45000000 # 45 Mbps
64 - 30000000 # 30 Mbps
65 - 25000000 # 25 Mbps
66 realtime_max_burst_s: 0.005 # 5 ms
67
68* **Elastic** Traffic Class Configuration:
69
70 * ``elastic_min_rates_bps``: List of minimum guaranteed rates for Elastic queues,
71 one per slice requesting such service.
72
73 .. code-block:: yaml
74
75 elastic_min_rates_bps:
76 - 100000000 # 100 Mbps
77 - 200000000 # 200 Mbps
78
79* ``port_templates`` section: List of switch port for which we want to configure
80 queues.
81
82 Every ``port_templates`` element contains:
83
84 * ``descr``: Description of the port purpose.
85
86 * ``rate_bps``: Port speed in bit per second.
87
88 * ``is_shaping_enabled``: ``true`` if the rate is enforced using shaping,
89 ``false`` if the rate is the channel speed.
90
91 * ``shaping_burst_bytes``: Burst size in bytes, meaningful only if port speed
92 is shaped (when ``is_shaping_enabled: true``).
93
94 * ``queue_count``: Number of queues assigned to the port.
95
96 * ``port_ids``: List of Stratum port IDs (:ref:`singleton_port` from Stratum Chassis Config),
97 using this port template. Used for port that corresponds to switch front-panel ports.
98
99 Mutually exclusive with ``sdk_port_ids`` field.
100
101 * ``sdk_port_ids``: List of SDK port numbers (i.e., Tofino DP_ID) using this port template.
102 Used for internal ports (e.g., recirculation ports).
103
104 Mutually exclusive with ``port_ids`` field.
105
106 .. code-block:: yaml
107
108 port_templates:
109 - descr: "Base station"
110 rate_bps: 1000000000 # 1 Gbps
111 is_shaping_enabled: true
112 shaping_burst_bytes: 18000 # 2x jumbo frames
113 queue_count: 16
114 port_ids:
115 - 100
116 - descr: "Servers"
117 port_ids:
118 - 200
119 rate_bps: 40000000000 # 40 Gbps
120 is_shaping_enabled: false
121 queue_count: 16
122 - descr: "Recirculation"
123 sdk_port_ids:
124 - 68
125 rate_bps: 100000000000 # 100 Gbps
126 is_shaping_enabled: false
127 queue_count: 16
128
129An example of a complete QoS and Slicing configuration can be found `here <https://github.com/stratum/fabric-tna/blob/main/util/sample-qos-config.yaml>`_.