Skip to content

Commit

Permalink
[p4orch] Clang format change. (sonic-net#3096)
Browse files Browse the repository at this point in the history
What I did
[p4orch]  This PR has no real code change. It is purely clang formatting. 
It does the same as sonic-net#3080.
  • Loading branch information
mint570 authored Apr 9, 2024
1 parent f6dd9ca commit 56ba6de
Show file tree
Hide file tree
Showing 25 changed files with 70 additions and 50 deletions.
2 changes: 1 addition & 1 deletion orchagent/p4orch/acl_rule_manager.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "p4orch/acl_rule_manager.h"

#include <nlohmann/json.hpp>
#include <sstream>
#include <string>
#include <vector>
Expand All @@ -17,7 +18,6 @@
#include "sai_serialize.h"
#include "table.h"
#include "tokenize.h"
#include <nlohmann/json.hpp>
extern "C"
{
#include "sai.h"
Expand Down
2 changes: 1 addition & 1 deletion orchagent/p4orch/acl_table_manager.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "p4orch/acl_table_manager.h"

#include <nlohmann/json.hpp>
#include <sstream>
#include <string>
#include <vector>
Expand All @@ -15,7 +16,6 @@
#include "switchorch.h"
#include "table.h"
#include "tokenize.h"
#include <nlohmann/json.hpp>
extern "C"
{
#include "sai.h"
Expand Down
3 changes: 2 additions & 1 deletion orchagent/p4orch/acl_util.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#include "p4orch/acl_util.h"

#include <nlohmann/json.hpp>

#include "converter.h"
#include "logger.h"
#include "sai_serialize.h"
#include "table.h"
#include "tokenize.h"
#include <nlohmann/json.hpp>

namespace p4orch
{
Expand Down
6 changes: 3 additions & 3 deletions orchagent/p4orch/acl_util.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#pragma once

#include <map>
#include <nlohmann/json.hpp>
#include <set>
#include <string>
#include <vector>

#include "p4orch/p4orch_util.h"
#include "return_code.h"
#include <nlohmann/json.hpp>
extern "C"
{
#include "sai.h"
Expand Down Expand Up @@ -243,15 +243,15 @@ struct P4AclTableDefinition
P4AclTableDefinition(const std::string &acl_table_name, const sai_acl_stage_t stage, const uint32_t priority,
const uint32_t size, const std::string &meter_unit, const std::string &counter_unit)
: acl_table_name(acl_table_name), stage(stage), priority(priority), size(size), meter_unit(meter_unit),
counter_unit(counter_unit){};
counter_unit(counter_unit) {};
};

struct P4UserDefinedTrapHostifTableEntry
{
sai_object_id_t user_defined_trap;
sai_object_id_t hostif_table_entry;
P4UserDefinedTrapHostifTableEntry()
: user_defined_trap(SAI_NULL_OBJECT_ID), hostif_table_entry(SAI_NULL_OBJECT_ID){};
: user_defined_trap(SAI_NULL_OBJECT_ID), hostif_table_entry(SAI_NULL_OBJECT_ID) {};
};

using acl_rule_attr_lookup_t = std::map<std::string, acl_entry_attr_union_t>;
Expand Down
26 changes: 17 additions & 9 deletions orchagent/p4orch/ext_tables_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include <boost/algorithm/string.hpp>
#include <memory>
#include <nlohmann/json.hpp>
#include <sstream>
#include <string>
#include <utility>
Expand All @@ -14,7 +15,6 @@
#include "p4orch/p4orch.h"
#include "p4orch/p4orch_util.h"
#include "tokenize.h"
#include <nlohmann/json.hpp>

extern sai_counter_api_t *sai_counter_api;
extern sai_generic_programmable_api_t *sai_generic_programmable_api;
Expand Down Expand Up @@ -111,15 +111,18 @@ ReturnCode ExtTablesManager::validateActionParamsCrossRef(P4ExtTableAppDbEntry &
SWSS_LOG_ERROR("Cross-table reference validation failed from extension-table %s",
table_name.c_str());
return ReturnCode(StatusCode::SWSS_RC_INVALID_PARAM)
<< "Cross-table reference valdiation failed from extension table";
<< "Cross-table reference valdiation failed from extension "
"table";
}
}
else
{
SWSS_LOG_ERROR("Cross-table reference validation failed due to non-existent table %s",
SWSS_LOG_ERROR("Cross-table reference validation failed due to non-existent table "
"%s",
table_name.c_str());
return ReturnCode(StatusCode::SWSS_RC_INVALID_PARAM)
<< "Cross-table reference valdiation failed due to non-existent table";
<< "Cross-table reference valdiation failed due to non-existent "
"table";
}
}

Expand All @@ -132,7 +135,8 @@ ReturnCode ExtTablesManager::validateActionParamsCrossRef(P4ExtTableAppDbEntry &

if (oid == SAI_NULL_OBJECT_ID)
{
SWSS_LOG_ERROR("Cross-table reference validation failed, null OID expected from table %s",
SWSS_LOG_ERROR("Cross-table reference validation failed, null OID expected from "
"table %s",
table_name.c_str());
return ReturnCode(StatusCode::SWSS_RC_INVALID_PARAM) << "Cross-table reference valdiation failed, null OID";
}
Expand Down Expand Up @@ -724,7 +728,8 @@ void ExtTablesManager::drain()
SWSS_LOG_ERROR("Unable to deserialize APP DB entry with key %s: %s",
QuotedVar(kfvKey(key_op_fvs_tuple)).c_str(), status.message().c_str());
m_publisher->publish(APP_P4RT_TABLE_NAME, kfvKey(key_op_fvs_tuple),
kfvFieldsValues(key_op_fvs_tuple), status, /*replace=*/true);
kfvFieldsValues(key_op_fvs_tuple), status,
/*replace=*/true);
continue;
}

Expand All @@ -735,7 +740,8 @@ void ExtTablesManager::drain()
SWSS_LOG_ERROR("Validation failed for extension APP DB entry with key %s: %s",
QuotedVar(kfvKey(key_op_fvs_tuple)).c_str(), status.message().c_str());
m_publisher->publish(APP_P4RT_TABLE_NAME, kfvKey(key_op_fvs_tuple),
kfvFieldsValues(key_op_fvs_tuple), status, /*replace=*/true);
kfvFieldsValues(key_op_fvs_tuple), status,
/*replace=*/true);
continue;
}

Expand Down Expand Up @@ -772,7 +778,8 @@ void ExtTablesManager::drain()
QuotedVar(kfvKey(key_op_fvs_tuple)).c_str(), status.message().c_str());
}
m_publisher->publish(APP_P4RT_TABLE_NAME, kfvKey(key_op_fvs_tuple), kfvFieldsValues(key_op_fvs_tuple),
status, /*replace=*/true);
status,
/*replace=*/true);
}

it_m->second.clear();
Expand Down Expand Up @@ -833,7 +840,8 @@ void ExtTablesManager::doExtCounterStatsTask()
sai_counter_api->get_counter_stats(ext_table_entry->sai_counter_oid, 2, stat_ids, stats);
if (sai_status != SAI_STATUS_SUCCESS)
{
SWSS_LOG_WARN("Failed to set counters stats for extension entry %s:%s in COUNTERS_DB: ",
SWSS_LOG_WARN("Failed to set counters stats for extension entry %s:%s in "
"COUNTERS_DB: ",
table_name.c_str(), ext_table_entry->table_key.c_str());
continue;
}
Expand Down
4 changes: 2 additions & 2 deletions orchagent/p4orch/ext_tables_manager.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#include <memory>
#include <nlohmann/json.hpp>
#include <string>
#include <unordered_map>
#include <vector>
Expand All @@ -14,7 +15,6 @@
#include "response_publisher_interface.h"
#include "return_code.h"
#include "vrforch.h"
#include <nlohmann/json.hpp>
extern "C"
{
#include "sai.h"
Expand All @@ -29,7 +29,7 @@ struct P4ExtTableEntry
sai_object_id_t sai_counter_oid = SAI_NULL_OBJECT_ID;
std::unordered_map<std::string, DepObject> action_dep_objects;

P4ExtTableEntry(){};
P4ExtTableEntry() {};
P4ExtTableEntry(const std::string &db_key, const std::string &table_name, const std::string &table_key)
: db_key(db_key), table_name(table_name), table_key(table_key)
{
Expand Down
2 changes: 1 addition & 1 deletion orchagent/p4orch/gre_tunnel_manager.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "p4orch/gre_tunnel_manager.h"

#include <map>
#include <nlohmann/json.hpp>
#include <sstream>
#include <string>
#include <vector>
Expand All @@ -14,7 +15,6 @@
#include "sai_serialize.h"
#include "swssnet.h"
#include "table.h"
#include <nlohmann/json.hpp>
extern "C"
{
#include "sai.h"
Expand Down
2 changes: 1 addition & 1 deletion orchagent/p4orch/l3_admit_manager.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "p4orch/l3_admit_manager.h"

#include <map>
#include <nlohmann/json.hpp>
#include <sstream>
#include <string>
#include <vector>
Expand All @@ -14,7 +15,6 @@
#include "sai_serialize.h"
#include "table.h"
#include "tokenize.h"
#include <nlohmann/json.hpp>
extern "C"
{
#include "sai.h"
Expand Down
2 changes: 1 addition & 1 deletion orchagent/p4orch/mirror_session_manager.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "p4orch/mirror_session_manager.h"

#include <map>
#include <nlohmann/json.hpp>

#include "SaiAttributeList.h"
#include "dbconnector.h"
Expand All @@ -10,7 +11,6 @@
#include "swss/logger.h"
#include "swssnet.h"
#include "table.h"
#include <nlohmann/json.hpp>

using ::p4orch::kTableKeyDelimiter;

Expand Down
2 changes: 1 addition & 1 deletion orchagent/p4orch/neighbor_manager.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "p4orch/neighbor_manager.h"

#include <nlohmann/json.hpp>
#include <sstream>
#include <string>
#include <vector>
Expand All @@ -13,7 +14,6 @@
#include "sai_serialize.h"
#include "swssnet.h"
#include "table.h"
#include <nlohmann/json.hpp>
extern "C"
{
#include "sai.h"
Expand Down
2 changes: 1 addition & 1 deletion orchagent/p4orch/next_hop_manager.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "p4orch/next_hop_manager.h"

#include <nlohmann/json.hpp>
#include <sstream>
#include <string>
#include <vector>
Expand All @@ -14,7 +15,6 @@
#include "sai_serialize.h"
#include "swssnet.h"
#include "table.h"
#include <nlohmann/json.hpp>
extern "C"
{
#include "sai.h"
Expand Down
2 changes: 1 addition & 1 deletion orchagent/p4orch/p4orch_util.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "p4orch/p4orch_util.h"
#include "p4orch/p4orch.h"

#include "p4orch/p4orch.h"
#include "schema.h"

using ::p4orch::kTableKeyDelimiter;
Expand Down
2 changes: 1 addition & 1 deletion orchagent/p4orch/route_manager.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "p4orch/route_manager.h"

#include <memory>
#include <nlohmann/json.hpp>
#include <sstream>
#include <string>
#include <unordered_set>
Expand All @@ -16,7 +17,6 @@
#include "sai_serialize.h"
#include "swssnet.h"
#include "table.h"
#include <nlohmann/json.hpp>

using ::p4orch::kTableKeyDelimiter;

Expand Down
2 changes: 1 addition & 1 deletion orchagent/p4orch/router_interface_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include <map>
#include <memory>
#include <nlohmann/json.hpp>
#include <sstream>
#include <string>
#include <utility>
Expand All @@ -17,7 +18,6 @@
#include "sai_serialize.h"
#include "table.h"
#include "vrforch.h"
#include <nlohmann/json.hpp>

using ::p4orch::kTableKeyDelimiter;

Expand Down
Loading

0 comments on commit 56ba6de

Please sign in to comment.