Skip to content

Commit

Permalink
Refactor Creating TAM report object
Browse files Browse the repository at this point in the history
Signed-off-by: Ze Gan <[email protected]>
  • Loading branch information
Pterosaur committed Nov 29, 2024
1 parent 0058ec6 commit 39bae33
Showing 1 changed file with 23 additions and 21 deletions.
44 changes: 23 additions & 21 deletions doc/TAM/SAI-Proposal-TAM-stream-telemetry.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
- [Creating Hostif table entry](#creating-hostif-table-entry)
- [Creating TAM transport object](#creating-tam-transport-object)
- [Creating TAM collector object](#creating-tam-collector-object)
- [Creating TAM telemetry object](#creating-tam-telemetry-object)
- [Creating TAM report object](#creating-tam-report-object)
- [Creating TAM telemetry type object](#creating-tam-telemetry-type-object)
- [Generating TAM telemetry type configuration](#generating-tam-telemetry-type-configuration)
- [Creating TAM telemetry object](#creating-tam-telemetry-object)
- [Creating TAM counter subscription objects](#creating-tam-counter-subscription-objects)
- [Creating TAM object](#creating-tam-object)
- [Query IPFIX template](#query-ipfix-template)
Expand Down Expand Up @@ -631,6 +631,20 @@ create_tam_collector(&sai_tam_collector_obj, switch_id, attr_count, sai_attr_lis

```
#### Creating TAM telemetry object
``` c++
sai_attr_list[1].id = SAI_TAM_TELEMETRY_ATTR_COLLECTOR_LIST;
sai_attr_list[1].value.objlist.count = 1;
sai_attr_list[1].value.objlist.list[0] = sai_tam_collector_obj;
attr_count = 4;
create_tam_telemetry(&sai_tam_telemetry_obj, switch_id, attr_count, sai_attr_list);
```

#### Creating TAM report object

``` c++
Expand All @@ -655,6 +669,14 @@ sai_attr_list[4].value.s32 = SAI_TAM_REPORT_INTERVAL_UNIT_USEC;
attr_count = 5;
create_tam_report(&sai_tam_report_obj, switch_id, attr_count, sai_attr_list);

sai_attr_list[0].id = SAI_TAM_TELEMETRY_ATTR_TAM_TYPE_LIST;
sai_attr_list[0].value.objlist.count = 1;
sai_attr_list[0].value.objlist.list[0] = sai_tam_tel_type_obj;
// If the tam_tel_type is SINGLE TYPE mode, multiple tam_tel_type objects will be bounded to one tam telemetry object
// If the tam_tel_type is MIXED TYPE mode, one tam_tel_type in one tam telemetry is enough.

set_tam_telemetry_attribute(sai_tam_telemetry_obj, &sai_attr_list[0]);

```
#### Creating TAM telemetry type object
Expand Down Expand Up @@ -786,26 +808,6 @@ set_tam_tel_type_attribute(&sai_tam_tel_type_obj, &sai_attr);
```

#### Creating TAM telemetry object
``` c++
sai_attr_list[0].id = SAI_TAM_TELEMETRY_ATTR_TAM_TYPE_LIST;
sai_attr_list[0].value.objlist.count = 1;
sai_attr_list[0].value.objlist.list[0] = sai_tam_tel_type_obj;
// If the tam_tel_type is SINGLE TYPE mode, multiple tam_tel_type objects will be bounded to one tam telemetry object
// If the tam_tel_type is MIXED TYPE mode, one tam_tel_type in one tam telemetry is enough.
sai_attr_list[1].id = SAI_TAM_TELEMETRY_ATTR_COLLECTOR_LIST;
sai_attr_list[1].value.objlist.count = 1;
sai_attr_list[1].value.objlist.list[0] = sai_tam_collector_obj;
attr_count = 4;
create_tam_telemetry(&sai_tam_telemetry_obj, switch_id, attr_count, sai_attr_list);
```

#### Creating TAM counter subscription objects

Based on the STREAM_TELEMETRY_GROUP on Config DB, to create corresponding counter subscription objects.
Expand Down

0 comments on commit 39bae33

Please sign in to comment.