From daea04dfd576eaba7accce45e45f9e71b9fa916f Mon Sep 17 00:00:00 2001 From: Kamil Cudnik Date: Mon, 5 Jul 2021 17:48:08 +0200 Subject: [PATCH] Cleanup code (#1814) --- .gitignore | 8 ++++++++ orchagent/countercheckorch.cpp | 7 +++---- orchagent/main.cpp | 6 +++--- orchagent/mirrororch.cpp | 4 ++-- orchagent/natorch.cpp | 3 --- orchagent/pfcactionhandler.cpp | 4 ++-- 6 files changed, 18 insertions(+), 14 deletions(-) diff --git a/.gitignore b/.gitignore index 439a0999f30..bfba2723056 100644 --- a/.gitignore +++ b/.gitignore @@ -32,6 +32,11 @@ stamp-h1 **/Makefile autom4te.cache +# Temp files # +############## +*~ +*.swp + # Dependency Folder # ##################### deps/ @@ -52,6 +57,8 @@ cfgmgr/vxlanmgrd cfgmgr/natmgrd cfgmgr/sflowmgrd cfgmgr/macsecmgrd +cfgmgr/coppmgrd +cfgmgr/tunnelmgrd fpmsyncd/fpmsyncd gearsyncd/gearsyncd mclagsyncd/mclagsyncd @@ -68,6 +75,7 @@ tlm_teamd/tlm_teamd teamsyncd/teamsyncd tests/tests + # Test Files # ############## tests/log diff --git a/orchagent/countercheckorch.cpp b/orchagent/countercheckorch.cpp index 54d6c1a51ce..1c4735888fe 100644 --- a/orchagent/countercheckorch.cpp +++ b/orchagent/countercheckorch.cpp @@ -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) @@ -182,7 +182,7 @@ PfcFrameCounters CounterCheckOrch::getPfcFrameCounters(sai_object_id_t portId) } } - return move(counters); + return counters; } QueueMcCounters CounterCheckOrch::getQueueMcCounters( @@ -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)); diff --git a/orchagent/main.cpp b/orchagent/main.cpp index 018af5999b1..10dd8cb788b 100644 --- a/orchagent/main.cpp +++ b/orchagent/main.cpp @@ -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) diff --git a/orchagent/mirrororch.cpp b/orchagent/mirrororch.cpp index c2c78c7601e..37c2ef73df4 100644 --- a/orchagent/mirrororch.cpp +++ b/orchagent/mirrororch.cpp @@ -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); @@ -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) diff --git a/orchagent/natorch.cpp b/orchagent/natorch.cpp index 283110efd11..d7f124a28e6 100644 --- a/orchagent/natorch.cpp +++ b/orchagent/natorch.cpp @@ -2667,7 +2667,6 @@ void NatOrch::doNatTableTask(Consumer& consumer) string key = kfvKey(t); string op = kfvOp(t); vector keys = tokenize(key, ':'); - IpAddress global_address; /* Example : APPL_DB * NAT_TABLE:65.55.45.1 * translated_ip: 10.0.0.1 @@ -2808,7 +2807,6 @@ void NatOrch::doTwiceNatTableTask(Consumer& consumer) string key = kfvKey(t); string op = kfvOp(t); vector 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 @@ -3020,7 +3018,6 @@ void NatOrch::doDnatPoolTableTask(Consumer& consumer) string key = kfvKey(t); string op = kfvOp(t); vector keys = tokenize(key, ':'); - IpAddress global_address; /* Example : APPL_DB * NAT_DNAT_POOL_TABLE:65.55.45.1 * NULL: NULL diff --git a/orchagent/pfcactionhandler.cpp b/orchagent/pfcactionhandler.cpp index 34c513e5d60..cf43f57d08e 100644 --- a/orchagent/pfcactionhandler.cpp +++ b/orchagent/pfcactionhandler.cpp @@ -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) @@ -175,7 +175,7 @@ PfcWdActionHandler::PfcWdQueueStats PfcWdActionHandler::getQueueStats(shared_ptr } } - return move(stats); + return stats; } void PfcWdActionHandler::initWdCounters(shared_ptr countersTable, const string &queueIdStr)