Skip to content

Commit

Permalink
Cleanup code (#1814)
Browse files Browse the repository at this point in the history
  • Loading branch information
kcudnik authored Jul 5, 2021
1 parent d594c47 commit 5528ebf
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 14 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ stamp-h1
**/Makefile
autom4te.cache

# Temp files #
##############
*~
*.swp

# Dependency Folder #
#####################
deps/
Expand All @@ -52,6 +57,8 @@ cfgmgr/vxlanmgrd
cfgmgr/natmgrd
cfgmgr/sflowmgrd
cfgmgr/macsecmgrd
cfgmgr/coppmgrd
cfgmgr/tunnelmgrd
fpmsyncd/fpmsyncd
gearsyncd/gearsyncd
mclagsyncd/mclagsyncd
Expand All @@ -68,6 +75,7 @@ tlm_teamd/tlm_teamd
teamsyncd/teamsyncd
tests/tests


# Test Files #
##############
tests/log
Expand Down
7 changes: 3 additions & 4 deletions orchagent/countercheckorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ PfcFrameCounters CounterCheckOrch::getPfcFrameCounters(sai_object_id_t portId)

if (!m_countersTable->get(sai_serialize_object_id(portId), fieldValues))
{
return move(counters);
return counters;
}

for (const auto& fv : fieldValues)
Expand All @@ -182,7 +182,7 @@ PfcFrameCounters CounterCheckOrch::getPfcFrameCounters(sai_object_id_t portId)
}
}

return move(counters);
return counters;
}

QueueMcCounters CounterCheckOrch::getQueueMcCounters(
Expand Down Expand Up @@ -218,10 +218,9 @@ QueueMcCounters CounterCheckOrch::getQueueMcCounters(
counters.push_back(pkts);
}

return move(counters);
return counters;
}


void CounterCheckOrch::addPort(const Port& port)
{
m_mcCountersMap.emplace(port.m_port_id, getQueueMcCounters(port));
Expand Down
6 changes: 3 additions & 3 deletions orchagent/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ void usage()
cout << " -b batch_size: set consumer table pop operation batch size (default 128)" << endl;
cout << " -m MAC: set switch MAC address" << endl;
cout << " -i INST_ID: set the ASIC instance_id in multi-asic platform" << endl;
cout << " -s: enable synchronous mode (deprecated, use -z)" << endl;
cout << " -z: redis communication mode (redis_async|redis_sync|zmq_sync), default: redis_async" << endl;
cout << " -s enable synchronous mode (deprecated, use -z)" << endl;
cout << " -z redis communication mode (redis_async|redis_sync|zmq_sync), default: redis_async" << endl;
cout << " -f swss_rec_filename: swss record log filename(default 'swss.rec')" << endl;
cout << " -j sairedis_rec_filename: sairedis record log filename(default sairedis.rec)" << endl;
cout << " -k max bulk size in bulk mode (default 1000)";
cout << " -k max bulk size in bulk mode (default 1000)" << endl;
}

void sighup_handler(int signo)
Expand Down
4 changes: 2 additions & 2 deletions orchagent/mirrororch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,7 @@ bool MirrorOrch::setUnsetPortMirror(Port port,
status = sai_port_api->set_port_attribute(p.m_port_id, &port_attr);
if (status != SAI_STATUS_SUCCESS)
{
SWSS_LOG_ERROR("Failed to configure %s session on port %s: %s, status %d, sessionId %x",
SWSS_LOG_ERROR("Failed to configure %s session on port %s: %s, status %d, sessionId %lx",
ingress ? "RX" : "TX", port.m_alias.c_str(),
p.m_alias.c_str(), status, sessionId);
task_process_status handle_status = handleSaiSetStatus(SAI_API_PORT, status);
Expand All @@ -775,7 +775,7 @@ bool MirrorOrch::setUnsetPortMirror(Port port,
status = sai_port_api->set_port_attribute(port.m_port_id, &port_attr);
if (status != SAI_STATUS_SUCCESS)
{
SWSS_LOG_ERROR("Failed to configure %s session on port %s, status %d, sessionId %x",
SWSS_LOG_ERROR("Failed to configure %s session on port %s, status %d, sessionId %lx",
ingress ? "RX" : "TX", port.m_alias.c_str(), status, sessionId);
task_process_status handle_status = handleSaiSetStatus(SAI_API_PORT, status);
if (handle_status != task_success)
Expand Down
3 changes: 0 additions & 3 deletions orchagent/natorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2667,7 +2667,6 @@ void NatOrch::doNatTableTask(Consumer& consumer)
string key = kfvKey(t);
string op = kfvOp(t);
vector<string> keys = tokenize(key, ':');
IpAddress global_address;
/* Example : APPL_DB
* NAT_TABLE:65.55.45.1
* translated_ip: 10.0.0.1
Expand Down Expand Up @@ -2808,7 +2807,6 @@ void NatOrch::doTwiceNatTableTask(Consumer& consumer)
string key = kfvKey(t);
string op = kfvOp(t);
vector<string> keys = tokenize(key, ':');
IpAddress global_address;
/* Example : APPL_DB
* NAT_TWICE_TABLE:91.91.91.91:65.55.45.1
* translated_src_ip: 14.14.14.14
Expand Down Expand Up @@ -3020,7 +3018,6 @@ void NatOrch::doDnatPoolTableTask(Consumer& consumer)
string key = kfvKey(t);
string op = kfvOp(t);
vector<string> keys = tokenize(key, ':');
IpAddress global_address;
/* Example : APPL_DB
* NAT_DNAT_POOL_TABLE:65.55.45.1
* NULL: NULL
Expand Down
4 changes: 2 additions & 2 deletions orchagent/pfcactionhandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ PfcWdActionHandler::PfcWdQueueStats PfcWdActionHandler::getQueueStats(shared_ptr

if (!countersTable->get(queueIdStr, fieldValues))
{
return move(stats);
return stats;
}

for (const auto& fv : fieldValues)
Expand Down Expand Up @@ -175,7 +175,7 @@ PfcWdActionHandler::PfcWdQueueStats PfcWdActionHandler::getQueueStats(shared_ptr
}
}

return move(stats);
return stats;
}

void PfcWdActionHandler::initWdCounters(shared_ptr<Table> countersTable, const string &queueIdStr)
Expand Down

0 comments on commit 5528ebf

Please sign in to comment.