Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[syncd] Remove deprecated sync option #1319

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions syncd/CommandLineOptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ CommandLineOptions::CommandLineOptions()
m_disableExitSleep = false;
m_enableUnittests = false;
m_enableConsistencyCheck = false;
m_enableSyncMode = false;
m_enableSaiBulkSupport = false;

m_redisCommunicationMode = SAI_REDIS_COMMUNICATION_MODE_REDIS_ASYNC;
Expand Down Expand Up @@ -57,7 +56,6 @@ std::string CommandLineOptions::getCommandLineString() const
ss << " DisableExitSleep=" << (m_disableExitSleep ? "YES" : "NO");
ss << " EnableUnittests=" << (m_enableUnittests ? "YES" : "NO");
ss << " EnableConsistencyCheck=" << (m_enableConsistencyCheck ? "YES" : "NO");
ss << " EnableSyncMode=" << (m_enableSyncMode ? "YES" : "NO");
ss << " RedisCommunicationMode=" << sai_serialize_redis_communication_mode(m_redisCommunicationMode);
ss << " EnableSaiBulkSuport=" << (m_enableSaiBulkSupport ? "YES" : "NO");
ss << " StartType=" << startTypeToString(m_startType);
Expand Down
2 changes: 0 additions & 2 deletions syncd/CommandLineOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ namespace syncd
*/
bool m_enableConsistencyCheck;

bool m_enableSyncMode;

bool m_enableSaiBulkSupport;

sai_redis_communication_mode_t m_redisCommunicationMode;
Expand Down
12 changes: 2 additions & 10 deletions syncd/CommandLineOptionsParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ std::shared_ptr<CommandLineOptions> CommandLineOptionsParser::parseCommandLine(
auto options = std::make_shared<CommandLineOptions>();

#ifdef SAITHRIFT
const char* const optstring = "dp:t:g:x:b:w:uSUCsz:lrm:h";
const char* const optstring = "dp:t:g:x:b:w:uSUCz:lrm:h";
#else
const char* const optstring = "dp:t:g:x:b:w:uSUCsz:lh";
const char* const optstring = "dp:t:g:x:b:w:uSUCz:lh";
#endif // SAITHRIFT

while (true)
Expand All @@ -35,7 +35,6 @@ std::shared_ptr<CommandLineOptions> CommandLineOptionsParser::parseCommandLine(
{ "disableExitSleep", no_argument, 0, 'S' },
{ "enableUnittests", no_argument, 0, 'U' },
{ "enableConsistencyCheck", no_argument, 0, 'C' },
{ "syncMode", no_argument, 0, 's' },
{ "redisCommunicationMode", required_argument, 0, 'z' },
{ "enableSaiBulkSupport", no_argument, 0, 'l' },
{ "globalContext", required_argument, 0, 'g' },
Expand Down Expand Up @@ -95,11 +94,6 @@ std::shared_ptr<CommandLineOptions> CommandLineOptionsParser::parseCommandLine(
options->m_enableConsistencyCheck = true;
break;

case 's':
SWSS_LOG_WARN("param -s is depreacated, use -z");
options->m_enableSyncMode = true;
break;

case 'z':
sai_deserialize_redis_communication_mode(optarg, options->m_redisCommunicationMode);
break;
Expand Down Expand Up @@ -175,8 +169,6 @@ void CommandLineOptionsParser::printUsage()
std::cout << " Metadata enable unittests" << std::endl;
std::cout << " -C --enableConsistencyCheck" << std::endl;
std::cout << " Enable consisteny check DB vs ASIC after comparison logic" << std::endl;
std::cout << " -s --syncMode" << std::endl;
std::cout << " Enable synchronous mode (depreacated, use -z)" << std::endl;
std::cout << " -z --redisCommunicationMode" << std::endl;
std::cout << " Redis communication mode (redis_async|redis_sync|zmq_sync), default: redis_async" << std::endl;
std::cout << " -l --enableBulk" << std::endl;
Expand Down
20 changes: 0 additions & 20 deletions syncd/Syncd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,26 +80,6 @@ Syncd::Syncd(
SWSS_LOG_THROW("no context config defined at global context %u", m_commandLineOptions->m_globalContext);
}

if (m_contextConfig->m_zmqEnable && m_commandLineOptions->m_enableSyncMode)
{
SWSS_LOG_NOTICE("disabling command line sync mode, since context zmq enabled");

m_commandLineOptions->m_enableSyncMode = false;

m_commandLineOptions->m_redisCommunicationMode = SAI_REDIS_COMMUNICATION_MODE_ZMQ_SYNC;
}

if (m_commandLineOptions->m_enableSyncMode)
{
SWSS_LOG_WARN("enable sync mode is deprecated, please use communication mode, FORCING redis sync mode");

m_enableSyncMode = true;

m_contextConfig->m_zmqEnable = false;

m_commandLineOptions->m_redisCommunicationMode = SAI_REDIS_COMMUNICATION_MODE_REDIS_SYNC;
}

if (m_commandLineOptions->m_redisCommunicationMode == SAI_REDIS_COMMUNICATION_MODE_ZMQ_SYNC)
{
SWSS_LOG_NOTICE("zmq sync mode enabled via cmd line");
Expand Down
1 change: 0 additions & 1 deletion syncd/tests/TestSyncdBrcm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ void syncdBrcmWorkerThread()
auto commandLineOptions = std::make_shared<CommandLineOptions>();
auto isWarmStart = false;

commandLineOptions->m_enableSyncMode= true;
commandLineOptions->m_enableTempView = true;
commandLineOptions->m_disableExitSleep = true;
commandLineOptions->m_enableUnittests = false;
Expand Down
1 change: 0 additions & 1 deletion syncd/tests/TestSyncdMlnx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ void syncdMlnxWorkerThread()
auto commandLineOptions = std::make_shared<CommandLineOptions>();
auto isWarmStart = false;

commandLineOptions->m_enableSyncMode= true;
commandLineOptions->m_enableTempView = false;
commandLineOptions->m_disableExitSleep = true;
commandLineOptions->m_enableUnittests = false;
Expand Down
1 change: 0 additions & 1 deletion syncd/tests/TestSyncdNvdaBf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ void syncdNvdaBfWorkerThread()
auto commandLineOptions = std::make_shared<CommandLineOptions>();
auto isWarmStart = false;

commandLineOptions->m_enableSyncMode= true;
commandLineOptions->m_enableTempView = false;
commandLineOptions->m_disableExitSleep = true;
commandLineOptions->m_enableUnittests = false;
Expand Down
Loading