From f361496bb33f11f5701a9beeed9ab63a611b0df1 Mon Sep 17 00:00:00 2001 From: Vijay Srinivasan Date: Tue, 9 May 2023 09:34:30 +0000 Subject: [PATCH] Adding support for metering - Metering P4 model changes in BMV2 - Changes to support the SAI api generation for metering tables --- dash-pipeline/SAI/sai_api_gen.py | 33 ++++-- dash-pipeline/SAI/templates/saiapi.cpp.j2 | 50 +++++---- dash-pipeline/SAI/templates/saiapi.h.j2 | 11 ++ dash-pipeline/SAI/templates/utils.h.j2 | 21 ++++ dash-pipeline/bmv2/dash_metadata.p4 | 8 ++ dash-pipeline/bmv2/dash_outbound.p4 | 30 +++++- dash-pipeline/bmv2/dash_pipeline.p4 | 101 ++++++++++++++++++ .../tests/libsai/vnet_out/vnet_out.cpp | 8 ++ .../pytest/vnet/test_saithrift_vnet.py | 2 + .../functional/ptf/sai_dash_utils.py | 14 ++- test/test-cases/functional/ptf/saidashacl.py | 9 +- test/test-cases/functional/ptf/saidasheni.py | 2 + .../functional/ptf/saidashvnet_sanity.py | 8 +- .../saic/config_bidir_setup_commands.py | 36 +++++-- .../saic/config_inbound_setup_commands.py | 8 ++ .../saic/config_outbound_setup_commands.json | 24 +++-- .../saic/sai-api/test_sai_api_vnet_eni.py | 5 +- .../sai-api/test_sai_api_vnet_in_route.py | 4 + .../sai-api/test_sai_api_vnet_out_route.py | 12 ++- .../sai-api/test_sai_api_vnet_pa_entry.py | 2 +- .../saic/sai-api/test_sai_api_vnet_vni.py | 1 + ..._outbound_small_scale_config_via_dpugen.py | 16 ++- ..._small_scale_config_via_dpugen_create.json | 32 +++++- .../saic/test_sai_vnet_outbound_scale.py | 17 ++- .../saic/vnet_inbound_setup_commands.json | 4 + .../vnet_outbound_setup_commands_scale.json | 57 +++++++--- .../vnet_outbound_setup_commands_simple.json | 12 ++- 27 files changed, 441 insertions(+), 86 deletions(-) diff --git a/dash-pipeline/SAI/sai_api_gen.py b/dash-pipeline/SAI/sai_api_gen.py index 6502a2cd8..c8862eed6 100755 --- a/dash-pipeline/SAI/sai_api_gen.py +++ b/dash-pipeline/SAI/sai_api_gen.py @@ -43,6 +43,7 @@ 'sai_ip_address_t': 'ipaddr', 'sai_ip_addr_family_t': 'u32', 'sai_uint32_t': 'u32', + 'sai_uint64_t': 'u64', 'sai_mac_t': 'mac' } @@ -54,13 +55,26 @@ def p4_annotation_to_sai_attr(p4rt, sai_attr): sai_attr['type'] = kv['value']['stringValue'] elif kv['key'] == 'isresourcetype': sai_attr['isresourcetype'] = kv['value']['stringValue'] + elif kv['key'] == 'isreadonly': + sai_attr['isreadonly'] = kv['value']['stringValue'] elif kv['key'] == 'objects': sai_attr['objectName'] = kv['value']['stringValue'] + elif kv['key'] == 'skipattr': + sai_attr['skipattr'] = kv['value']['stringValue'] else: print("Unknown attr annotation " + kv['key']) exit(1) sai_attr['field'] = sai_type_to_field[sai_attr['type']] +def p4_annotation_to_sai_table(p4rt, sai_table): + for anno in p4rt[STRUCTURED_ANNOTATIONS_TAG]: + if anno[NAME_TAG] == SAI_TAG: + for kv in anno[KV_PAIR_LIST_TAG][KV_PAIRS_TAG]: + if kv['key'] == 'isobject': + sai_table['is_object'] = kv['value']['stringValue'] + if kv['key'] == 'ignoretable': + sai_table['ignore_table'] = kv['value']['stringValue'] + def get_sai_key_type(key_size, key_header, key_field): if key_size == 1: return 'bool', "booldata" @@ -252,7 +266,11 @@ def generate_sai_apis(program, ignore_tables): sai_table_data[ACTIONS_TAG] = [] sai_table_data[ACTION_PARAMS_TAG] = [] + if STRUCTURED_ANNOTATIONS_TAG in table['preamble']: + p4_annotation_to_sai_table(table['preamble'], sai_table_data) table_control, table_name = table[PREAMBLE_TAG][NAME_TAG].split('.', 1) + if 'ignore_table' in sai_table_data.keys(): + ignore_tables.append(table_name) if table_name in ignore_tables: continue @@ -300,13 +318,14 @@ def generate_sai_apis(program, ignore_tables): fill_action_params(sai_table_data[ACTION_PARAMS_TAG], param_names, all_actions[action_id]) sai_table_data[ACTIONS_TAG].append(all_actions[action_id]) - if len(sai_table_data['keys']) == 1 and sai_table_data['keys'][0]['sai_key_name'].endswith(table_name.split('.')[-1] + '_id'): - sai_table_data['is_object'] = 'true' - elif len(sai_table_data['keys']) > 5: - sai_table_data['is_object'] = 'true' - else: - sai_table_data['is_object'] = 'false' - sai_table_data['name'] = sai_table_data['name'] + '_entry' + if 'is_object' not in sai_table_data.keys(): + if len(sai_table_data['keys']) == 1 and sai_table_data['keys'][0]['sai_key_name'].endswith(table_name.split('.')[-1] + '_id'): + sai_table_data['is_object'] = 'true' + elif len(sai_table_data['keys']) > 5: + sai_table_data['is_object'] = 'true' + else: + sai_table_data['is_object'] = 'false' + sai_table_data['name'] = sai_table_data['name'] + '_entry' table_names.append(sai_table_data[NAME_TAG]) is_new_api = True diff --git a/dash-pipeline/SAI/templates/saiapi.cpp.j2 b/dash-pipeline/SAI/templates/saiapi.cpp.j2 index a23e14260..c45319bdf 100644 --- a/dash-pipeline/SAI/templates/saiapi.cpp.j2 +++ b/dash-pipeline/SAI/templates/saiapi.cpp.j2 @@ -42,8 +42,8 @@ sai_status_t sai_create_{{ table.name }}( // There shall be one and only one action_type p4::v1::TableAction* entry = nullptr; p4::v1::Action* action = nullptr; - auto expectedParams = 0; - auto matchedParams = 0; + //auto expectedParams = 0; + //auto matchedParams = 0; sai_object_id_t objId = 0; // Search the action pi_p4_id_t actionId = 0; @@ -58,8 +58,8 @@ sai_status_t sai_create_{{ table.name }}( tableId = {{table.id}}; entry = matchActionEntry->mutable_action(); action = entry->mutable_action(); - expectedParams = 0; - matchedParams = 0; + //expectedParams = 0; + //matchedParams = 0; objId = 0; matchActionEntry->set_table_id(tableId); @@ -139,7 +139,7 @@ sai_status_t sai_create_{{ table.name }}( {% if table.actions|length == 1 %} {% for action in table.actions %} actionId = {{action.id}}; // SAI_{{ table.name | upper }}_ACTION_{{ action.name | upper }} - expectedParams = {{ action.params|length }}; + //expectedParams = {{ action.params|length }}; {% endfor %} {% else %} // Search the action @@ -150,7 +150,7 @@ sai_status_t sai_create_{{ table.name }}( {% for action in table.actions %} case SAI_{{ table.name | upper }}_ACTION_{{ action.name | upper }}: { actionId = {{action.id}}; - expectedParams = {{ action.params|length }}; + //expectedParams = {{ action.params|length }}; break; } {% endfor %} @@ -165,31 +165,34 @@ sai_status_t sai_create_{{ table.name }}( for (uint32_t i = 0; i < attr_count; i++) { switch(attr_list[i].id) { {% for param in table.actionParams %} + {% if param.skipattr == 'true' %} + {% else %} case SAI_{{ table.name | upper }}_ATTR_{{ param.name | upper }}: { auto param = action->add_params(); param->set_param_id({{param.id}}); {{param.field}}SetVal(attr_list[i].value, param, {{param.bitwidth}}); - matchedParams++; + //matchedParams++; {% if 'v4_or_v6_id' in param %} { // set v4_or_v6 field auto param = action->add_params(); param->set_param_id({{param.v4_or_v6_id}}); booldataSetVal((attr_list[i].value.ipaddr.addr_family == SAI_IP_ADDR_FAMILY_IPV4) ? 0 : 1, param, 1); - matchedParams++; + //matchedParams++; } {% endif %} break; } + {% endif %} {% endfor %} } } - assert((matchedParams == expectedParams)); + //assert((matchedParams == expectedParams)); - if (matchedParams != expectedParams) { - goto ErrRet; - } + //if (matchedParams != expectedParams) { + // goto ErrRet; + //} if (false == InsertInTable(matchActionEntry, &objId)) { goto ErrRet; } @@ -284,8 +287,8 @@ sai_status_t sai_create_{{ table.name }}( // There shall be one and only one action_type auto entry = matchActionEntry->mutable_action(); auto action = entry->mutable_action(); - auto expectedParams = 0; - auto matchedParams = 0; + //auto expectedParams = 0; + //auto matchedParams = 0; pi_p4_id_t actionId; grpc::StatusCode retCode; @@ -327,7 +330,7 @@ sai_status_t sai_create_{{ table.name }}( {% if table.actions|length == 1 %} {% for action in table.actions %} actionId = {{action.id}}; // SAI_{{ table.name | upper }}_ACTION_{{ action.name | upper }} - expectedParams = {{ action.params|length }}; + //expectedParams = {{ action.params|length }}; {% endfor %} {% else %} // Search the action @@ -336,7 +339,7 @@ sai_status_t sai_create_{{ table.name }}( {% for action in table.actions %} case SAI_{{ table.name | upper }}_ACTION_{{ action.name | upper }}: { actionId = {{action.id}}; - expectedParams = {{ action.params|length }}; + //expectedParams = {{ action.params|length }}; break; } {% endfor %} @@ -350,31 +353,34 @@ sai_status_t sai_create_{{ table.name }}( for (uint32_t i = 0; i < attr_count; i++) { switch(attr_list[i].id) { {% for param in table.actionParams %} + {% if param.skipattr == 'true' %} + {% else %} case SAI_{{ table.name | upper }}_ATTR_{{ param.name | upper }}: { auto param = action->add_params(); param->set_param_id({{param.id}}); {{param.field}}SetVal(attr_list[i].value, param, {{param.bitwidth}}); - matchedParams++; + //matchedParams++; {% if 'v4_or_v6_id' in param %} { // set v4_or_v6 field auto param = action->add_params(); param->set_param_id({{param.v4_or_v6_id}}); booldataSetVal((attr_list[i].value.ipaddr.addr_family == SAI_IP_ADDR_FAMILY_IPV4) ? 0 : 1, param, 1); - matchedParams++; + //matchedParams++; } {% endif %} break; } + {% endif %} {% endfor %} } } - assert((matchedParams == expectedParams)); + //assert((matchedParams == expectedParams)); - if (matchedParams != expectedParams) { - goto ErrRet; - } + //if (matchedParams != expectedParams) { + // goto ErrRet; + //} // TODO: ternaly needs to set priority retCode = MutateTableEntry(matchActionEntry, p4::v1::Update_Type_INSERT); if (grpc::StatusCode::OK == retCode) { diff --git a/dash-pipeline/SAI/templates/saiapi.h.j2 b/dash-pipeline/SAI/templates/saiapi.h.j2 index 71e4adf7c..545c75cd1 100644 --- a/dash-pipeline/SAI/templates/saiapi.h.j2 +++ b/dash-pipeline/SAI/templates/saiapi.h.j2 @@ -118,6 +118,7 @@ typedef enum _sai_{{ table.name }}_attr_t {% if table.is_object == 'true' %} {% if table['keys'] | length > 1 %} {% for key in table['keys'] %} +{% if key.isattribute != 'false' %} /** * @brief {{ key.match_type | capitalize | replace('Lpm', 'LPM') }} matched key {{ key.sai_key_name }} * @@ -149,16 +150,23 @@ typedef enum _sai_{{ table.name }}_attr_t */ SAI_{{ table.name | upper }}_ATTR_{{ key.sai_key_name | upper }}_MASK, +{% endif %} {% endif %} {% endfor %} {% endif %} {% endif %} {% for param in table.actionParams %} +{% if param.skipattr == 'true' %} +{% else %} /** * @brief Action {% for action in param.paramActions %}{{ action }}{{ ", " if not loop.last else "" }}{% endfor %} parameter {{ param.name | upper }} * * @type {{ param.type }} +{% if param.isreadonly == 'true' %} + * @flags READ_ONLY +{% else %} * @flags CREATE_AND_SET +{% endif %} {% if param.type == 'sai_uint16_t' %} * @isvlan false {% endif %} @@ -177,8 +185,10 @@ typedef enum _sai_{{ table.name }}_attr_t {% elif param.field == 's32' %} * @default {{ param.default }} {% else %} +{% if param.isreadonly != 'true' %} * @default 0 {% endif %} +{% endif %} {% if table.actions | length > 1 %} {% if param.paramActions | length > 0 %} * @validonly {% for action in param.paramActions %}SAI_{{ table.name | upper }}_ATTR_ACTION == SAI_{{ table.name | upper }}_ACTION_{{ action | upper }}{{ " or " if not loop.last else "" }}{% endfor %} @@ -196,6 +206,7 @@ typedef enum _sai_{{ table.name }}_attr_t SAI_{{ table.name | upper }}_ATTR_{{ param.name | upper }}, {% endif %} +{% endif %} {% endfor %} {% if table.with_counters == 'true' %} /** diff --git a/dash-pipeline/SAI/templates/utils.h.j2 b/dash-pipeline/SAI/templates/utils.h.j2 index 3cd47d08e..b18bd6c33 100644 --- a/dash-pipeline/SAI/templates/utils.h.j2 +++ b/dash-pipeline/SAI/templates/utils.h.j2 @@ -140,6 +140,27 @@ void ipaddrSetVal(const sai_ip_address_t &value, T &t, int bits = -1){ } } +template +void ipaddrSetMask(const sai_attribute_value_t &value, T &t, int bits = -1){ + ipaddrSetMask(value.ipaddr, t); +} + +template +void ipaddrSetMask(const sai_ip_address_t &value, T &t, int bits = -1){ + switch(value.addr_family) { + case SAI_IP_ADDR_FAMILY_IPV4: { + uint32_t mask = value.addr.ip4; + t->set_mask(&mask, 4); + } + break; + case SAI_IP_ADDR_FAMILY_IPV6: { + t->set_mask(const_cast(&value.addr.ip6[0]), 16); + } + break; + default: assert(0 && "unrecognzed value.ipaddr.addr_family"); + } +} + template void macSetVal(const sai_attribute_value_t &value, T &t, int bits = -1){ t->set_value(const_cast(&value.mac[0]), 6); diff --git a/dash-pipeline/bmv2/dash_metadata.p4 b/dash-pipeline/bmv2/dash_metadata.p4 index 444ed5153..9eb701290 100644 --- a/dash-pipeline/bmv2/dash_metadata.p4 +++ b/dash-pipeline/bmv2/dash_metadata.p4 @@ -62,6 +62,14 @@ struct metadata_t { bit<16> stage3_dash_acl_group_id; bit<16> stage4_dash_acl_group_id; bit<16> stage5_dash_acl_group_id; + bit<1> meter_policy_en; + bit<1> mapping_meter_class_override; + bit<16> meter_policy_id; + bit<16> policy_meter_class; + bit<16> route_meter_class; + bit<16> mapping_meter_class; + bit<16> meter_class; + bit<32> meter_bucket_index; tag_map_t src_tag_map; tag_map_t dst_tag_map; } diff --git a/dash-pipeline/bmv2/dash_outbound.p4 b/dash-pipeline/bmv2/dash_outbound.p4 index 05857c5ea..b00602008 100644 --- a/dash-pipeline/bmv2/dash_outbound.p4 +++ b/dash-pipeline/bmv2/dash_outbound.p4 @@ -9,19 +9,32 @@ control outbound(inout headers_t hdr, inout metadata_t meta) { - action route_vnet(bit<16> dst_vnet_id) { + action set_route_meter_attrs(bit<1> meter_policy_en, + bit<16> meter_class) { + meta.meter_policy_en = meter_policy_en; + meta.route_meter_class = meter_class; + } + action route_vnet(bit<16> dst_vnet_id, + bit<1> meter_policy_en, + bit<16> meter_class) { meta.dst_vnet_id = dst_vnet_id; + set_route_meter_attrs(meter_policy_en, meter_class); } action route_vnet_direct(bit<16> dst_vnet_id, bit<1> is_overlay_ip_v4_or_v6, - IPv4ORv6Address overlay_ip) { + IPv4ORv6Address overlay_ip, + bit<1> meter_policy_en, + bit<16> meter_class) { meta.dst_vnet_id = dst_vnet_id; meta.lkup_dst_ip_addr = overlay_ip; meta.is_lkup_dst_ip_v6 = is_overlay_ip_v4_or_v6; + set_route_meter_attrs(meter_policy_en, meter_class); } - action route_direct() { + action route_direct(bit<1> meter_policy_en, + bit<16> meter_class) { + set_route_meter_attrs(meter_policy_en, meter_class); /* send to underlay router without any encap */ } @@ -42,7 +55,9 @@ control outbound(inout headers_t hdr, bit<1> is_underlay_sip_v4_or_v6, IPv4ORv6Address underlay_sip, dash_encapsulation_t dash_encapsulation, - bit<24> tunnel_key) { + bit<24> tunnel_key, + bit<1> meter_policy_en, + bit<16> meter_class) { /* Assume the overlay addresses provided are always IPv6 and the original are IPv4 */ /* assert(is_overlay_dip_v4_or_v6 == 1 && is_overlay_sip_v4_or_v6 == 1); assert(is_overlay_dip_mask_v4_or_v6 == 1 && is_overlay_sip_mask_v4_or_v6 == 1); @@ -62,6 +77,7 @@ control outbound(inout headers_t hdr, meta.encap_data.overlay_dmac = hdr.ethernet.dst_addr; meta.encap_data.dash_encapsulation = dash_encapsulation; meta.encap_data.service_tunnel_key = tunnel_key; + set_route_meter_attrs(meter_policy_en, meter_class); } #ifdef TARGET_BMV2_V1MODEL @@ -104,11 +120,15 @@ control outbound(inout headers_t hdr, action set_tunnel_mapping(IPv4Address underlay_dip, EthernetAddress overlay_dmac, - bit<1> use_dst_vnet_vni) { + bit<1> use_dst_vnet_vni, + bit<16> meter_class, + bit<1> meter_class_override) { if (use_dst_vnet_vni == 1) meta.vnet_id = meta.dst_vnet_id; meta.encap_data.overlay_dmac = overlay_dmac; meta.encap_data.underlay_dip = underlay_dip; + meta.mapping_meter_class = meter_class; + meta.mapping_meter_class_override = meter_class_override; } #ifdef TARGET_BMV2_V1MODEL diff --git a/dash-pipeline/bmv2/dash_pipeline.p4 b/dash-pipeline/bmv2/dash_pipeline.p4 index 24fa1052f..fe0754fde 100644 --- a/dash-pipeline/bmv2/dash_pipeline.p4 +++ b/dash-pipeline/bmv2/dash_pipeline.p4 @@ -113,6 +113,8 @@ control dash_ingress( @Sai[type="sai_uint32_t"] bit<24> vm_vni, bit<16> vnet_id, + bit<16> v4_meter_policy_id, + bit<16> v6_meter_policy_id, ACL_GROUPS_PARAM(inbound_v4), ACL_GROUPS_PARAM(inbound_v6), ACL_GROUPS_PARAM(outbound_v4), @@ -133,12 +135,14 @@ control dash_ingress( } else { ACL_GROUPS_COPY_TO_META(inbound_v6); } + meta.meter_policy_id = v6_meter_policy_id; } else { if (meta.direction == dash_direction_t.OUTBOUND) { ACL_GROUPS_COPY_TO_META(outbound_v4); } else { ACL_GROUPS_COPY_TO_META(inbound_v4); } + meta.meter_policy_id = v4_meter_policy_id; } } @@ -231,6 +235,76 @@ control dash_ingress( const default_action = deny; } + action check_ip_addr_family(@Sai[type="sai_ip_addr_family_t", isresourcetype="true"] bit<32> ip_addr_family) { + if (ip_addr_family == 0) /* SAI_IP_ADDR_FAMILY_IPV4 */ { + if (meta.is_overlay_ip_v6 == 1) { + meta.dropped = true; + } + } else { + if (meta.is_overlay_ip_v6 == 0) { + meta.dropped = true; + } + } + } + + @name("meter_policy|dash_meter") + @Sai[isobject="true"] + table meter_policy { + key = { + meta.meter_policy_id : exact @name("meta.meter_policy_id:meter_policy_id"); + } + actions = { + check_ip_addr_family; + } + } + + action set_meter_class(bit<16> meter_class) { + meta.policy_meter_class = meter_class; + } + + @name("meter_rule|dash_meter") + @Sai[isobject="true"] + table meter_rule { + key = { + meta.meter_policy_id: exact @name("meta.meter_policy_id:meter_policy_id") @Sai[type="sai_object_id_t", isresourcetype="true", objects="METER_POLICY"]; + hdr.ipv4.dst_addr : ternary @name("hdr.ipv4.dst_addr:dip"); + } + + actions = { + set_meter_class; + @defaultonly NoAction; + } + const default_action = NoAction(); + } + + // MAX_METER_BUCKET = MAX_ENI(64) * NUM_BUCKETS_PER_ENI(4096) + #define MAX_METER_BUCKETS 262144 +#ifdef TARGET_BMV2_V1MODEL + counter(MAX_METER_BUCKETS, CounterType.bytes) meter_bucket_inbound; + counter(MAX_METER_BUCKETS, CounterType.bytes) meter_bucket_outbound; +#endif // TARGET_BMV2_V1MODEL + action meter_bucket_action( + @Sai[type="sai_uint64_t", isreadonly="true"] bit<64> outbound_bytes_counter, + @Sai[type="sai_uint64_t", isreadonly="true"] bit<64> inbound_bytes_counter, + @Sai[type="sai_uint32_t", skipattr="true"] bit<32> meter_bucket_index) { + // read only counters for SAI api generation only + meta.meter_bucket_index = meter_bucket_index; + } + + @name("meter_bucket|dash_meter") + @Sai[isobject="true"] + table meter_bucket { + key = { + meta.eni_id: exact @name("meta.eni_id:eni_id"); + meta.meter_class: exact @name("meta.meter_class:meter_class"); + } + actions = { + meter_bucket_action; + @defaultonly NoAction; + } + const default_action = NoAction(); + } + action set_eni(bit<16> eni_id) { meta.eni_id = eni_id; } @@ -388,6 +462,33 @@ control dash_ingress( inbound.apply(hdr, meta); } + if (meta.meter_policy_en == 1) { + meter_policy.apply(); + meter_rule.apply(); + } + + { + if (meta.meter_policy_en == 1) { + meta.meter_class = meta.policy_meter_class; + } else { + meta.meter_class = meta.route_meter_class; + } + if ((meta.meter_class == 0) || (meta.mapping_meter_class_override == 1)) { + meta.meter_class = meta.mapping_meter_class; + } + } + + meter_bucket.apply(); + if (meta.direction == dash_direction_t.OUTBOUND) { +#ifdef TARGET_BMV2_V1MODEL + meter_bucket_outbound.count(meta.meter_bucket_index); +#endif + } else if (meta.direction == dash_direction_t.INBOUND) { +#ifdef TARGET_BMV2_V1MODEL + meter_bucket_inbound.count(meta.meter_bucket_index); +#endif + } + eni_meter.apply(); if (meta.dropped) { diff --git a/dash-pipeline/tests/libsai/vnet_out/vnet_out.cpp b/dash-pipeline/tests/libsai/vnet_out/vnet_out.cpp index f450ab199..acbfcbab8 100644 --- a/dash-pipeline/tests/libsai/vnet_out/vnet_out.cpp +++ b/dash-pipeline/tests/libsai/vnet_out/vnet_out.cpp @@ -141,6 +141,14 @@ int main(int argc, char **argv) attr.value.u32 = vnet_id; attrs.push_back(attr); + attr.id = SAI_ENI_ATTR_V4_METER_POLICY_ID; + attr.value.oid = SAI_NULL_OBJECT_ID; + attrs.push_back(attr); + + attr.id = SAI_ENI_ATTR_V6_METER_POLICY_ID; + attr.value.oid = SAI_NULL_OBJECT_ID; + attrs.push_back(attr); + std::unordered_map acl_group_ids = { {SAI_ENI_ATTR_INBOUND_V4_STAGE1_DASH_ACL_GROUP_ID, in_acl_group_id}, {SAI_ENI_ATTR_INBOUND_V4_STAGE2_DASH_ACL_GROUP_ID, in_acl_group_id}, diff --git a/dash-pipeline/tests/saithrift/pytest/vnet/test_saithrift_vnet.py b/dash-pipeline/tests/saithrift/pytest/vnet/test_saithrift_vnet.py index fa2089dec..acb9cd20e 100644 --- a/dash-pipeline/tests/saithrift/pytest/vnet/test_saithrift_vnet.py +++ b/dash-pipeline/tests/saithrift/pytest/vnet/test_saithrift_vnet.py @@ -41,6 +41,8 @@ def test_sai_thrift_create_eni(saithrift_client): vm_underlay_dip=vm_underlay_dip, vm_vni=9, vnet_id=vnet, + v4_meter_policy_id = 0, + v6_meter_policy_id = 0, inbound_v4_stage1_dash_acl_group_id = in_acl_group_id, inbound_v4_stage2_dash_acl_group_id = in_acl_group_id, inbound_v4_stage3_dash_acl_group_id = in_acl_group_id, diff --git a/test/test-cases/functional/ptf/sai_dash_utils.py b/test/test-cases/functional/ptf/sai_dash_utils.py index a93f4025b..b9124ab50 100644 --- a/test/test-cases/functional/ptf/sai_dash_utils.py +++ b/test/test-cases/functional/ptf/sai_dash_utils.py @@ -143,6 +143,8 @@ def eni_create(self, **kwargs): "vm_underlay_dip": sai_ipaddress("0.0.0.0"), "vm_vni": 1, "vnet_id": 1, + "v4_meter_policy_id": 0, + "v6_meter_policy_id": 0, "inbound_v4_stage1_dash_acl_group_id": 0, "inbound_v4_stage2_dash_acl_group_id": 0, "inbound_v4_stage3_dash_acl_group_id": 0, @@ -289,7 +291,8 @@ def outbound_routing_vnet_direct_create(self, eni_id, lpm, dst_vnet_id, sai_thrift_create_outbound_routing_entry(self.client, outbound_routing_entry, dst_vnet_id=dst_vnet_id, action=SAI_OUTBOUND_ROUTING_ENTRY_ACTION_ROUTE_VNET_DIRECT, - overlay_ip=sai_ipaddress(overlay_ip), counter_id=counter_id) + overlay_ip=sai_ipaddress(overlay_ip), counter_id=counter_id, + meter_policy_en=False, meter_class=0) self.assertEqual(self.status(), SAI_STATUS_SUCCESS) self.add_teardown_obj(self.outbound_routing_vnet_direct_remove, outbound_routing_entry) @@ -302,7 +305,8 @@ def outbound_routing_direct_create(self, eni_id, lpm, counter_id=None): switch_id=self.switch_id, eni_id=eni_id, destination=sai_ipprefix(lpm)) sai_thrift_create_outbound_routing_entry(self.client, outbound_routing_entry, counter_id=counter_id, - action=SAI_OUTBOUND_ROUTING_ENTRY_ACTION_ROUTE_DIRECT) + action=SAI_OUTBOUND_ROUTING_ENTRY_ACTION_ROUTE_DIRECT, + meter_policy_en=False, meter_class=0) self.assertEqual(self.status(), SAI_STATUS_SUCCESS) self.add_teardown_obj(self.outbound_routing_vnet_direct_remove, outbound_routing_entry) @@ -317,7 +321,8 @@ def outbound_routing_vnet_create(self, eni_id, lpm, dst_vnet_id, counter_id=None sai_thrift_create_outbound_routing_entry(self.client, outbound_routing_entry, dst_vnet_id=dst_vnet_id, counter_id=counter_id, - action=SAI_OUTBOUND_ROUTING_ENTRY_ACTION_ROUTE_VNET) + action=SAI_OUTBOUND_ROUTING_ENTRY_ACTION_ROUTE_VNET, + meter_policy_en=False, meter_class=0) self.assertEqual(self.status(), SAI_STATUS_SUCCESS) self.add_teardown_obj(self.outbound_routing_vnet_direct_remove, outbound_routing_entry) @@ -336,7 +341,8 @@ def outbound_ca_to_pa_create(self, dst_vnet_id, dip, underlay_dip, sai_thrift_create_outbound_ca_to_pa_entry(self.client, ca_to_pa_entry, underlay_dip=sai_ipaddress(underlay_dip), use_dst_vnet_vni=use_dst_vnet_vni, - overlay_dmac=overlay_dmac) + overlay_dmac=overlay_dmac, + meter_class=0, meter_class_override=False) self.assertEqual(self.status(), SAI_STATUS_SUCCESS) self.add_teardown_obj(self.outbound_ca_to_pa_remove, ca_to_pa_entry) diff --git a/test/test-cases/functional/ptf/saidashacl.py b/test/test-cases/functional/ptf/saidashacl.py index 9249d6c51..8a5f3983c 100644 --- a/test/test-cases/functional/ptf/saidashacl.py +++ b/test/test-cases/functional/ptf/saidashacl.py @@ -208,6 +208,8 @@ def setUpSwitch(self): vm_underlay_dip=vm_underlay_dip, vm_vni=9, vnet_id=self.vnet, + v4_meter_policy_id=0, + v6_meter_policy_id=0, inbound_v4_stage1_dash_acl_group_id=self.in_v4_stage1_acl_group_id, inbound_v4_stage2_dash_acl_group_id=self.in_v4_stage2_acl_group_id, inbound_v4_stage3_dash_acl_group_id=self.in_v4_stage3_acl_group_id, @@ -223,7 +225,6 @@ def setUpSwitch(self): inbound_v6_stage3_dash_acl_group_id=self.in_v6_stage3_acl_group_id, inbound_v6_stage4_dash_acl_group_id=0, inbound_v6_stage5_dash_acl_group_id=0, - outbound_v6_stage1_dash_acl_group_id=self.out_v6_stage1_acl_group_id, outbound_v6_stage2_dash_acl_group_id=self.out_v6_stage2_acl_group_id, outbound_v6_stage3_dash_acl_group_id=self.out_v6_stage3_acl_group_id, @@ -247,7 +248,8 @@ def setUpSwitch(self): switch_id=self.switch_id, eni_id=self.eni, destination=ca_prefix) self.create_entry(sai_thrift_create_outbound_routing_entry, sai_thrift_remove_outbound_routing_entry, - self.ore, action=SAI_OUTBOUND_ROUTING_ENTRY_ACTION_ROUTE_VNET, dst_vnet_id=self.vnet) + self.ore, action=SAI_OUTBOUND_ROUTING_ENTRY_ACTION_ROUTE_VNET, dst_vnet_id=self.vnet, + meter_policy_en=False, meter_class=0) underlay_dip = sai_thrift_ip_address_t(addr_family=SAI_IP_ADDR_FAMILY_IPV4, addr=sai_thrift_ip_addr_t(ip4=self.dst_pa_ip)) @@ -255,7 +257,8 @@ def setUpSwitch(self): switch_id=self.switch_id, dst_vnet_id=self.vnet, dip=dip) self.create_entry(sai_thrift_create_outbound_ca_to_pa_entry, sai_thrift_remove_outbound_ca_to_pa_entry, - self.ocpe, underlay_dip=underlay_dip, overlay_dmac=self.dst_ca_mac, use_dst_vnet_vni=True) + self.ocpe, underlay_dip=underlay_dip, overlay_dmac=self.dst_ca_mac, use_dst_vnet_vni=True, + meter_class=0, meter_class_override=False) def setupTest(self): self.tests.append(AclRuleTest(self, diff --git a/test/test-cases/functional/ptf/saidasheni.py b/test/test-cases/functional/ptf/saidasheni.py index 9c521b612..761c036ba 100644 --- a/test/test-cases/functional/ptf/saidasheni.py +++ b/test/test-cases/functional/ptf/saidasheni.py @@ -130,6 +130,8 @@ def createEniTest(self): vm_underlay_dip=self.vm_underlay_dip, vm_vni=self.vm_vni, vnet_id=self.vm_vnet, + v4_meter_policy_id=0, + v6_meter_policy_id=0, inbound_v4_stage1_dash_acl_group_id=self.in_acl_group_id, inbound_v4_stage2_dash_acl_group_id=self.in_acl_group_id, inbound_v4_stage3_dash_acl_group_id=self.in_acl_group_id, diff --git a/test/test-cases/functional/ptf/saidashvnet_sanity.py b/test/test-cases/functional/ptf/saidashvnet_sanity.py index 094e81f5c..0e5849a72 100644 --- a/test/test-cases/functional/ptf/saidashvnet_sanity.py +++ b/test/test-cases/functional/ptf/saidashvnet_sanity.py @@ -62,6 +62,8 @@ def configureVnet(self): vm_underlay_dip=vm_underlay_dip, vm_vni=9, vnet_id=self.vnet, + v4_meter_policy_id = 0, + v6_meter_policy_id = 0, # TODO: Enable ACL rule #inbound_v4_stage1_dash_acl_group_id = self.in_acl_group_id, #inbound_v4_stage2_dash_acl_group_id = self.in_acl_group_id, @@ -115,14 +117,16 @@ def configureVnet(self): self.ore = sai_thrift_outbound_routing_entry_t(switch_id=self.switch_id, eni_id=self.eni, destination=ca_prefix) status = sai_thrift_create_outbound_routing_entry(self.client, self.ore, action=SAI_OUTBOUND_ROUTING_ENTRY_ACTION_ROUTE_VNET, - dst_vnet_id=self.vnet) + dst_vnet_id=self.vnet, + meter_policy_en=False, meter_class=0) assert(status == SAI_STATUS_SUCCESS) underlay_dip = sai_thrift_ip_address_t(addr_family=SAI_IP_ADDR_FAMILY_IPV4, addr=sai_thrift_ip_addr_t(ip4=self.dst_pa_ip)) self.ocpe = sai_thrift_outbound_ca_to_pa_entry_t(switch_id=self.switch_id, dst_vnet_id=self.vnet, dip=dip) status = sai_thrift_create_outbound_ca_to_pa_entry(self.client, self.ocpe, underlay_dip = underlay_dip, - overlay_dmac=self.dst_ca_mac, use_dst_vnet_vni = True) + overlay_dmac=self.dst_ca_mac, use_dst_vnet_vni = True, + meter_class=0, meter_class_override=False) assert(status == SAI_STATUS_SUCCESS) print(f"\n{self.__class__.__name__} configureVnet OK") diff --git a/test/test-cases/functional/saic/config_bidir_setup_commands.py b/test/test-cases/functional/saic/config_bidir_setup_commands.py index e61db1a01..1457d85d4 100644 --- a/test/test-cases/functional/saic/config_bidir_setup_commands.py +++ b/test/test-cases/functional/saic/config_bidir_setup_commands.py @@ -117,7 +117,9 @@ "SAI_ENI_ATTR_OUTBOUND_V6_STAGE2_DASH_ACL_GROUP_ID", "0", "SAI_ENI_ATTR_OUTBOUND_V6_STAGE3_DASH_ACL_GROUP_ID", "0", "SAI_ENI_ATTR_OUTBOUND_V6_STAGE4_DASH_ACL_GROUP_ID", "0", - "SAI_ENI_ATTR_OUTBOUND_V6_STAGE5_DASH_ACL_GROUP_ID", "0" + "SAI_ENI_ATTR_OUTBOUND_V6_STAGE5_DASH_ACL_GROUP_ID", "0", + "SAI_ENI_ATTR_V4_METER_POLICY_ID", "0", + "SAI_ENI_ATTR_V6_METER_POLICY_ID", "0" ] }, { @@ -151,7 +153,9 @@ "SAI_ENI_ATTR_OUTBOUND_V6_STAGE2_DASH_ACL_GROUP_ID", "0", "SAI_ENI_ATTR_OUTBOUND_V6_STAGE3_DASH_ACL_GROUP_ID", "0", "SAI_ENI_ATTR_OUTBOUND_V6_STAGE4_DASH_ACL_GROUP_ID", "0", - "SAI_ENI_ATTR_OUTBOUND_V6_STAGE5_DASH_ACL_GROUP_ID", "0" + "SAI_ENI_ATTR_OUTBOUND_V6_STAGE5_DASH_ACL_GROUP_ID", "0", + "SAI_ENI_ATTR_V4_METER_POLICY_ID", "0", + "SAI_ENI_ATTR_V6_METER_POLICY_ID", "0" ] }, { @@ -185,7 +189,9 @@ "SAI_ENI_ATTR_OUTBOUND_V6_STAGE2_DASH_ACL_GROUP_ID", "0", "SAI_ENI_ATTR_OUTBOUND_V6_STAGE3_DASH_ACL_GROUP_ID", "0", "SAI_ENI_ATTR_OUTBOUND_V6_STAGE4_DASH_ACL_GROUP_ID", "0", - "SAI_ENI_ATTR_OUTBOUND_V6_STAGE5_DASH_ACL_GROUP_ID", "0" + "SAI_ENI_ATTR_OUTBOUND_V6_STAGE5_DASH_ACL_GROUP_ID", "0", + "SAI_ENI_ATTR_V4_METER_POLICY_ID", "0", + "SAI_ENI_ATTR_V6_METER_POLICY_ID", "0" ] }, @@ -236,7 +242,9 @@ }, "attributes": [ "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_ACTION", "SAI_OUTBOUND_ROUTING_ENTRY_ACTION_ROUTE_VNET", - "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_DST_VNET_ID", "$vnet" + "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_DST_VNET_ID", "$vnet", + "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_METER_POLICY_EN", "False", + "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_METER_CLASS", "0" ] }, { @@ -250,7 +258,9 @@ }, "attributes": [ "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_ACTION", "SAI_OUTBOUND_ROUTING_ENTRY_ACTION_ROUTE_VNET", - "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_DST_VNET_ID", "$vnet" + "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_DST_VNET_ID", "$vnet", + "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_METER_POLICY_EN", "False", + "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_METER_CLASS", "0" ] }, { @@ -264,7 +274,9 @@ }, "attributes": [ "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_ACTION", "SAI_OUTBOUND_ROUTING_ENTRY_ACTION_ROUTE_VNET", - "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_DST_VNET_ID", "$vnet" + "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_DST_VNET_ID", "$vnet", + "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_METER_POLICY_EN", "False", + "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_METER_CLASS", "0" ] }, { @@ -336,7 +348,9 @@ "attributes": [ "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_UNDERLAY_DIP", NETWORK_VTEP_IP, "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_OVERLAY_DMAC", INNER_DST_MAC, - "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_USE_DST_VNET_VNI", "True" + "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_USE_DST_VNET_VNI", "True", + "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_METER_CLASS", "0", + "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_METER_CLASS_OVERRIDE", "False" ] }, { @@ -351,7 +365,9 @@ "attributes": [ "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_UNDERLAY_DIP", NETWORK_VTEP_IP, "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_OVERLAY_DMAC", INNER_DST_MAC2, - "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_USE_DST_VNET_VNI", "True" + "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_USE_DST_VNET_VNI", "True", + "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_METER_CLASS", "0", + "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_METER_CLASS_OVERRIDE", "False" ] }, { @@ -366,7 +382,9 @@ "attributes": [ "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_UNDERLAY_DIP", ENI_VTEP_IP, "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_OVERLAY_DMAC", INNER_SRC_MAC, - "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_USE_DST_VNET_VNI", "True" + "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_USE_DST_VNET_VNI", "True", + "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_METER_CLASS", "0", + "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_METER_CLASS_OVERRIDE", "False" ] } ] diff --git a/test/test-cases/functional/saic/config_inbound_setup_commands.py b/test/test-cases/functional/saic/config_inbound_setup_commands.py index 8862a16f2..8eb829d2d 100644 --- a/test/test-cases/functional/saic/config_inbound_setup_commands.py +++ b/test/test-cases/functional/saic/config_inbound_setup_commands.py @@ -148,6 +148,10 @@ "SAI_ENI_ATTR_OUTBOUND_V6_STAGE4_DASH_ACL_GROUP_ID", "0", "SAI_ENI_ATTR_OUTBOUND_V6_STAGE5_DASH_ACL_GROUP_ID", + "0", + "SAI_ENI_ATTR_V4_METER_POLICY_ID", + "0", + "SAI_ENI_ATTR_V6_METER_POLICY_ID", "0" ] }, @@ -209,6 +213,10 @@ "SAI_ENI_ATTR_OUTBOUND_V6_STAGE4_DASH_ACL_GROUP_ID", "0", "SAI_ENI_ATTR_OUTBOUND_V6_STAGE5_DASH_ACL_GROUP_ID", + "0", + "SAI_ENI_ATTR_V4_METER_POLICY_ID", + "0", + "SAI_ENI_ATTR_V6_METER_POLICY_ID", "0" ] }, diff --git a/test/test-cases/functional/saic/config_outbound_setup_commands.json b/test/test-cases/functional/saic/config_outbound_setup_commands.json index ddaf81518..a8d6ec526 100644 --- a/test/test-cases/functional/saic/config_outbound_setup_commands.json +++ b/test/test-cases/functional/saic/config_outbound_setup_commands.json @@ -91,7 +91,9 @@ "SAI_ENI_ATTR_OUTBOUND_V6_STAGE2_DASH_ACL_GROUP_ID", "0", "SAI_ENI_ATTR_OUTBOUND_V6_STAGE3_DASH_ACL_GROUP_ID", "0", "SAI_ENI_ATTR_OUTBOUND_V6_STAGE4_DASH_ACL_GROUP_ID", "0", - "SAI_ENI_ATTR_OUTBOUND_V6_STAGE5_DASH_ACL_GROUP_ID", "0" + "SAI_ENI_ATTR_OUTBOUND_V6_STAGE5_DASH_ACL_GROUP_ID", "0", + "SAI_ENI_ATTR_V4_METER_POLICY_ID", "0", + "SAI_ENI_ATTR_V6_METER_POLICY_ID", "0" ] }, { @@ -125,7 +127,9 @@ "SAI_ENI_ATTR_OUTBOUND_V6_STAGE2_DASH_ACL_GROUP_ID", "0", "SAI_ENI_ATTR_OUTBOUND_V6_STAGE3_DASH_ACL_GROUP_ID", "0", "SAI_ENI_ATTR_OUTBOUND_V6_STAGE4_DASH_ACL_GROUP_ID", "0", - "SAI_ENI_ATTR_OUTBOUND_V6_STAGE5_DASH_ACL_GROUP_ID", "0" + "SAI_ENI_ATTR_OUTBOUND_V6_STAGE5_DASH_ACL_GROUP_ID", "0", + "SAI_ENI_ATTR_V4_METER_POLICY_ID", "0", + "SAI_ENI_ATTR_V6_METER_POLICY_ID", "0" ] }, @@ -164,7 +168,9 @@ }, "attributes": [ "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_ACTION", "SAI_OUTBOUND_ROUTING_ENTRY_ACTION_ROUTE_VNET", - "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_DST_VNET_ID", "$vnet" + "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_DST_VNET_ID", "$vnet", + "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_METER_POLICY_EN", "False", + "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_METER_CLASS", "0" ] }, { @@ -178,7 +184,9 @@ }, "attributes": [ "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_ACTION", "SAI_OUTBOUND_ROUTING_ENTRY_ACTION_ROUTE_VNET", - "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_DST_VNET_ID", "$vnet" + "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_DST_VNET_ID", "$vnet", + "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_METER_POLICY_EN", "False", + "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_METER_CLASS", "0" ] }, @@ -194,7 +202,9 @@ "attributes": [ "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_UNDERLAY_DIP", "221.0.2.101", "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_OVERLAY_DMAC", "00:1b:6e:00:00:01", - "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_USE_DST_VNET_VNI", "True" + "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_USE_DST_VNET_VNI", "True", + "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_METER_CLASS", "0", + "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_METER_CLASS_OVERRIDE", "False" ] }, { @@ -209,7 +219,9 @@ "attributes": [ "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_UNDERLAY_DIP", "221.0.1.11", "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_OVERLAY_DMAC", "00:1A:C5:00:00:01", - "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_USE_DST_VNET_VNI", "True" + "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_USE_DST_VNET_VNI", "True", + "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_METER_CLASS", "0", + "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_METER_CLASS_OVERRIDE", "False" ] } ] diff --git a/test/test-cases/functional/saic/sai-api/test_sai_api_vnet_eni.py b/test/test-cases/functional/saic/sai-api/test_sai_api_vnet_eni.py index e80491573..4732f4e5d 100644 --- a/test/test-cases/functional/saic/sai-api/test_sai_api_vnet_eni.py +++ b/test/test-cases/functional/saic/sai-api/test_sai_api_vnet_eni.py @@ -7,7 +7,6 @@ class TestSaiVnetEni: - def test_vnet_eni_create(self, dpu): commands = [ @@ -84,6 +83,10 @@ def test_vnet_eni_create(self, dpu): "SAI_ENI_ATTR_OUTBOUND_V6_STAGE4_DASH_ACL_GROUP_ID", "0", "SAI_ENI_ATTR_OUTBOUND_V6_STAGE5_DASH_ACL_GROUP_ID", + "0", + "SAI_ENI_ATTR_V4_METER_POLICY_ID", + "0", + "SAI_ENI_ATTR_V6_METER_POLICY_ID", "0" ] }, diff --git a/test/test-cases/functional/saic/sai-api/test_sai_api_vnet_in_route.py b/test/test-cases/functional/saic/sai-api/test_sai_api_vnet_in_route.py index b0c21cf4d..42c09c0b1 100644 --- a/test/test-cases/functional/saic/sai-api/test_sai_api_vnet_in_route.py +++ b/test/test-cases/functional/saic/sai-api/test_sai_api_vnet_in_route.py @@ -90,6 +90,10 @@ def test_vnet_inbound_routing_entry_create_setup(self, dpu): "SAI_ENI_ATTR_OUTBOUND_V6_STAGE4_DASH_ACL_GROUP_ID", "0", "SAI_ENI_ATTR_OUTBOUND_V6_STAGE5_DASH_ACL_GROUP_ID", + "0", + "SAI_ENI_ATTR_V4_METER_POLICY_ID", + "0", + "SAI_ENI_ATTR_V6_METER_POLICY_ID", "0" ] }, diff --git a/test/test-cases/functional/saic/sai-api/test_sai_api_vnet_out_route.py b/test/test-cases/functional/saic/sai-api/test_sai_api_vnet_out_route.py index d42a7b5a1..12d337324 100644 --- a/test/test-cases/functional/saic/sai-api/test_sai_api_vnet_out_route.py +++ b/test/test-cases/functional/saic/sai-api/test_sai_api_vnet_out_route.py @@ -89,6 +89,10 @@ def test_vnet_outbound_routing_entry_create(self, dpu): "SAI_ENI_ATTR_OUTBOUND_V6_STAGE4_DASH_ACL_GROUP_ID", "0", "SAI_ENI_ATTR_OUTBOUND_V6_STAGE5_DASH_ACL_GROUP_ID", + "0", + "SAI_ENI_ATTR_V4_METER_POLICY_ID", + "0", + "SAI_ENI_ATTR_V6_METER_POLICY_ID", "0" ] }, @@ -109,7 +113,9 @@ def test_vnet_outbound_routing_entry_create(self, dpu): }, "attributes": [ "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_ACTION", "SAI_OUTBOUND_ROUTING_ENTRY_ACTION_ROUTE_VNET", - "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_DST_VNET_ID", "$vnet" + "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_DST_VNET_ID", "$vnet", + "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_METER_POLICY_EN", "False", + "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_METER_CLASS", "0" ] }, ] @@ -146,7 +152,9 @@ def test_vnet_outbound_routing_entry_set(self, dpu): }, "attributes": [ "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_ACTION", "SAI_OUTBOUND_ROUTING_ENTRY_ACTION_ROUTE_VNET", - "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_DST_VNET_ID", "$vnet" + "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_DST_VNET_ID", "$vnet", + "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_METER_POLICY_EN", "False", + "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_METER_CLASS", "0" ] }, ] diff --git a/test/test-cases/functional/saic/sai-api/test_sai_api_vnet_pa_entry.py b/test/test-cases/functional/saic/sai-api/test_sai_api_vnet_pa_entry.py index 37367a49f..9439d01b6 100644 --- a/test/test-cases/functional/saic/sai-api/test_sai_api_vnet_pa_entry.py +++ b/test/test-cases/functional/saic/sai-api/test_sai_api_vnet_pa_entry.py @@ -10,7 +10,7 @@ class TestSaiVnetPaEntry: - + def test_vnet_pa_validation_entry_create(self, dpu): # Create VNET diff --git a/test/test-cases/functional/saic/sai-api/test_sai_api_vnet_vni.py b/test/test-cases/functional/saic/sai-api/test_sai_api_vnet_vni.py index cd2154bbf..c97b4c45a 100644 --- a/test/test-cases/functional/saic/sai-api/test_sai_api_vnet_vni.py +++ b/test/test-cases/functional/saic/sai-api/test_sai_api_vnet_vni.py @@ -77,6 +77,7 @@ def test_vnet_vni_get2(self, dpu): print("\n======= SAI commands RETURN values get =======") pprint(results) + @pytest.mark.skip(reason="get and set not implemented, yet") def test_vnet_vni_remove(self, dpu): commands = [ diff --git a/test/test-cases/functional/saic/tutorial/test_sai_vnet_outbound_small_scale_config_via_dpugen.py b/test/test-cases/functional/saic/tutorial/test_sai_vnet_outbound_small_scale_config_via_dpugen.py index a2eb8bc48..2f071c497 100755 --- a/test/test-cases/functional/saic/tutorial/test_sai_vnet_outbound_small_scale_config_via_dpugen.py +++ b/test/test-cases/functional/saic/tutorial/test_sai_vnet_outbound_small_scale_config_via_dpugen.py @@ -45,6 +45,13 @@ NUMBER_OF_IN_ACL_GROUP = 0 NUMBER_OF_OUT_ACL_GROUP = 0 +def add_meter_attrs(attr_type, attrs, ext): + i = 0 + for item in attrs: + if item['type'] == attr_type: + attrs[i]['attributes'].extend(ext) + i += 1 + return attrs class TestSaiVnetOutbound: def make_create_commands(self): """ Generate a configuration @@ -52,7 +59,14 @@ def make_create_commands(self): """ conf = dpugen.sai.SaiConfig() conf.generate() - return conf.items() + ret = add_meter_attrs('SAI_OBJECT_TYPE_ENI', conf.items(), ["SAI_ENI_ATTR_V4_METER_POLICY_ID", "0", "SAI_ENI_ATTR_V6_METER_POLICY_ID", "0"]) + + ret = add_meter_attrs('SAI_OBJECT_TYPE_OUTBOUND_CA_TO_PA_ENTRY', ret, [ 'SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_METER_CLASS', '0', + 'SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_METER_CLASS_OVERRIDE', 'True' ]) + + ret = add_meter_attrs('SAI_OBJECT_TYPE_OUTBOUND_ROUTING_ENTRY', ret, [ 'SAI_OUTBOUND_ROUTING_ENTRY_ATTR_METER_POLICY_EN', 'True', + 'SAI_OUTBOUND_ROUTING_ENTRY_ATTR_METER_CLASS', '0' ]) + return ret def make_remove_commands(self): """ Generate a configuration to remove entries diff --git a/test/test-cases/functional/saic/tutorial/test_sai_vnet_outbound_small_scale_config_via_dpugen_create.json b/test/test-cases/functional/saic/tutorial/test_sai_vnet_outbound_small_scale_config_via_dpugen_create.json index 80e4750e7..1c0ff3b13 100644 --- a/test/test-cases/functional/saic/tutorial/test_sai_vnet_outbound_small_scale_config_via_dpugen_create.json +++ b/test/test-cases/functional/saic/tutorial/test_sai_vnet_outbound_small_scale_config_via_dpugen_create.json @@ -132,6 +132,10 @@ "SAI_ENI_ATTR_OUTBOUND_V6_STAGE4_DASH_ACL_GROUP_ID", "0", "SAI_ENI_ATTR_OUTBOUND_V6_STAGE5_DASH_ACL_GROUP_ID", + "0", + "SAI_ENI_ATTR_V4_METER_POLICY_ID", + "0", + "SAI_ENI_ATTR_V6_METER_POLICY_ID", "0" ] }, @@ -193,6 +197,10 @@ "SAI_ENI_ATTR_OUTBOUND_V6_STAGE4_DASH_ACL_GROUP_ID", "0", "SAI_ENI_ATTR_OUTBOUND_V6_STAGE5_DASH_ACL_GROUP_ID", + "0", + "SAI_ENI_ATTR_V4_METER_POLICY_ID", + "0", + "SAI_ENI_ATTR_V6_METER_POLICY_ID", "0" ] }, @@ -235,7 +243,11 @@ "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_ACTION", "SAI_OUTBOUND_ROUTING_ENTRY_ACTION_ROUTE_VNET", "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_DST_VNET_ID", - "$vnet_#5000" + "$vnet_#5000", + "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_METER_POLICY_EN", + "False", + "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_METER_CLASS", + "0" ] }, { @@ -251,7 +263,11 @@ "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_ACTION", "SAI_OUTBOUND_ROUTING_ENTRY_ACTION_ROUTE_VNET", "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_DST_VNET_ID", - "$vnet_#6000" + "$vnet_#6000", + "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_METER_POLICY_EN", + "False", + "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_METER_CLASS", + "0" ] }, { @@ -269,7 +285,11 @@ "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_OVERLAY_DMAC", "00:1B:6E:00:00:01", "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_USE_DST_VNET_VNI", - "True" + "True", + "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_METER_CLASS", + "0", + "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_METER_CLASS_OVERRIDE", + "False" ] }, { @@ -287,7 +307,11 @@ "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_OVERLAY_DMAC", "00:1B:6E:18:00:01", "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_USE_DST_VNET_VNI", - "True" + "True", + "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_METER_CLASS", + "0", + "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_METER_CLASS_OVERRIDE", + "False" ] } ] diff --git a/test/test-cases/scale/saic/test_sai_vnet_outbound_scale.py b/test/test-cases/scale/saic/test_sai_vnet_outbound_scale.py index 49f390c49..8e84bd6e5 100755 --- a/test/test-cases/scale/saic/test_sai_vnet_outbound_scale.py +++ b/test/test-cases/scale/saic/test_sai_vnet_outbound_scale.py @@ -97,7 +97,13 @@ } } - +def add_meter_attrs(attr_type, attrs, ext): + i = 0 + for item in attrs: + if item['type'] == attr_type: + attrs[i]['attributes'].extend(ext) + i += 1 + return attrs class TestSaiVnetOutbound: def make_create_vnet_config(self): """ Generate a configuration @@ -106,7 +112,14 @@ def make_create_vnet_config(self): conf = dpugen.sai.SaiConfig() conf.mergeParams(TEST_VNET_OUTBOUND_CONFIG_SCALE) conf.generate() - return conf.items() + ret = add_meter_attrs('SAI_OBJECT_TYPE_ENI', conf.items(), ["SAI_ENI_ATTR_V4_METER_POLICY_ID", "0", "SAI_ENI_ATTR_V6_METER_POLICY_ID", "0"]) + + ret = add_meter_attrs('SAI_OBJECT_TYPE_OUTBOUND_CA_TO_PA_ENTRY', ret, [ 'SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_METER_CLASS', '0', + 'SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_METER_CLASS_OVERRIDE', 'True' ]) + + ret = add_meter_attrs('SAI_OBJECT_TYPE_OUTBOUND_ROUTING_ENTRY', ret, [ 'SAI_OUTBOUND_ROUTING_ENTRY_ATTR_METER_POLICY_EN', 'True', + 'SAI_OUTBOUND_ROUTING_ENTRY_ATTR_METER_CLASS', '0' ]) + return ret def make_remove_vnet_config(self): """ Generate a configuration to remove entries diff --git a/test/test-cases/scale/saic/vnet_inbound_setup_commands.json b/test/test-cases/scale/saic/vnet_inbound_setup_commands.json index e43e09c09..20113fdd3 100644 --- a/test/test-cases/scale/saic/vnet_inbound_setup_commands.json +++ b/test/test-cases/scale/saic/vnet_inbound_setup_commands.json @@ -110,6 +110,10 @@ "SAI_ENI_ATTR_OUTBOUND_V6_STAGE4_DASH_ACL_GROUP_ID", "0", "SAI_ENI_ATTR_OUTBOUND_V6_STAGE5_DASH_ACL_GROUP_ID", + "0", + "SAI_ENI_ATTR_V4_METER_POLICY_ID", + "0", + "SAI_ENI_ATTR_V6_METER_POLICY_ID", "0" ] }, diff --git a/test/test-cases/scale/saic/vnet_outbound_setup_commands_scale.json b/test/test-cases/scale/saic/vnet_outbound_setup_commands_scale.json index 564e8798a..db575f3ce 100644 --- a/test/test-cases/scale/saic/vnet_outbound_setup_commands_scale.json +++ b/test/test-cases/scale/saic/vnet_outbound_setup_commands_scale.json @@ -126,7 +126,9 @@ "SAI_ENI_ATTR_OUTBOUND_V6_STAGE2_DASH_ACL_GROUP_ID", "0", "SAI_ENI_ATTR_OUTBOUND_V6_STAGE3_DASH_ACL_GROUP_ID", "0", "SAI_ENI_ATTR_OUTBOUND_V6_STAGE4_DASH_ACL_GROUP_ID", "0", - "SAI_ENI_ATTR_OUTBOUND_V6_STAGE5_DASH_ACL_GROUP_ID", "0" + "SAI_ENI_ATTR_OUTBOUND_V6_STAGE5_DASH_ACL_GROUP_ID", "0", + "SAI_ENI_ATTR_V4_METER_POLICY_ID", "0", + "SAI_ENI_ATTR_V6_METER_POLICY_ID", "0" ] }, { @@ -160,7 +162,9 @@ "SAI_ENI_ATTR_OUTBOUND_V6_STAGE2_DASH_ACL_GROUP_ID", "0", "SAI_ENI_ATTR_OUTBOUND_V6_STAGE3_DASH_ACL_GROUP_ID", "0", "SAI_ENI_ATTR_OUTBOUND_V6_STAGE4_DASH_ACL_GROUP_ID", "0", - "SAI_ENI_ATTR_OUTBOUND_V6_STAGE5_DASH_ACL_GROUP_ID", "0" + "SAI_ENI_ATTR_OUTBOUND_V6_STAGE5_DASH_ACL_GROUP_ID", "0", + "SAI_ENI_ATTR_V4_METER_POLICY_ID", "0", + "SAI_ENI_ATTR_V6_METER_POLICY_ID", "0" ] }, { @@ -198,7 +202,9 @@ }, "attributes": [ "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_ACTION", "SAI_OUTBOUND_ROUTING_ENTRY_ACTION_ROUTE_VNET", - "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_DST_VNET_ID", "$vnet_#0" + "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_DST_VNET_ID", "$vnet_#0", + "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_METER_POLICY_EN", "False", + "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_METER_CLASS", "0" ] }, { @@ -212,7 +218,9 @@ }, "attributes": [ "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_ACTION", "SAI_OUTBOUND_ROUTING_ENTRY_ACTION_ROUTE_VNET", - "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_DST_VNET_ID", "$vnet_#1" + "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_DST_VNET_ID", "$vnet_#1", + "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_METER_POLICY_EN", "False", + "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_METER_CLASS", "0" ] }, { @@ -226,7 +234,9 @@ }, "attributes": [ "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_ACTION", "SAI_OUTBOUND_ROUTING_ENTRY_ACTION_ROUTE_VNET", - "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_DST_VNET_ID", "$vnet_#2" + "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_DST_VNET_ID", "$vnet_#2", + "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_METER_POLICY_EN", "False", + "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_METER_CLASS", "0" ] }, { @@ -240,7 +250,9 @@ }, "attributes": [ "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_ACTION", "SAI_OUTBOUND_ROUTING_ENTRY_ACTION_ROUTE_VNET", - "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_DST_VNET_ID", "$vnet_#3" + "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_DST_VNET_ID", "$vnet_#3", + "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_METER_POLICY_EN", "False", + "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_METER_CLASS", "0" ] }, { @@ -255,7 +267,10 @@ "attributes": [ "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_UNDERLAY_DIP", "172.16.1.20", "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_OVERLAY_DMAC", "00:DD:DD:DD:DD:00", - "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_USE_DST_VNET_VNI", "True" + "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_USE_DST_VNET_VNI", "True", + "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_USE_DST_VNET_VNI", "True", + "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_METER_CLASS", "0", + "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_METER_CLASS_OVERRIDE", "False" ] }, { @@ -270,7 +285,9 @@ "attributes": [ "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_UNDERLAY_DIP", "172.16.2.20", "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_OVERLAY_DMAC", "00:DD:DD:DD:DD:01", - "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_USE_DST_VNET_VNI", "True" + "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_USE_DST_VNET_VNI", "True", + "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_METER_CLASS", "0", + "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_METER_CLASS_OVERRIDE", "False" ] }, { @@ -285,7 +302,9 @@ "attributes": [ "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_UNDERLAY_DIP", "172.16.3.20", "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_OVERLAY_DMAC", "00:DD:DD:DD:DD:02", - "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_USE_DST_VNET_VNI", "True" + "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_USE_DST_VNET_VNI", "True", + "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_METER_CLASS", "0", + "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_METER_CLASS_OVERRIDE", "False" ] }, { @@ -300,7 +319,9 @@ "attributes": [ "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_UNDERLAY_DIP", "172.16.4.20", "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_OVERLAY_DMAC", "00:DD:DD:DD:DD:03", - "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_USE_DST_VNET_VNI", "True" + "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_USE_DST_VNET_VNI", "True", + "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_METER_CLASS", "0", + "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_METER_CLASS_OVERRIDE", "False" ] }, { @@ -315,7 +336,9 @@ "attributes": [ "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_UNDERLAY_DIP", "172.16.5.20", "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_OVERLAY_DMAC", "00:DD:DD:DD:DD:04", - "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_USE_DST_VNET_VNI", "True" + "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_USE_DST_VNET_VNI", "True", + "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_METER_CLASS", "0", + "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_METER_CLASS_OVERRIDE", "False" ] }, { @@ -330,7 +353,9 @@ "attributes": [ "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_UNDERLAY_DIP", "172.16.6.20", "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_OVERLAY_DMAC", "00:DD:DD:DD:DD:05", - "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_USE_DST_VNET_VNI", "True" + "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_USE_DST_VNET_VNI", "True", + "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_METER_CLASS", "0", + "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_METER_CLASS_OVERRIDE", "False" ] }, { @@ -345,7 +370,9 @@ "attributes": [ "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_UNDERLAY_DIP", "172.16.7.20", "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_OVERLAY_DMAC", "00:DD:DD:DD:DD:06", - "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_USE_DST_VNET_VNI", "True" + "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_USE_DST_VNET_VNI", "True", + "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_METER_CLASS", "0", + "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_METER_CLASS_OVERRIDE", "False" ] }, { @@ -360,7 +387,9 @@ "attributes": [ "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_UNDERLAY_DIP", "172.16.8.20", "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_OVERLAY_DMAC", "00:DD:DD:DD:DD:07", - "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_USE_DST_VNET_VNI", "True" + "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_USE_DST_VNET_VNI", "True", + "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_METER_CLASS", "0", + "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_METER_CLASS_OVERRIDE", "False" ] } ] diff --git a/test/test-cases/scale/saic/vnet_outbound_setup_commands_simple.json b/test/test-cases/scale/saic/vnet_outbound_setup_commands_simple.json index 087132275..133adf5ae 100644 --- a/test/test-cases/scale/saic/vnet_outbound_setup_commands_simple.json +++ b/test/test-cases/scale/saic/vnet_outbound_setup_commands_simple.json @@ -78,7 +78,9 @@ "SAI_ENI_ATTR_OUTBOUND_V6_STAGE2_DASH_ACL_GROUP_ID", "0", "SAI_ENI_ATTR_OUTBOUND_V6_STAGE3_DASH_ACL_GROUP_ID", "0", "SAI_ENI_ATTR_OUTBOUND_V6_STAGE4_DASH_ACL_GROUP_ID", "0", - "SAI_ENI_ATTR_OUTBOUND_V6_STAGE5_DASH_ACL_GROUP_ID", "0" + "SAI_ENI_ATTR_OUTBOUND_V6_STAGE5_DASH_ACL_GROUP_ID", "0", + "SAI_ENI_ATTR_V4_METER_POLICY_ID", "0", + "SAI_ENI_ATTR_V6_METER_POLICY_ID", "0" ] }, { @@ -104,7 +106,9 @@ }, "attributes": [ "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_ACTION", "SAI_OUTBOUND_ROUTING_ENTRY_ACTION_ROUTE_VNET", - "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_DST_VNET_ID", "$vnet" + "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_DST_VNET_ID", "$vnet", + "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_METER_POLICY_EN", "False", + "SAI_OUTBOUND_ROUTING_ENTRY_ATTR_METER_CLASS", "0" ] }, { @@ -119,7 +123,9 @@ "attributes": [ "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_UNDERLAY_DIP", "172.16.1.20", "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_OVERLAY_DMAC", "00:DD:DD:DD:00:00", - "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_USE_DST_VNET_VNI", "True" + "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_USE_DST_VNET_VNI", "True", + "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_METER_CLASS", "0", + "SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_METER_CLASS_OVERRIDE", "False" ] } ]