Skip to content

Commit

Permalink
Support relaxed condition
Browse files Browse the repository at this point in the history
  • Loading branch information
kcudnik committed Sep 8, 2023
1 parent f89fe2e commit c6e0257
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/sai_redis_router_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

REDIS_GENERIC_QUAD(ROUTER_INTERFACE,router_interface);
REDIS_GENERIC_STATS(ROUTER_INTERFACE,router_interface);
REDIS_BULK_QUAD(ROUTER_INTERFACE,router_interfaces);

const sai_router_interface_api_t redis_router_interface_api = {

REDIS_GENERIC_QUAD_API(router_interface)
REDIS_GENERIC_STATS_API(router_interface)
REDIS_BULK_QUAD_API(router_interfaces)
};
6 changes: 6 additions & 0 deletions meta/Meta.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3793,6 +3793,12 @@ sai_status_t Meta::meta_generic_validation_create(
// maybe we can let it go here?
if (attrs.find(md.attrid) != attrs.end())
{
if (md.isconditionrelaxed)
{
META_LOG_WARN(md, "conditional, but condition was not met, this attribute is not required, but passed (relaxed condition)");
continue;
}

META_LOG_ERROR(md, "conditional, but condition was not met, this attribute is not required, but passed");

return SAI_STATUS_INVALID_PARAMETER;
Expand Down
9 changes: 9 additions & 0 deletions tests/BCM56850.pl
Original file line number Diff line number Diff line change
Expand Up @@ -811,8 +811,17 @@ sub test_acl_counter_match
}
}

sub test_relaxed
{
fresh_start;

play "relaxed.rec";
play "relaxed.rec", 0;
}

# RUN TESTS

test_relaxed;
test_acl_counter_match;
test_neighbor_lag;
test_lag_member;
Expand Down
14 changes: 14 additions & 0 deletions tests/BCM56850/relaxed.rec
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
2018-11-14.19:34:17.416379|a|INIT_VIEW
2018-11-14.19:34:17.419035|A|SAI_STATUS_SUCCESS
2018-11-14.19:34:17.420345|c|SAI_OBJECT_TYPE_SWITCH:oid:0x21000000000000|SAI_SWITCH_ATTR_INIT_SWITCH=true
2018-11-14.19:34:17.420634|g|SAI_OBJECT_TYPE_SWITCH:oid:0x21000000000000|SAI_SWITCH_ATTR_DEFAULT_VIRTUAL_ROUTER_ID=oid:0x0
2018-11-14.19:34:26.138403|G|SAI_STATUS_SUCCESS|SAI_SWITCH_ATTR_DEFAULT_VIRTUAL_ROUTER_ID=oid:0x3000000000022
2018-11-14.19:34:26.138714|c|SAI_OBJECT_TYPE_ROUTER_INTERFACE:oid:0x600000000058a|SAI_ROUTER_INTERFACE_ATTR_VIRTUAL_ROUTER_ID=oid:0x3000000000022|SAI_ROUTER_INTERFACE_ATTR_TYPE=SAI_ROUTER_INTERFACE_TYPE_LOOPBACK
2018-11-14.19:34:26.147205|g|SAI_OBJECT_TYPE_SWITCH:oid:0x21000000000000|SAI_SWITCH_ATTR_PORT_LIST=32:oid:0x0,oid:0x0,oid:0x0,oid:0x0,oid:0x0,oid:0x0,oid:0x0,oid:0x0,oid:0x0,oid:0x0,oid:0x0,oid:0x0,oid:0x0,oid:0x0,oid:0x0,oid:0x0,oid:0x0,oid:0x0,oid:0x0,oid:0x0,oid:0x0,oid:0x0,oid:0x0,oid:0x0,oid:0x0,oid:0x0,oid:0x0,oid:0x0,oid:0x0,oid:0x0,oid:0x0,oid:0x0
2018-11-14.19:34:26.151676|G|SAI_STATUS_SUCCESS|SAI_SWITCH_ATTR_PORT_LIST=32:oid:0x1000000000002,oid:0x1000000000003,oid:0x1000000000004,oid:0x1000000000005,oid:0x1000000000006,oid:0x1000000000007,oid:0x1000000000008,oid:0x1000000000009,oid:0x100000000000a,oid:0x100000000000b,oid:0x100000000000c,oid:0x100000000000d,oid:0x100000000000e,oid:0x100000000000f,oid:0x1000000000010,oid:0x1000000000011,oid:0x1000000000012,oid:0x1000000000013,oid:0x1000000000014,oid:0x1000000000015,oid:0x1000000000016,oid:0x1000000000017,oid:0x1000000000018,oid:0x1000000000019,oid:0x100000000001a,oid:0x100000000001b,oid:0x100000000001c,oid:0x100000000001d,oid:0x100000000001e,oid:0x100000000001f,oid:0x1000000000020,oid:0x1000000000021
2018-11-14.19:34:27.462885|c|SAI_OBJECT_TYPE_ROUTER_INTERFACE:oid:0x60000000005d7|SAI_ROUTER_INTERFACE_ATTR_VIRTUAL_ROUTER_ID=oid:0x3000000000022|SAI_ROUTER_INTERFACE_ATTR_TYPE=SAI_ROUTER_INTERFACE_TYPE_LOOPBACK
2018-11-14.19:34:27.463151|c|SAI_OBJECT_TYPE_TUNNEL:oid:0x2a0000000005d8|SAI_TUNNEL_ATTR_TYPE=SAI_TUNNEL_TYPE_IPINIP|SAI_TUNNEL_ATTR_OVERLAY_INTERFACE=oid:0x60000000005d7|SAI_TUNNEL_ATTR_UNDERLAY_INTERFACE=oid:0x600000000058a|SAI_TUNNEL_ATTR_DECAP_ECN_MODE=SAI_TUNNEL_DECAP_ECN_MODE_COPY_FROM_OUTER|SAI_TUNNEL_ATTR_DECAP_TTL_MODE=SAI_TUNNEL_TTL_MODE_PIPE_MODEL|SAI_TUNNEL_ATTR_DECAP_DSCP_MODE=SAI_TUNNEL_DSCP_MODE_PIPE_MODEL
2018-11-14.19:34:27.463380|c|SAI_OBJECT_TYPE_TUNNEL_TERM_TABLE_ENTRY:oid:0x2b0000000005d9|SAI_TUNNEL_TERM_TABLE_ENTRY_ATTR_VR_ID=oid:0x3000000000022|SAI_TUNNEL_TERM_TABLE_ENTRY_ATTR_TYPE=SAI_TUNNEL_TERM_TABLE_ENTRY_TYPE_P2MP|SAI_TUNNEL_TERM_TABLE_ENTRY_ATTR_TUNNEL_TYPE=SAI_TUNNEL_TYPE_IPINIP|SAI_TUNNEL_TERM_TABLE_ENTRY_ATTR_ACTION_TUNNEL_ID=oid:0x2a0000000005d8|SAI_TUNNEL_TERM_TABLE_ENTRY_ATTR_DST_IP=10.0.0.0|SAI_TUNNEL_TERM_TABLE_ENTRY_ATTR_SRC_IP=0.0.0.0
2018-11-14.19:34:27.463380|c|SAI_OBJECT_TYPE_TUNNEL_TERM_TABLE_ENTRY:oid:0x2b0000000005da|SAI_TUNNEL_TERM_TABLE_ENTRY_ATTR_VR_ID=oid:0x3000000000022|SAI_TUNNEL_TERM_TABLE_ENTRY_ATTR_TYPE=SAI_TUNNEL_TERM_TABLE_ENTRY_TYPE_MP2MP|SAI_TUNNEL_TERM_TABLE_ENTRY_ATTR_TUNNEL_TYPE=SAI_TUNNEL_TYPE_IPINIP|SAI_TUNNEL_TERM_TABLE_ENTRY_ATTR_ACTION_TUNNEL_ID=oid:0x2a0000000005d8|SAI_TUNNEL_TERM_TABLE_ENTRY_ATTR_DST_IP=10.0.0.0|SAI_TUNNEL_TERM_TABLE_ENTRY_ATTR_SRC_IP=0.0.0.0
2018-11-14.19:34:26.317753|a|APPLY_VIEW
2018-11-14.19:34:26.319120|A|SAI_STATUS_SUCCESS
2 changes: 2 additions & 0 deletions vslib/sai_vs_router_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

VS_GENERIC_QUAD(ROUTER_INTERFACE,router_interface);
VS_GENERIC_STATS(ROUTER_INTERFACE,router_interface);
VS_BULK_QUAD(ROUTER_INTERFACE,router_interfaces);

const sai_router_interface_api_t vs_router_interface_api = {

VS_GENERIC_QUAD_API(router_interface)
VS_GENERIC_STATS_API(router_interface)
VS_BULK_QUAD_API(router_interfaces)
};

0 comments on commit c6e0257

Please sign in to comment.