From 473c99067c8132f8e5b3f8f2abd672b474b42b5a Mon Sep 17 00:00:00 2001 From: bingwang-ms <66248323+bingwang-ms@users.noreply.github.com> Date: Thu, 31 Mar 2022 13:25:29 +0800 Subject: [PATCH] [submodule update] SAI submodule update (#1023) * SAI submodule update - d0f3333 Tunnel Scoped TC MAP and Remarking (#1413) (#1451) - 62364a3 Add two more API as RPC for warmboot testing (#1421) (#1437) - 426fad1 Make saithriftv compatible with thrift 0.14.1 (#1433) Signed-off-by: bingwang --- SAI | 2 +- lib/sai_redis.h | 12 ++++++++++++ lib/sai_redis_tunnel.cpp | 2 ++ unittest/lib/test_sai_redis_tunnel.cpp | 7 +++++++ unittest/vslib/test_sai_vs_tunnel.cpp | 7 +++++++ vslib/sai_vs.h | 11 +++++++++++ vslib/sai_vs_tunnel.cpp | 2 ++ 7 files changed, 42 insertions(+), 1 deletion(-) diff --git a/SAI b/SAI index 7594e53a2da9..d0f333363cf9 160000 --- a/SAI +++ b/SAI @@ -1 +1 @@ -Subproject commit 7594e53a2da9945d5ad0be44f7c7efbbe3c43346 +Subproject commit d0f333363cf9ac4ceb8e12a32c4f47c0d0929048 diff --git a/lib/sai_redis.h b/lib/sai_redis.h index 906fc65191a9..2f3de17d284f 100644 --- a/lib/sai_redis.h +++ b/lib/sai_redis.h @@ -415,3 +415,15 @@ PRIVATE extern std::shared_ptr redis_sai; redis_bulk_remove_ ## ot, \ redis_bulk_set_ ## ot, \ redis_bulk_get_ ## ot, + +// BULK get/set DECLARE + +#define REDIS_BULK_GET_SET(OT,ot) \ + REDIS_BULK_GET(OT,ot); \ + REDIS_BULK_SET(OT,ot); + +// BULK get/set API + +#define REDIS_BULK_GET_SET_API(ot) \ + redis_bulk_get_ ## ot, \ + redis_bulk_set_ ## ot, diff --git a/lib/sai_redis_tunnel.cpp b/lib/sai_redis_tunnel.cpp index 5c7ea6462cb8..eb9d4cb7ae16 100644 --- a/lib/sai_redis_tunnel.cpp +++ b/lib/sai_redis_tunnel.cpp @@ -5,6 +5,7 @@ REDIS_GENERIC_QUAD(TUNNEL,tunnel); REDIS_GENERIC_QUAD(TUNNEL_TERM_TABLE_ENTRY,tunnel_term_table_entry); REDIS_GENERIC_QUAD(TUNNEL_MAP_ENTRY,tunnel_map_entry); REDIS_GENERIC_STATS(TUNNEL,tunnel); +REDIS_BULK_GET_SET(TUNNEL,tunnels); const sai_tunnel_api_t redis_tunnel_api = { @@ -13,4 +14,5 @@ const sai_tunnel_api_t redis_tunnel_api = { REDIS_GENERIC_STATS_API(tunnel) REDIS_GENERIC_QUAD_API(tunnel_term_table_entry) REDIS_GENERIC_QUAD_API(tunnel_map_entry) + REDIS_BULK_GET_SET_API(tunnels) }; diff --git a/unittest/lib/test_sai_redis_tunnel.cpp b/unittest/lib/test_sai_redis_tunnel.cpp index 9b45194d875c..1eb42b0b8d0f 100644 --- a/unittest/lib/test_sai_redis_tunnel.cpp +++ b/unittest/lib/test_sai_redis_tunnel.cpp @@ -39,4 +39,11 @@ TEST(libsairedis, tunnel) EXPECT_NE(SAI_STATUS_SUCCESS, api->remove_tunnel_map_entry(0)); EXPECT_NE(SAI_STATUS_SUCCESS, api->set_tunnel_map_entry_attribute(0,0)); EXPECT_NE(SAI_STATUS_SUCCESS, api->get_tunnel_map_entry_attribute(0,0,0)); + + uint32_t attr_count = 0; + sai_status_t status = 0; + sai_attribute_t *p_attr = nullptr; + EXPECT_NE(SAI_STATUS_SUCCESS, api->get_tunnels_attribute(0,&id,&attr_count,&p_attr,SAI_BULK_OP_ERROR_MODE_IGNORE_ERROR,&status)); + EXPECT_NE(SAI_STATUS_SUCCESS, api->set_tunnels_attribute(0,&id,0,SAI_BULK_OP_ERROR_MODE_IGNORE_ERROR,&status)); } + diff --git a/unittest/vslib/test_sai_vs_tunnel.cpp b/unittest/vslib/test_sai_vs_tunnel.cpp index a16dc496bbef..5e9136fc80bd 100644 --- a/unittest/vslib/test_sai_vs_tunnel.cpp +++ b/unittest/vslib/test_sai_vs_tunnel.cpp @@ -39,4 +39,11 @@ TEST(libsaivs, tunnel) EXPECT_NE(SAI_STATUS_SUCCESS, api->remove_tunnel_map_entry(0)); EXPECT_NE(SAI_STATUS_SUCCESS, api->set_tunnel_map_entry_attribute(0,0)); EXPECT_NE(SAI_STATUS_SUCCESS, api->get_tunnel_map_entry_attribute(0,0,0)); + + uint32_t attr_count = 0; + sai_status_t status = 0; + sai_attribute_t *p_attr = nullptr; + EXPECT_NE(SAI_STATUS_SUCCESS, api->get_tunnels_attribute(0,&id,&attr_count,&p_attr,SAI_BULK_OP_ERROR_MODE_IGNORE_ERROR,&status)); + EXPECT_NE(SAI_STATUS_SUCCESS, api->set_tunnels_attribute(0,&id,0,SAI_BULK_OP_ERROR_MODE_IGNORE_ERROR,&status)); } + diff --git a/vslib/sai_vs.h b/vslib/sai_vs.h index 46063a9149f7..d5ed4d89b006 100644 --- a/vslib/sai_vs.h +++ b/vslib/sai_vs.h @@ -416,3 +416,14 @@ PRIVATE extern std::shared_ptr vs_sai; vs_bulk_set_ ## ot, \ vs_bulk_get_ ## ot, +// BULK get/set DECLARE for vs + +#define VS_BULK_GET_SET(OT,ot) \ + VS_BULK_GET(OT,ot); \ + VS_BULK_SET(OT,ot); + +// BULK get/set API for vs + +#define VS_BULK_GET_SET_API(ot) \ + vs_bulk_get_ ## ot, \ + vs_bulk_set_ ## ot, diff --git a/vslib/sai_vs_tunnel.cpp b/vslib/sai_vs_tunnel.cpp index 248370500037..1214169cb20a 100644 --- a/vslib/sai_vs_tunnel.cpp +++ b/vslib/sai_vs_tunnel.cpp @@ -5,6 +5,7 @@ VS_GENERIC_QUAD(TUNNEL,tunnel); VS_GENERIC_QUAD(TUNNEL_TERM_TABLE_ENTRY,tunnel_term_table_entry); VS_GENERIC_QUAD(TUNNEL_MAP_ENTRY,tunnel_map_entry); VS_GENERIC_STATS(TUNNEL,tunnel); +VS_BULK_GET_SET(TUNNEL,tunnels); const sai_tunnel_api_t vs_tunnel_api = { @@ -13,4 +14,5 @@ const sai_tunnel_api_t vs_tunnel_api = { VS_GENERIC_STATS_API(tunnel) VS_GENERIC_QUAD_API(tunnel_term_table_entry) VS_GENERIC_QUAD_API(tunnel_map_entry) + VS_BULK_GET_SET_API(tunnels) };