Skip to content

Commit 56ba6de

Browse files
authored
[p4orch] Clang format change. (#3096)
What I did [p4orch] This PR has no real code change. It is purely clang formatting. It does the same as #3080.
1 parent f6dd9ca commit 56ba6de

25 files changed

+70
-50
lines changed

orchagent/p4orch/acl_rule_manager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "p4orch/acl_rule_manager.h"
22

3+
#include <nlohmann/json.hpp>
34
#include <sstream>
45
#include <string>
56
#include <vector>
@@ -17,7 +18,6 @@
1718
#include "sai_serialize.h"
1819
#include "table.h"
1920
#include "tokenize.h"
20-
#include <nlohmann/json.hpp>
2121
extern "C"
2222
{
2323
#include "sai.h"

orchagent/p4orch/acl_table_manager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "p4orch/acl_table_manager.h"
22

3+
#include <nlohmann/json.hpp>
34
#include <sstream>
45
#include <string>
56
#include <vector>
@@ -15,7 +16,6 @@
1516
#include "switchorch.h"
1617
#include "table.h"
1718
#include "tokenize.h"
18-
#include <nlohmann/json.hpp>
1919
extern "C"
2020
{
2121
#include "sai.h"

orchagent/p4orch/acl_util.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
#include "p4orch/acl_util.h"
22

3+
#include <nlohmann/json.hpp>
4+
35
#include "converter.h"
46
#include "logger.h"
57
#include "sai_serialize.h"
68
#include "table.h"
79
#include "tokenize.h"
8-
#include <nlohmann/json.hpp>
910

1011
namespace p4orch
1112
{

orchagent/p4orch/acl_util.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#pragma once
22

33
#include <map>
4+
#include <nlohmann/json.hpp>
45
#include <set>
56
#include <string>
67
#include <vector>
78

89
#include "p4orch/p4orch_util.h"
910
#include "return_code.h"
10-
#include <nlohmann/json.hpp>
1111
extern "C"
1212
{
1313
#include "sai.h"
@@ -243,15 +243,15 @@ struct P4AclTableDefinition
243243
P4AclTableDefinition(const std::string &acl_table_name, const sai_acl_stage_t stage, const uint32_t priority,
244244
const uint32_t size, const std::string &meter_unit, const std::string &counter_unit)
245245
: acl_table_name(acl_table_name), stage(stage), priority(priority), size(size), meter_unit(meter_unit),
246-
counter_unit(counter_unit){};
246+
counter_unit(counter_unit) {};
247247
};
248248

249249
struct P4UserDefinedTrapHostifTableEntry
250250
{
251251
sai_object_id_t user_defined_trap;
252252
sai_object_id_t hostif_table_entry;
253253
P4UserDefinedTrapHostifTableEntry()
254-
: user_defined_trap(SAI_NULL_OBJECT_ID), hostif_table_entry(SAI_NULL_OBJECT_ID){};
254+
: user_defined_trap(SAI_NULL_OBJECT_ID), hostif_table_entry(SAI_NULL_OBJECT_ID) {};
255255
};
256256

257257
using acl_rule_attr_lookup_t = std::map<std::string, acl_entry_attr_union_t>;

orchagent/p4orch/ext_tables_manager.cpp

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
#include <boost/algorithm/string.hpp>
44
#include <memory>
5+
#include <nlohmann/json.hpp>
56
#include <sstream>
67
#include <string>
78
#include <utility>
@@ -14,7 +15,6 @@
1415
#include "p4orch/p4orch.h"
1516
#include "p4orch/p4orch_util.h"
1617
#include "tokenize.h"
17-
#include <nlohmann/json.hpp>
1818

1919
extern sai_counter_api_t *sai_counter_api;
2020
extern sai_generic_programmable_api_t *sai_generic_programmable_api;
@@ -111,15 +111,18 @@ ReturnCode ExtTablesManager::validateActionParamsCrossRef(P4ExtTableAppDbEntry &
111111
SWSS_LOG_ERROR("Cross-table reference validation failed from extension-table %s",
112112
table_name.c_str());
113113
return ReturnCode(StatusCode::SWSS_RC_INVALID_PARAM)
114-
<< "Cross-table reference valdiation failed from extension table";
114+
<< "Cross-table reference valdiation failed from extension "
115+
"table";
115116
}
116117
}
117118
else
118119
{
119-
SWSS_LOG_ERROR("Cross-table reference validation failed due to non-existent table %s",
120+
SWSS_LOG_ERROR("Cross-table reference validation failed due to non-existent table "
121+
"%s",
120122
table_name.c_str());
121123
return ReturnCode(StatusCode::SWSS_RC_INVALID_PARAM)
122-
<< "Cross-table reference valdiation failed due to non-existent table";
124+
<< "Cross-table reference valdiation failed due to non-existent "
125+
"table";
123126
}
124127
}
125128

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

133136
if (oid == SAI_NULL_OBJECT_ID)
134137
{
135-
SWSS_LOG_ERROR("Cross-table reference validation failed, null OID expected from table %s",
138+
SWSS_LOG_ERROR("Cross-table reference validation failed, null OID expected from "
139+
"table %s",
136140
table_name.c_str());
137141
return ReturnCode(StatusCode::SWSS_RC_INVALID_PARAM) << "Cross-table reference valdiation failed, null OID";
138142
}
@@ -724,7 +728,8 @@ void ExtTablesManager::drain()
724728
SWSS_LOG_ERROR("Unable to deserialize APP DB entry with key %s: %s",
725729
QuotedVar(kfvKey(key_op_fvs_tuple)).c_str(), status.message().c_str());
726730
m_publisher->publish(APP_P4RT_TABLE_NAME, kfvKey(key_op_fvs_tuple),
727-
kfvFieldsValues(key_op_fvs_tuple), status, /*replace=*/true);
731+
kfvFieldsValues(key_op_fvs_tuple), status,
732+
/*replace=*/true);
728733
continue;
729734
}
730735

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

@@ -772,7 +778,8 @@ void ExtTablesManager::drain()
772778
QuotedVar(kfvKey(key_op_fvs_tuple)).c_str(), status.message().c_str());
773779
}
774780
m_publisher->publish(APP_P4RT_TABLE_NAME, kfvKey(key_op_fvs_tuple), kfvFieldsValues(key_op_fvs_tuple),
775-
status, /*replace=*/true);
781+
status,
782+
/*replace=*/true);
776783
}
777784

778785
it_m->second.clear();
@@ -833,7 +840,8 @@ void ExtTablesManager::doExtCounterStatsTask()
833840
sai_counter_api->get_counter_stats(ext_table_entry->sai_counter_oid, 2, stat_ids, stats);
834841
if (sai_status != SAI_STATUS_SUCCESS)
835842
{
836-
SWSS_LOG_WARN("Failed to set counters stats for extension entry %s:%s in COUNTERS_DB: ",
843+
SWSS_LOG_WARN("Failed to set counters stats for extension entry %s:%s in "
844+
"COUNTERS_DB: ",
837845
table_name.c_str(), ext_table_entry->table_key.c_str());
838846
continue;
839847
}

orchagent/p4orch/ext_tables_manager.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#pragma once
22

33
#include <memory>
4+
#include <nlohmann/json.hpp>
45
#include <string>
56
#include <unordered_map>
67
#include <vector>
@@ -14,7 +15,6 @@
1415
#include "response_publisher_interface.h"
1516
#include "return_code.h"
1617
#include "vrforch.h"
17-
#include <nlohmann/json.hpp>
1818
extern "C"
1919
{
2020
#include "sai.h"
@@ -29,7 +29,7 @@ struct P4ExtTableEntry
2929
sai_object_id_t sai_counter_oid = SAI_NULL_OBJECT_ID;
3030
std::unordered_map<std::string, DepObject> action_dep_objects;
3131

32-
P4ExtTableEntry(){};
32+
P4ExtTableEntry() {};
3333
P4ExtTableEntry(const std::string &db_key, const std::string &table_name, const std::string &table_key)
3434
: db_key(db_key), table_name(table_name), table_key(table_key)
3535
{

orchagent/p4orch/gre_tunnel_manager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include "p4orch/gre_tunnel_manager.h"
22

33
#include <map>
4+
#include <nlohmann/json.hpp>
45
#include <sstream>
56
#include <string>
67
#include <vector>
@@ -14,7 +15,6 @@
1415
#include "sai_serialize.h"
1516
#include "swssnet.h"
1617
#include "table.h"
17-
#include <nlohmann/json.hpp>
1818
extern "C"
1919
{
2020
#include "sai.h"

orchagent/p4orch/l3_admit_manager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include "p4orch/l3_admit_manager.h"
22

33
#include <map>
4+
#include <nlohmann/json.hpp>
45
#include <sstream>
56
#include <string>
67
#include <vector>
@@ -14,7 +15,6 @@
1415
#include "sai_serialize.h"
1516
#include "table.h"
1617
#include "tokenize.h"
17-
#include <nlohmann/json.hpp>
1818
extern "C"
1919
{
2020
#include "sai.h"

orchagent/p4orch/mirror_session_manager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include "p4orch/mirror_session_manager.h"
22

33
#include <map>
4+
#include <nlohmann/json.hpp>
45

56
#include "SaiAttributeList.h"
67
#include "dbconnector.h"
@@ -10,7 +11,6 @@
1011
#include "swss/logger.h"
1112
#include "swssnet.h"
1213
#include "table.h"
13-
#include <nlohmann/json.hpp>
1414

1515
using ::p4orch::kTableKeyDelimiter;
1616

orchagent/p4orch/neighbor_manager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "p4orch/neighbor_manager.h"
22

3+
#include <nlohmann/json.hpp>
34
#include <sstream>
45
#include <string>
56
#include <vector>
@@ -13,7 +14,6 @@
1314
#include "sai_serialize.h"
1415
#include "swssnet.h"
1516
#include "table.h"
16-
#include <nlohmann/json.hpp>
1717
extern "C"
1818
{
1919
#include "sai.h"

orchagent/p4orch/next_hop_manager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "p4orch/next_hop_manager.h"
22

3+
#include <nlohmann/json.hpp>
34
#include <sstream>
45
#include <string>
56
#include <vector>
@@ -14,7 +15,6 @@
1415
#include "sai_serialize.h"
1516
#include "swssnet.h"
1617
#include "table.h"
17-
#include <nlohmann/json.hpp>
1818
extern "C"
1919
{
2020
#include "sai.h"

orchagent/p4orch/p4orch_util.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "p4orch/p4orch_util.h"
2-
#include "p4orch/p4orch.h"
32

3+
#include "p4orch/p4orch.h"
44
#include "schema.h"
55

66
using ::p4orch::kTableKeyDelimiter;

orchagent/p4orch/route_manager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include "p4orch/route_manager.h"
22

33
#include <memory>
4+
#include <nlohmann/json.hpp>
45
#include <sstream>
56
#include <string>
67
#include <unordered_set>
@@ -16,7 +17,6 @@
1617
#include "sai_serialize.h"
1718
#include "swssnet.h"
1819
#include "table.h"
19-
#include <nlohmann/json.hpp>
2020

2121
using ::p4orch::kTableKeyDelimiter;
2222

orchagent/p4orch/router_interface_manager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
#include <map>
44
#include <memory>
5+
#include <nlohmann/json.hpp>
56
#include <sstream>
67
#include <string>
78
#include <utility>
@@ -17,7 +18,6 @@
1718
#include "sai_serialize.h"
1819
#include "table.h"
1920
#include "vrforch.h"
20-
#include <nlohmann/json.hpp>
2121

2222
using ::p4orch::kTableKeyDelimiter;
2323

0 commit comments

Comments
 (0)