Skip to content

Commit

Permalink
SAI 1.3 changes (sonic-net#327)
Browse files Browse the repository at this point in the history
* Sync to SAI 1.3 header

* SAI v1.3 pointer update

* Updated queue deadlock to enque notification

* Update SAI pointer
  • Loading branch information
prsunny authored and lguohan committed Jul 3, 2018
1 parent 9846397 commit 8585fc8
Show file tree
Hide file tree
Showing 19 changed files with 370 additions and 44 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
path = SAI
url = https://github.com/opencomputeproject/SAI.git
ignore = dirty
branch = v1.2
branch = v1.3
30 changes: 30 additions & 0 deletions lib/src/sai_redis_bridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,34 @@ sai_status_t redis_get_bridge_port_stats(
return SAI_STATUS_NOT_IMPLEMENTED;
}

sai_status_t redis_get_bridge_port_stats_ext(
_In_ sai_object_id_t bridge_port_id,
_In_ uint32_t number_of_counters,
_In_ const sai_bridge_port_stat_t *counter_ids,
_In_ sai_stats_mode_t mode,
_Out_ uint64_t *counters)
{
MUTEX();

SWSS_LOG_ENTER();

return SAI_STATUS_NOT_IMPLEMENTED;
}

sai_status_t redis_get_bridge_stats_ext(
_In_ sai_object_id_t bridge_id,
_In_ uint32_t number_of_counters,
_In_ const sai_bridge_stat_t *counter_ids,
_In_ sai_stats_mode_t mode,
_Out_ uint64_t *counters)
{
MUTEX();

SWSS_LOG_ENTER();

return SAI_STATUS_NOT_IMPLEMENTED;
}

sai_status_t redis_clear_bridge_port_stats(
_In_ sai_object_id_t bridge_port_id,
_In_ uint32_t number_of_counters,
Expand All @@ -58,10 +86,12 @@ const sai_bridge_api_t redis_bridge_api =
REDIS_GENERIC_QUAD_API(bridge)

redis_get_bridge_stats,
redis_get_bridge_stats_ext,
redis_clear_bridge_stats,

REDIS_GENERIC_QUAD_API(bridge_port)

redis_get_bridge_port_stats,
redis_get_bridge_port_stats_ext,
redis_clear_bridge_port_stats,
};
30 changes: 30 additions & 0 deletions lib/src/sai_redis_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,20 @@ sai_status_t redis_clear_ingress_priority_group_stats(
return SAI_STATUS_NOT_IMPLEMENTED;
}

sai_status_t redis_get_ingress_priority_group_stats_ext(
_In_ sai_object_id_t ingress_priority_group_id,
_In_ uint32_t number_of_counters,
_In_ const sai_ingress_priority_group_stat_t *counter_ids,
_In_ sai_stats_mode_t mode,
_Out_ uint64_t *counters)
{
MUTEX();

SWSS_LOG_ENTER();

return SAI_STATUS_NOT_IMPLEMENTED;
}

sai_status_t redis_get_buffer_pool_stats(
_In_ sai_object_id_t pool_id,
_In_ uint32_t number_of_counters,
Expand All @@ -25,6 +39,20 @@ sai_status_t redis_get_buffer_pool_stats(
return SAI_STATUS_NOT_IMPLEMENTED;
}

sai_status_t redis_get_buffer_pool_stats_ext(
_In_ sai_object_id_t buffer_pool_id,
_In_ uint32_t number_of_counters,
_In_ const sai_buffer_pool_stat_t *counter_ids,
_In_ sai_stats_mode_t mode,
_Out_ uint64_t *counters)
{
MUTEX();

SWSS_LOG_ENTER();

return SAI_STATUS_NOT_IMPLEMENTED;
}

sai_status_t redis_clear_buffer_pool_stats(
_In_ sai_object_id_t pool_id,
_In_ uint32_t number_of_counters,
Expand All @@ -48,11 +76,13 @@ const sai_buffer_api_t redis_buffer_api = {
REDIS_GENERIC_QUAD_API(buffer_pool)

redis_get_buffer_pool_stats,
redis_get_buffer_pool_stats_ext,
redis_clear_buffer_pool_stats,

REDIS_GENERIC_QUAD_API(ingress_priority_group)

redis_get_ingress_priority_group_stats,
redis_get_ingress_priority_group_stats_ext,
redis_clear_ingress_priority_group_stats,

REDIS_GENERIC_QUAD_API(buffer_profile)
Expand Down
10 changes: 5 additions & 5 deletions lib/src/sai_redis_hostintf.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#include "sai_redis.h"

sai_status_t redis_recv_hostif_packet(
_In_ sai_object_id_t hif_id,
_Out_ void *buffer,
_In_ sai_object_id_t hostif_id,
_Inout_ sai_size_t *buffer_size,
_Out_ void *buffer,
_Inout_ uint32_t *attr_count,
_Out_ sai_attribute_t *attr_list)
{
Expand All @@ -15,11 +15,11 @@ sai_status_t redis_recv_hostif_packet(
}

sai_status_t redis_send_hostif_packet(
_In_ sai_object_id_t hif_id,
_In_ void *buffer,
_In_ sai_object_id_t hostif_id,
_In_ sai_size_t buffer_size,
_In_ const void *buffer,
_In_ uint32_t attr_count,
_In_ sai_attribute_t *attr_list)
_In_ const sai_attribute_t *attr_list)
{
MUTEX();

Expand Down
15 changes: 15 additions & 0 deletions lib/src/sai_redis_policer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,20 @@ sai_status_t redis_get_policer_stats(
return SAI_STATUS_NOT_IMPLEMENTED;
}

sai_status_t redis_sai_get_policer_stats_ext(
_In_ sai_object_id_t policer_id,
_In_ uint32_t number_of_counters,
_In_ const sai_policer_stat_t *counter_ids,
_In_ sai_stats_mode_t mode,
_Out_ uint64_t *counters)
{
MUTEX();

SWSS_LOG_ENTER();

return SAI_STATUS_NOT_IMPLEMENTED;
}

sai_status_t redis_clear_policer_stats(
_In_ sai_object_id_t policer_id,
_In_ uint32_t number_of_counters,
Expand All @@ -32,5 +46,6 @@ const sai_policer_api_t redis_policer_api = {
REDIS_GENERIC_QUAD_API(policer)

redis_get_policer_stats,
redis_sai_get_policer_stats_ext,
redis_clear_policer_stats,
};
30 changes: 30 additions & 0 deletions lib/src/sai_redis_port.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,20 @@ sai_status_t redis_clear_port_stats(
return SAI_STATUS_NOT_IMPLEMENTED;
}

sai_status_t redis_get_port_stats_ext(
_In_ sai_object_id_t port_id,
_In_ uint32_t number_of_counters,
_In_ const sai_port_stat_t *counter_ids,
_In_ sai_stats_mode_t mode,
_Out_ uint64_t *counters)
{
MUTEX();

SWSS_LOG_ENTER();

return SAI_STATUS_NOT_IMPLEMENTED;
}

sai_status_t redis_clear_port_all_stats(
_In_ sai_object_id_t port_id)
{
Expand All @@ -22,6 +36,20 @@ sai_status_t redis_clear_port_all_stats(
return SAI_STATUS_NOT_IMPLEMENTED;
}

sai_status_t redis_get_port_pool_stats_ext(
_In_ sai_object_id_t port_pool_id,
_In_ uint32_t number_of_counters,
_In_ const sai_port_pool_stat_t *counter_ids,
_In_ sai_stats_mode_t mode,
_Out_ uint64_t *counters)
{
MUTEX();

SWSS_LOG_ENTER();

return SAI_STATUS_NOT_IMPLEMENTED;
}

sai_status_t redis_clear_port_pool_stats(
_In_ sai_object_id_t port_pool_id,
_In_ uint32_t number_of_counters,
Expand All @@ -46,11 +74,13 @@ const sai_port_api_t redis_port_api = {
REDIS_GENERIC_QUAD_API(port)

redis_get_port_stats,
redis_get_port_stats_ext,
redis_clear_port_stats,
redis_clear_port_all_stats,

REDIS_GENERIC_QUAD_API(port_pool)

redis_get_port_pool_stats,
redis_get_port_pool_stats_ext,
redis_clear_port_pool_stats
};
15 changes: 15 additions & 0 deletions lib/src/sai_redis_queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,20 @@ sai_status_t redis_clear_queue_stats(
return SAI_STATUS_NOT_IMPLEMENTED;
}

sai_status_t redis_get_queue_stats_ext(
_In_ sai_object_id_t queue_id,
_In_ uint32_t number_of_counters,
_In_ const sai_queue_stat_t *counter_ids,
_In_ sai_stats_mode_t mode,
_Out_ uint64_t *counters)
{
MUTEX();

SWSS_LOG_ENTER();

return SAI_STATUS_NOT_IMPLEMENTED;
}

REDIS_GENERIC_QUAD(QUEUE,queue);

REDIS_GENERIC_GET_STATS(QUEUE, queue);
Expand All @@ -22,5 +36,6 @@ const sai_queue_api_t redis_queue_api = {
REDIS_GENERIC_QUAD_API(queue)

redis_get_queue_stats,
redis_get_queue_stats_ext,
redis_clear_queue_stats,
};
14 changes: 14 additions & 0 deletions lib/src/sai_redis_tunnel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,19 @@ sai_status_t redis_clear_tunnel_stats(
return SAI_STATUS_NOT_IMPLEMENTED;
}

sai_status_t redis_get_tunnel_stats_ext(
_In_ sai_object_id_t tunnel_id,
_In_ uint32_t number_of_counters,
_In_ const sai_tunnel_stat_t *counter_ids,
_In_ sai_stats_mode_t mode,
_Out_ uint64_t *counters)
{
MUTEX();

SWSS_LOG_ENTER();

return SAI_STATUS_NOT_IMPLEMENTED;
}

REDIS_GENERIC_QUAD(TUNNEL_MAP,tunnel_map);
REDIS_GENERIC_QUAD(TUNNEL,tunnel);
Expand All @@ -25,6 +38,7 @@ const sai_tunnel_api_t redis_tunnel_api = {
REDIS_GENERIC_QUAD_API(tunnel)

redis_get_tunnel_stats,
redis_get_tunnel_stats_ext,
redis_clear_tunnel_stats,

REDIS_GENERIC_QUAD_API(tunnel_term_table_entry)
Expand Down
15 changes: 15 additions & 0 deletions lib/src/sai_redis_vlan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,20 @@ sai_status_t redis_get_vlan_stats(
return SAI_STATUS_NOT_IMPLEMENTED;
}

sai_status_t redis_get_vlan_stats_ext(
_In_ sai_object_id_t vlan_id,
_In_ uint32_t number_of_counters,
_In_ const sai_vlan_stat_t *counter_ids,
_In_ sai_stats_mode_t mode,
_Out_ uint64_t *counters)
{
MUTEX();

SWSS_LOG_ENTER();

return SAI_STATUS_NOT_IMPLEMENTED;
}

sai_status_t redis_clear_vlan_stats(
_In_ sai_object_id_t vlan_id,
_In_ uint32_t number_of_counters,
Expand All @@ -65,5 +79,6 @@ const sai_vlan_api_t redis_vlan_api = {
redis_create_vlan_members,
redis_remove_vlan_members,
redis_get_vlan_stats,
redis_get_vlan_stats_ext,
redis_clear_vlan_stats,
};
Loading

0 comments on commit 8585fc8

Please sign in to comment.