Skip to content

Commit

Permalink
[submodule] Update SAI submodule to v1.13 (#1292)
Browse files Browse the repository at this point in the history
Add needed changes and new files required by new SAI version
  • Loading branch information
kcudnik authored Sep 19, 2023
1 parent cfa8da4 commit edf6597
Show file tree
Hide file tree
Showing 25 changed files with 152 additions and 3 deletions.
2 changes: 1 addition & 1 deletion SAI
Submodule SAI updated 107 files
4 changes: 3 additions & 1 deletion lib/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ libsairedis_la_SOURCES = \
sai_redis_ipsec.cpp \
sai_redis_my_mac.cpp \
sai_redis_ars.cpp \
sai_redis_ars_profile.cpp
sai_redis_ars_profile.cpp \
sai_redis_twamp.cpp \
sai_redis_dash_meter.cpp

libSaiRedis_a_CPPFLAGS = $(CODE_COVERAGE_CPPFLAGS)
libSaiRedis_a_CXXFLAGS = $(DBGFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS_COMMON) $(CODE_COVERAGE_CXXFLAGS)
Expand Down
2 changes: 2 additions & 0 deletions lib/sai_redis.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ PRIVATE extern const sai_vlan_api_t redis_vlan_api;
PRIVATE extern const sai_wred_api_t redis_wred_api;
PRIVATE extern const sai_my_mac_api_t redis_my_mac_api;
PRIVATE extern const sai_ipsec_api_t redis_ipsec_api;
PRIVATE extern const sai_twamp_api_t redis_twamp_api;
PRIVATE extern const sai_dash_meter_api_t redis_dash_meter_api;

PRIVATE extern std::shared_ptr<sairedis::SaiInterface> redis_sai;

Expand Down
2 changes: 2 additions & 0 deletions lib/sai_redis_acl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ REDIS_GENERIC_QUAD(ACL_COUNTER,acl_counter);
REDIS_GENERIC_QUAD(ACL_RANGE,acl_range);
REDIS_GENERIC_QUAD(ACL_TABLE_GROUP,acl_table_group);
REDIS_GENERIC_QUAD(ACL_TABLE_GROUP_MEMBER,acl_table_group_member);
REDIS_GENERIC_QUAD(ACL_TABLE_CHAIN_GROUP,acl_table_chain_group)

const sai_acl_api_t redis_acl_api = {

Expand All @@ -15,4 +16,5 @@ const sai_acl_api_t redis_acl_api = {
REDIS_GENERIC_QUAD_API(acl_range)
REDIS_GENERIC_QUAD_API(acl_table_group)
REDIS_GENERIC_QUAD_API(acl_table_group_member)
REDIS_GENERIC_QUAD_API(acl_table_chain_group)
};
28 changes: 28 additions & 0 deletions lib/sai_redis_dash_meter.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#include "sai_redis.h"

REDIS_GENERIC_QUAD(METER_BUCKET, meter_bucket);
REDIS_BULK_CREATE(METER_BUCKET, meter_buckets);
REDIS_BULK_REMOVE(METER_BUCKET, meter_buckets);

REDIS_GENERIC_QUAD(METER_BUCKET, meter_policy);
REDIS_BULK_CREATE(METER_BUCKET, meter_policys);
REDIS_BULK_REMOVE(METER_BUCKET, meter_policys);

REDIS_GENERIC_QUAD(METER_BUCKET, meter_rule);
REDIS_BULK_CREATE(METER_BUCKET, meter_rules);
REDIS_BULK_REMOVE(METER_BUCKET, meter_rules);

const sai_dash_meter_api_t redis_dash_meter_api = {

REDIS_GENERIC_QUAD_API(meter_bucket)
redis_bulk_create_meter_buckets,
redis_bulk_remove_meter_buckets,

REDIS_GENERIC_QUAD_API(meter_policy)
redis_bulk_create_meter_policys,
redis_bulk_remove_meter_policys,

REDIS_GENERIC_QUAD_API(meter_rule)
redis_bulk_create_meter_rules,
redis_bulk_remove_meter_rules,
};
2 changes: 2 additions & 0 deletions lib/sai_redis_interfacequery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,13 @@ static sai_apis_t redis_apis = {
API(generic_programmable),
API(ars),
API(ars_profile),
API(twamp),
API(bmtor),
API(dash_acl),
API(dash_direction_lookup),
API(dash_eni),
API(dash_inbound_routing),
API(dash_meter),
API(dash_outbound_ca_to_pa),
API(dash_outbound_routing),
API(dash_vnet),
Expand Down
2 changes: 2 additions & 0 deletions lib/sai_redis_nexthop.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#include "sai_redis.h"

REDIS_GENERIC_QUAD(NEXT_HOP,next_hop);
REDIS_BULK_QUAD(NEXT_HOP,next_hop);

const sai_next_hop_api_t redis_next_hop_api = {

REDIS_GENERIC_QUAD_API(next_hop)
REDIS_BULK_QUAD_API(next_hop)
};
2 changes: 2 additions & 0 deletions lib/sai_redis_port.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ REDIS_GENERIC_QUAD(PORT_CONNECTOR,port_connector);
REDIS_GENERIC_STATS(PORT,port);
REDIS_GENERIC_STATS(PORT_POOL,port_pool);
REDIS_BULK_QUAD(PORT, ports);
REDIS_BULK_QUAD(PORT_SERDES, port_serdeses);

const sai_port_api_t redis_port_api = {

Expand All @@ -28,4 +29,5 @@ const sai_port_api_t redis_port_api = {
REDIS_GENERIC_QUAD_API(port_connector)
REDIS_GENERIC_QUAD_API(port_serdes)
REDIS_BULK_QUAD_API(ports)
REDIS_BULK_QUAD_API(port_serdeses)
};
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)
};
9 changes: 9 additions & 0 deletions lib/sai_redis_twamp.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include "sai_redis.h"

REDIS_GENERIC_QUAD(TWAMP_SESSION,twamp_session);
REDIS_GENERIC_STATS(TWAMP_SESSION,twamp_session);

const sai_twamp_api_t redis_twamp_api = {
REDIS_GENERIC_QUAD_API(twamp_session)
REDIS_GENERIC_STATS_API(twamp_session)
};
6 changes: 6 additions & 0 deletions meta/Meta.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3800,6 +3800,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
12 changes: 12 additions & 0 deletions meta/SaiSerialize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,18 @@ sai_status_t transfer_attribute(
RETURN_ON_ERROR(transfer_list(src_attr.value.ipprefixlist, dst_attr.value.ipprefixlist, countOnly));
break;

case SAI_ATTR_VALUE_TYPE_PORT_FREQUENCY_OFFSET_PPM_LIST:
RETURN_ON_ERROR(transfer_list(src_attr.value.portfrequencyoffsetppmlist, dst_attr.value.portfrequencyoffsetppmlist, countOnly));
break;

case SAI_ATTR_VALUE_TYPE_PORT_SNR_LIST:
RETURN_ON_ERROR(transfer_list(src_attr.value.portsnrlist, dst_attr.value.portsnrlist, countOnly));
break;

case SAI_ATTR_VALUE_TYPE_ACL_CHAIN_LIST:
RETURN_ON_ERROR(transfer_list(src_attr.value.aclchainlist, dst_attr.value.aclchainlist, countOnly));
break;

default:
SWSS_LOG_THROW("sai attr value %s is not implemented, FIXME", sai_serialize_attr_value_type(serialization_type).c_str());
}
Expand Down
3 changes: 3 additions & 0 deletions syncd/SwitchNotifications.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,14 @@ namespace syncd
.on_ipsec_sa_status_change = nullptr,
.on_nat_event = &Slot<context>::onNatEvent,
.on_packet_event = nullptr,
.on_port_host_tx_ready = nullptr,
.on_port_state_change = &Slot<context>::onPortStateChange,
.on_queue_pfc_deadlock = &Slot<context>::onQueuePfcDeadlock,
.on_switch_asic_sdk_health_event = nullptr,
.on_switch_shutdown_request = &Slot<context>::onSwitchShutdownRequest,
.on_switch_state_change = &Slot<context>::onSwitchStateChange,
.on_tam_event = nullptr,
.on_twamp_session_event = nullptr,
}) { }

virtual ~Slot() {}
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
3 changes: 3 additions & 0 deletions unittest/meta/TestSaiSerialize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ TEST(SaiSerialize, sai_serialize_attr_value)
case SAI_ATTR_VALUE_TYPE_SEGMENT_LIST:
case SAI_ATTR_VALUE_TYPE_TLV_LIST:
case SAI_ATTR_VALUE_TYPE_MAP_LIST:
case SAI_ATTR_VALUE_TYPE_PORT_FREQUENCY_OFFSET_PPM_LIST:
case SAI_ATTR_VALUE_TYPE_PORT_SNR_LIST:
case SAI_ATTR_VALUE_TYPE_ACL_CHAIN_LIST:
continue;

default:
Expand Down
4 changes: 3 additions & 1 deletion vslib/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@ libsaivs_la_SOURCES = \
sai_vs_my_mac.cpp \
sai_vs_ipsec.cpp \
sai_vs_ars.cpp \
sai_vs_ars_profile.cpp
sai_vs_ars_profile.cpp \
sai_vs_twamp.cpp \
sai_vs_dash_meter.cpp

libSaiVS_a_CPPFLAGS = $(CODE_COVERAGE_CPPFLAGS)
libSaiVS_a_CXXFLAGS = $(DBGFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS_COMMON) $(CODE_COVERAGE_CXXFLAGS)
Expand Down
2 changes: 2 additions & 0 deletions vslib/sai_vs.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ PRIVATE extern const sai_vlan_api_t vs_vlan_api;
PRIVATE extern const sai_wred_api_t vs_wred_api;
PRIVATE extern const sai_my_mac_api_t vs_my_mac_api;
PRIVATE extern const sai_ipsec_api_t vs_ipsec_api;
PRIVATE extern const sai_twamp_api_t vs_twamp_api;
PRIVATE extern const sai_dash_meter_api_t vs_dash_meter_api;

PRIVATE extern std::shared_ptr<sairedis::SaiInterface> vs_sai;

Expand Down
2 changes: 2 additions & 0 deletions vslib/sai_vs_acl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ VS_GENERIC_QUAD(ACL_COUNTER,acl_counter);
VS_GENERIC_QUAD(ACL_RANGE,acl_range);
VS_GENERIC_QUAD(ACL_TABLE_GROUP,acl_table_group);
VS_GENERIC_QUAD(ACL_TABLE_GROUP_MEMBER,acl_table_group_member);
VS_GENERIC_QUAD(ACL_TABLE_CHAIN_GROUP,acl_table_chain_group)

const sai_acl_api_t vs_acl_api = {

Expand All @@ -15,4 +16,5 @@ const sai_acl_api_t vs_acl_api = {
VS_GENERIC_QUAD_API(acl_range)
VS_GENERIC_QUAD_API(acl_table_group)
VS_GENERIC_QUAD_API(acl_table_group_member)
VS_GENERIC_QUAD_API(acl_table_chain_group)
};
28 changes: 28 additions & 0 deletions vslib/sai_vs_dash_meter.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#include "sai_vs.h"

VS_GENERIC_QUAD(METER_BUCKET, meter_bucket);
VS_BULK_CREATE(METER_BUCKET, meter_buckets);
VS_BULK_REMOVE(METER_BUCKET, meter_buckets);

VS_GENERIC_QUAD(METER_BUCKET, meter_policy);
VS_BULK_CREATE(METER_BUCKET, meter_policys);
VS_BULK_REMOVE(METER_BUCKET, meter_policys);

VS_GENERIC_QUAD(METER_BUCKET, meter_rule);
VS_BULK_CREATE(METER_BUCKET, meter_rules);
VS_BULK_REMOVE(METER_BUCKET, meter_rules);

const sai_dash_meter_api_t vs_dash_meter_api = {

VS_GENERIC_QUAD_API(meter_bucket)
vs_bulk_create_meter_buckets,
vs_bulk_remove_meter_buckets,

VS_GENERIC_QUAD_API(meter_policy)
vs_bulk_create_meter_policys,
vs_bulk_remove_meter_policys,

VS_GENERIC_QUAD_API(meter_rule)
vs_bulk_create_meter_rules,
vs_bulk_remove_meter_rules,
};
2 changes: 2 additions & 0 deletions vslib/sai_vs_interfacequery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,13 @@ static sai_apis_t vs_apis = {
API(generic_programmable),
API(ars),
API(ars_profile),
API(twamp),
API(bmtor),
API(dash_acl),
API(dash_direction_lookup),
API(dash_eni),
API(dash_inbound_routing),
API(dash_meter),
API(dash_outbound_ca_to_pa),
API(dash_outbound_routing),
API(dash_vnet),
Expand Down
2 changes: 2 additions & 0 deletions vslib/sai_vs_nexthop.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#include "sai_vs.h"

VS_GENERIC_QUAD(NEXT_HOP,next_hop);
VS_BULK_QUAD(NEXT_HOP,next_hop);

const sai_next_hop_api_t vs_next_hop_api = {

VS_GENERIC_QUAD_API(next_hop)
VS_BULK_QUAD_API(next_hop)
};
2 changes: 2 additions & 0 deletions vslib/sai_vs_port.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ VS_GENERIC_QUAD(PORT_SERDES,port_serdes);
VS_GENERIC_STATS(PORT,port);
VS_GENERIC_STATS(PORT_POOL,port_pool);
VS_BULK_QUAD(PORT,ports);
VS_BULK_QUAD(PORT_SERDES, port_serdeses);

const sai_port_api_t vs_port_api = {

Expand All @@ -30,4 +31,5 @@ const sai_port_api_t vs_port_api = {

VS_GENERIC_QUAD_API(port_serdes)
VS_BULK_QUAD_API(ports)
VS_BULK_QUAD_API(port_serdeses)
};
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)
};
9 changes: 9 additions & 0 deletions vslib/sai_vs_twamp.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include "sai_vs.h"

VS_GENERIC_QUAD(TWAMP_SESSION,twamp_session);
VS_GENERIC_STATS(TWAMP_SESSION,twamp_session);

const sai_twamp_api_t vs_twamp_api = {
VS_GENERIC_QUAD_API(twamp_session)
VS_GENERIC_STATS_API(twamp_session)
};

0 comments on commit edf6597

Please sign in to comment.