Skip to content

Commit d7e8f22

Browse files
committed
UEC CSIG Protocol
Signed-off-by: JaiOCP <jai.kumar@broadcom.com>
1 parent 2ec257d commit d7e8f22

3 files changed

Lines changed: 88 additions & 100 deletions

File tree

doc/CSIG/SAI-CSIG-Spec.md

Lines changed: 79 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -147,81 +147,47 @@ The sai_tam_int_type_t enum specifies types of INT technologies supported by the
147147

148148

149149
### 4.4 TAM INT BW Interval
150-
The time interval is configured for both the available bandwidth and normalized available bandwidth computations. To support this, new enum has been defined for the configurable time interval values. Additionally, a vendor defined enum has been added to ensure support for vendor-specific time iterval implementations.
150+
The time interval is configured for both available bandwidth and normalized available bandwidth computations. Two related attributes have been introduced: switch-level attributes to query the number of timers and the specific time interval values.
151151

152-
```
153-
/**
154-
* @brief Bandwidth time interval units
155-
*/
156-
typedef enum _sai_tam_int_bw_time_interval_unit_t
157-
{
158-
/**
159-
* @brief Time interval unit nanosecond
160-
*/
161-
SAI_TAM_INT_BW_TIME_INTERVAL_UNIT_NANOSEC,
162-
163-
/**
164-
* @brief Time interval unit microsecond
165-
*/
166-
SAI_TAM_INT_BW_TIME_INTERVAL_UNIT_USEC,
167-
168-
/**
169-
* @brief Time interval unit millisecond
170-
*/
171-
SAI_TAM_INT_BW_TIME_INTERVAL_UNIT_MSEC,
172-
173-
} sai_tam_int_bw_time_interval_unit_t;
152+
The NOS must first query the supported number of timer intervals and the interval values before programming the timer interval for compact and/or wide tags for ABW and/or ABW/C signals.
174153

175-
/**
176-
* @brief BW time intervals
177-
*/
178-
typedef enum _sai_tam_int_bw_time_interval_t
179-
{
180-
/**
181-
* @brief Time window 128
182-
*/
183-
SAI_TAM_INT_BW_TIME_INTERVAL_128,
184-
185-
/**
186-
* @brief Time window 256
187-
*/
188-
SAI_TAM_INT_BW_TIME_INTERVAL_256,
189-
190-
/**
191-
* @brief Time window 384
192-
*/
193-
SAI_TAM_INT_BW_TIME_INTERVAL_384,
154+
#### 4.4.1 Switch Level Timer Attributes
155+
Switch level attributes are READ ONLY attributes to learn about implementation's capability.
194156

157+
```
195158
/**
196-
* @brief Time window 512
159+
* @brief Maximum number of timers supported for CSIG bandwidth signal
160+
*
161+
* @type sai_uint8_t
162+
* @flags READ_ONLY
197163
*/
198-
SAI_TAM_INT_BW_TIME_INTERVAL_512,
164+
SAI_SWITCH_ATTR_MAX_CSIG_TIMERS,
199165
200166
/**
201-
* @brief Time window 640
167+
* @brief CSIG Bandwidth time intervals supported in microseconds valid only for available and relative available bandwidth signal type
168+
*
169+
* @type sai_u32_list_t
170+
* @flags READ_ONLY
202171
*/
203-
SAI_TAM_INT_BW_TIME_INTERVAL_640,
172+
SAI_SWITCH_ATTR_CSIG_BW_TIME_INTERVAL_IN_USEC,
204173
205-
/**
206-
* @brief Time window 768
207-
*/
208-
SAI_TAM_INT_BW_TIME_INTERVAL_768,
174+
```
209175

210-
/**
211-
* @brief Time window 896
212-
*/
213-
SAI_TAM_INT_BW_TIME_INTERVAL_896,
176+
#### 4.4.2 TAM Level Timer Attribute
177+
Time intervals is configured as part of TAM INT object configuration for CSIG.
214178

179+
```
215180
/**
216-
* @brief Time window 1024
181+
* @brief Time interval for bandwidth computation in microseconds
182+
*
183+
* @type sai_uint32_t
184+
* @flags CREATE_AND_SET
185+
* @isvlan false
186+
* @default 128
187+
* @validonly SAI_TAM_INT_ATTR_CSIG_SIGNAL_TYPE == SAI_CSIG_SIGNAL_TYPE_ABW or SAI_TAM_INT_ATTR_CSIG_SIGNAL_TYPE == SAI_CSIG_SIGNAL_TYPE_ABWC
217188
*/
218-
SAI_TAM_INT_BW_TIME_INTERVAL_1024,
189+
SAI_TAM_INT_ATTR_BW_TIME_INTERVAL,
219190
220-
/**
221-
* @brief Vendor defined time window
222-
*/
223-
SAI_TAM_INT_BW_TIME_INTERVAL_VENDOR_DEFINED,
224-
} sai_tam_int_bw_time_interval_t;
225191
```
226192

227193
### 4.5 TAM INT Object
@@ -249,25 +215,16 @@ This object has recently been enhanced to support the new CSIG INT type, along w
249215
SAI_TAM_INT_ATTR_CSIG_SIGNAL_TYPE,
250216
251217
/**
252-
* @brief Time interval for bandwidth computation
218+
* @brief Time interval for bandwidth computation in microseconds
253219
*
254-
* @type sai_tam_int_bw_time_interval_t
220+
* @type sai_uint32_t
255221
* @flags CREATE_AND_SET
256-
* @default SAI_TAM_INT_BW_TIME_INTERVAL_256
222+
* @isvlan false
223+
* @default 128
257224
* @validonly SAI_TAM_INT_ATTR_CSIG_SIGNAL_TYPE == SAI_CSIG_SIGNAL_TYPE_ABW or SAI_TAM_INT_ATTR_CSIG_SIGNAL_TYPE == SAI_CSIG_SIGNAL_TYPE_ABWC
258225
*/
259226
SAI_TAM_INT_ATTR_BW_TIME_INTERVAL,
260227
261-
/**
262-
* @brief Bandwidth time Interval Units
263-
*
264-
* @type sai_tam_int_bw_time_interval_unit_t
265-
* @flags CREATE_AND_SET
266-
* @default SAI_TAM_INT_BW_TIME_INTERVAL_UNIT_USEC
267-
* @validonly SAI_TAM_INT_ATTR_CSIG_SIGNAL_TYPE == SAI_CSIG_SIGNAL_TYPE_ABW or SAI_TAM_INT_ATTR_CSIG_SIGNAL_TYPE == SAI_CSIG_SIGNAL_TYPE_ABWC
268-
*/
269-
SAI_TAM_INT_ATTR_BW_TIME_INTERVAL_UNIT,
270-
271228
/**
272229
* @brief Number of quantization bands
273230
* Compact tag supports maximum of 32 bands and wide tag supports maximum of 1048576 bands
@@ -279,14 +236,26 @@ This object has recently been enhanced to support the new CSIG INT type, along w
279236
*/
280237
SAI_TAM_INT_ATTR_QUANT_BANDS,
281238
239+
/**
240+
* @brief Quantization bands identifier
241+
* Number of identifiers specified MUST match the number of quantization bands configured for compact tag
242+
*
243+
* @type sai_u16_list_t
244+
* @flags CREATE_AND_SET
245+
* @default empty
246+
* @validonly SAI_TAM_INT_ATTR_TYPE == SAI_TAM_INT_TYPE_CSIG_COMPACT or SAI_TAM_INT_ATTR_TYPE == SAI_TAM_INT_TYPE_CSIG_WIDE
247+
*/
248+
SAI_TAM_INT_ATTR_QUANT_BAND_ID,
249+
282250
/**
283251
* @brief Quantization band range values for compact tag
284252
*
285253
* @type sai_u64_range_list_t
286254
* @flags CREATE_AND_SET
287255
* @default empty
256+
* @validonly SAI_TAM_INT_ATTR_TYPE == SAI_TAM_INT_TYPE_CSIG_COMPACT or SAI_TAM_INT_ATTR_TYPE == SAI_TAM_INT_TYPE_CSIG_WIDE
288257
*/
289-
SAI_TAM_INT_ATTR_QUANT_BAND_UINT32_RANGE_LIST,
258+
SAI_TAM_INT_ATTR_QUANT_BAND_UINT64_RANGE_LIST,
290259
291260
/**
292261
* @brief Base value for wide tag quantization. Must be 0 or power of 2
@@ -303,7 +272,7 @@ This object has recently been enhanced to support the new CSIG INT type, along w
303272
*
304273
* @type sai_uint32_t
305274
* @flags CREATE_AND_SET
306-
* @default 0
275+
* @default 1
307276
* @validonly SAI_TAM_INT_ATTR_TYPE == SAI_TAM_INT_TYPE_CSIG_WIDE
308277
*/
309278
SAI_TAM_INT_ATTR_WIDE_QUANT_STEP_VALUE,
@@ -318,17 +287,22 @@ This object has recently been enhanced to support the new CSIG INT type, along w
318287
* @validonly SAI_TAM_INT_ATTR_TYPE == SAI_TAM_INT_TYPE_CSIG_COMPACT or SAI_TAM_INT_ATTR_TYPE == SAI_TAM_INT_TYPE_CSIG_WIDE
319288
*/
320289
SAI_TAM_INT_ATTR_CSIG_D_BIT,
290+
321291
```
322292

323-
**New Data Type for u32 list**
293+
**New Data Type for u64 list**
324294
```
325-
typedef struct _sai_u32_range_list_t
295+
typedef struct _sai_u64_range_list_t
326296
{
327297
uint32_t count;
328-
sai_u32_range_t *list;
329-
} sai_u32_range_list_t;
298+
sai_u64_range_t *list;
299+
} sai_u64_range_list_t;
330300
```
331301

302+
**Quantization Band ID**
303+
Default band id or bucket id for the qunatization is implicit starting from 0 and increases lineraly.
304+
New attribute SAI_TAM_INT_ATTR_QUANT_BAND_ID allows NOS to assign a band id or bucket id to individual quantization bands randomly. This is done to support an implementation that may require a mapping to hw index allocation of quantization buckets or may want to map it on e.g. vlan id for overloading hw tables structures. This is an optional feature and can be ignored if not needed.
305+
332306
### 4.6 ACL Match Fields
333307
The ACL infrastructure supports matching specific fields within a packet and is enhanced to include CSIG tag fields. This functionality is crucial for developing policies based on CSIG tags with flags set, as explained further in the workflow section.
334308
New match for compact and wide tag EtherType and Signal type is introduced.
@@ -341,19 +315,20 @@ New match for compact and wide tag EtherType and Signal type is introduced.
341315
*/
342316
typedef enum _sai_csig_signal_type_t
343317
{
344-
/** Available Bandwidth */
318+
/** Available Bandwidth in bytes per second */
345319
SAI_CSIG_SIGNAL_TYPE_ABW = 0,
346320
347-
/** Normalized Available Bandwidth */
321+
/** Normalized Available Bandwidth in percentage */
348322
SAI_CSIG_SIGNAL_TYPE_ABWC = 1,
349323
350-
/** Delay */
324+
/** Delay in nanoseconds */
351325
SAI_CSIG_SIGNAL_TYPE_DELAY = 2,
352326
353-
/** Normalized Queue Depth */
327+
/** Normalized Queue Depth, in flight bytes divided by normalized port speed */
354328
SAI_CSIG_SIGNAL_TYPE_NQD = 3,
355329
356330
} sai_csig_signal_type_t;
331+
357332
```
358333

359334
**Table Fields**
@@ -481,6 +456,16 @@ Switch attribute specifies number of bandwidth timers a given implementation sup
481456
* @flags READ_ONLY
482457
*/
483458
SAI_SWITCH_ATTR_MAX_CSIG_TIMERS,
459+
460+
/**
461+
* @brief CSIG Bandwidth time intervals supported in microseconds valid only for available and relative available bandwidth signal type
462+
*
463+
* @type sai_u32_list_t
464+
* @flags READ_ONLY
465+
*/
466+
SAI_SWITCH_ATTR_CSIG_BW_TIME_INTERVAL_IN_USEC,
467+
468+
484469
```
485470

486471

@@ -517,13 +502,9 @@ sai_attr_list[1].value.u16 = 0xccdd;
517502
sai_attr_list[2].id = SAI_TAM_INT_ATTR_CSIG_SIGNAL_TYPE;
518503
sai_attr_list[2].value.s32 = SAI_CSIG_SIGNAL_TYPE_ABW;
519504
520-
// Configure Time Interval
505+
// Configure Time Interval in usec
521506
sai_attr_list[3].id = SAI_TAM_INT_ATTR_BW_TIME_INTERVAL;
522-
sai_attr_list[3].value.s32 = SAI_TAM_INT_BW_TIME_INTERVAL_256;
523-
524-
// Configure Time Interval Unit
525-
sai_attr_list[4].id = SAI_TAM_INT_ATTR_BW_TIME_INTERVAL_UNIT;
526-
sai_attr_list[4].value.s32 = SAI_TAM_INT_BW_TIME_INTERVAL_UNIT_USEC;
507+
sai_attr_list[3].value.u32 = 256;
527508
528509
// Configure Range List for each band
529510
sai_attr_list[5].id = SSAI_TAM_INT_ATTR_QUANT_BANDS;
@@ -594,7 +575,14 @@ Create TAM objects as described in section 5.1.1 and 5.1.2
594575
Step 2:
595576
Install an ACL rule to match CSIG ethtype and set the action as insert and bind the ACL Table to the switch
596577
- match <SAI_ACL_ENTRY_ATTR_FIELD_CSIG_COMPACT_ETHER_TYPE> action <SAI_ACL_ENTRY_ATTR_ACTION_INT_INSERT,  sai_tam_int_csig_compact_tag_object>
597-
- match <SAI_ACL_ENTRY_ATTR_FIELD_CSIG_WIDE_ETHER_TYPE> action <SAI_ACL_ENTRY_ATTR_ACTION_INT_INSERT,  sai_tam_int_csig_wide_tag_object>
578+
- match <SAI_ACL_ENTRY_ATTR_FIELD_CSIG_WIDE_ETHER_TYPE> action <SAI_ACL_ENTRY_ATTR_ACTION_INT_INSERT,  sai_tam_int_csig_wide_tag_object>
579+
580+
or
581+
582+
Step2:
583+
584+
Create a contain TAM object for TAM INT object and bind it to switch attribute SAI_SWITCH_ATTR_TAM_OBJECT_ID. Mutiple TAM INT objects can be created under single TAM object to support different signal types and time intervals.
585+
598586

599587
#### 5.1.4 Enable CSIG for subset of ingress ports
600588
Step 1:

inc/saiswitch.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3558,6 +3558,14 @@ typedef enum _sai_switch_attr_t
35583558
*/
35593559
SAI_SWITCH_ATTR_MAX_CSIG_TIMERS,
35603560

3561+
/**
3562+
* @brief CSIG Bandwidth time intervals supported in microseconds valid only for available and relative available bandwidth signal type
3563+
*
3564+
* @type sai_u32_list_t
3565+
* @flags READ_ONLY
3566+
*/
3567+
SAI_SWITCH_ATTR_CSIG_BW_TIME_INTERVAL_IN_USEC,
3568+
35613569
/**
35623570
* @brief End of attributes
35633571
*/

inc/saitam.h

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -836,22 +836,14 @@ typedef enum _sai_tam_int_attr_t
836836
/**
837837
* @brief Time interval for bandwidth computation in microseconds
838838
*
839-
* @type sai_uint16_t
839+
* @type sai_uint32_t
840840
* @flags CREATE_AND_SET
841841
* @isvlan false
842842
* @default 128
843843
* @validonly SAI_TAM_INT_ATTR_CSIG_SIGNAL_TYPE == SAI_CSIG_SIGNAL_TYPE_ABW or SAI_TAM_INT_ATTR_CSIG_SIGNAL_TYPE == SAI_CSIG_SIGNAL_TYPE_ABWC
844844
*/
845845
SAI_TAM_INT_ATTR_BW_TIME_INTERVAL,
846846

847-
/**
848-
* @brief Bandwidth time intervals supported in microseconds valid only for available and relative available bandwidth signal type
849-
*
850-
* @type sai_u16_list_t
851-
* @flags READ_ONLY
852-
*/
853-
SAI_TAM_INT_ATTR_BW_TIME_INTERVAL_IN_USEC,
854-
855847
/**
856848
* @brief Number of quantization bands
857849
* Compact tag supports maximum of 32 bands and wide tag supports maximum of 1048576 bands

0 commit comments

Comments
 (0)