diff --git a/SAI b/SAI index 7594e53a2..d0f333363 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 906fc6519..2f3de17d2 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 5c7ea6462..eb9d4cb7a 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 9b45194d8..1eb42b0b8 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 a16dc496b..5e9136fc8 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 46063a914..d5ed4d89b 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 248370500..1214169cb 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) };