From c8371a205d4dabb44c586df2b36a12b9de1a729c Mon Sep 17 00:00:00 2001 From: Dong Zhang <41927498+dzhangalibaba@users.noreply.github.com> Date: Thu, 1 Aug 2019 13:21:22 -0700 Subject: [PATCH] fix wrong API type , add cmdline parse option , remove unuseful api call (#499) fix wrong API type in internal_api_wait_for_response() add cmdline parse option "s" , otherwise syncd cannot be executed via -s option, system cannot be up with syncd --- lib/src/sai_redis_generic_remove.cpp | 2 +- lib/src/sai_redis_generic_set.cpp | 2 +- lib/src/sai_redis_interfacequery.cpp | 2 -- syncd/syncd.cpp | 4 ++-- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/src/sai_redis_generic_remove.cpp b/lib/src/sai_redis_generic_remove.cpp index d6afc1c69..707ab7a72 100644 --- a/lib/src/sai_redis_generic_remove.cpp +++ b/lib/src/sai_redis_generic_remove.cpp @@ -134,7 +134,7 @@ sai_status_t internal_redis_bulk_generic_remove( g_asicState->set(key, entries, "bulkremove"); } - return internal_api_wait_for_response(SAI_COMMON_API_CREATE); + return internal_api_wait_for_response(SAI_COMMON_API_REMOVE); } diff --git a/lib/src/sai_redis_generic_set.cpp b/lib/src/sai_redis_generic_set.cpp index e084d9440..9cd53e196 100644 --- a/lib/src/sai_redis_generic_set.cpp +++ b/lib/src/sai_redis_generic_set.cpp @@ -187,7 +187,7 @@ sai_status_t internal_redis_bulk_generic_set( g_asicState->set(key, entries, "bulkset"); } - return internal_api_wait_for_response(SAI_COMMON_API_CREATE); + return internal_api_wait_for_response(SAI_COMMON_API_SET); } diff --git a/lib/src/sai_redis_interfacequery.cpp b/lib/src/sai_redis_interfacequery.cpp index 8a9761f06..16fb96acc 100644 --- a/lib/src/sai_redis_interfacequery.cpp +++ b/lib/src/sai_redis_interfacequery.cpp @@ -124,8 +124,6 @@ sai_status_t sai_api_initialize( g_redisNotifications = std::make_shared(g_dbNtf.get(), "NOTIFICATIONS"); g_redisClient = std::make_shared(g_db.get()); - g_asicState->setBuffered(false); // in sync mode, always false - clear_local_state(); g_asicInitViewMode = false; diff --git a/syncd/syncd.cpp b/syncd/syncd.cpp index bcf36ae0d..00f949c0a 100644 --- a/syncd/syncd.cpp +++ b/syncd/syncd.cpp @@ -3302,9 +3302,9 @@ void handleCmdLine(int argc, char **argv) #ifdef SAITHRIFT options.run_rpc_server = false; - const char* const optstring = "dNUCt:p:i:rm:huS"; + const char* const optstring = "dNUCt:p:i:rm:huSs"; #else - const char* const optstring = "dNUCt:p:i:huS"; + const char* const optstring = "dNUCt:p:i:huSs"; #endif // SAITHRIFT while(true)