Skip to content

Commit

Permalink
[p4orch]: PINS Extension tables support (#2506)
Browse files Browse the repository at this point in the history
* PINS Extension tables support
  • Loading branch information
svshah-intel authored and StormLiangMS committed Feb 10, 2023
1 parent 782a2ef commit 6420808
Show file tree
Hide file tree
Showing 46 changed files with 2,575 additions and 78 deletions.
4 changes: 3 additions & 1 deletion orchagent/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ orchagent_SOURCES += debug_counter/debug_counter.cpp debug_counter/drop_counter.
orchagent_SOURCES += p4orch/p4orch.cpp \
p4orch/p4orch_util.cpp \
p4orch/p4oidmapper.cpp \
p4orch/tables_definition_manager.cpp \
p4orch/router_interface_manager.cpp \
p4orch/gre_tunnel_manager.cpp \
p4orch/neighbor_manager.cpp \
Expand All @@ -115,7 +116,8 @@ orchagent_SOURCES += p4orch/p4orch.cpp \
p4orch/acl_rule_manager.cpp \
p4orch/wcmp_manager.cpp \
p4orch/mirror_session_manager.cpp \
p4orch/l3_admit_manager.cpp
p4orch/l3_admit_manager.cpp \
p4orch/ext_tables_manager.cpp

orchagent_CFLAGS = $(DBGFLAGS) $(AM_CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_SAI) $(CFLAGS_ASAN)
orchagent_CPPFLAGS = $(DBGFLAGS) $(AM_CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_SAI) $(CFLAGS_ASAN)
Expand Down
7 changes: 6 additions & 1 deletion orchagent/p4orch/acl_rule_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,12 @@ std::vector<sai_attribute_t> getMeterSaiAttrs(const P4AclMeter &p4_acl_meter)

} // namespace

void AclRuleManager::enqueue(const swss::KeyOpFieldsValuesTuple &entry)
ReturnCode AclRuleManager::getSaiObject(const std::string &json_key, sai_object_type_t &object_type, std::string &object_key)
{
return StatusCode::SWSS_RC_UNIMPLEMENTED;
}

void AclRuleManager::enqueue(const std::string &table_name, const swss::KeyOpFieldsValuesTuple &entry)
{
m_entries.push_back(entry);
}
Expand Down
3 changes: 2 additions & 1 deletion orchagent/p4orch/acl_rule_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,10 @@ class AclRuleManager : public ObjectManagerInterface
}
virtual ~AclRuleManager() = default;

void enqueue(const swss::KeyOpFieldsValuesTuple &entry) override;
void enqueue(const std::string &table_name, const swss::KeyOpFieldsValuesTuple &entry) override;
void drain() override;
std::string verifyState(const std::string &key, const std::vector<swss::FieldValueTuple> &tuple) override;
ReturnCode getSaiObject(const std::string &json_key, sai_object_type_t &object_type, std::string &object_key) override;

// Update counters stats for every rule in each ACL table in COUNTERS_DB, if
// counters are enabled in rules.
Expand Down
7 changes: 6 additions & 1 deletion orchagent/p4orch/acl_table_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,12 @@ ReturnCodeOr<std::vector<sai_attribute_t>> AclTableManager::getUdfSaiAttrs(const
return udf_attrs;
}

void AclTableManager::enqueue(const swss::KeyOpFieldsValuesTuple &entry)
ReturnCode AclTableManager::getSaiObject(const std::string &json_key, sai_object_type_t &object_type, std::string &object_key)
{
return StatusCode::SWSS_RC_UNIMPLEMENTED;
}

void AclTableManager::enqueue(const std::string &table_name, const swss::KeyOpFieldsValuesTuple &entry)
{
m_entries.push_back(entry);
}
Expand Down
3 changes: 2 additions & 1 deletion orchagent/p4orch/acl_table_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ class AclTableManager : public ObjectManagerInterface
explicit AclTableManager(P4OidMapper *p4oidMapper, ResponsePublisherInterface *publisher);
virtual ~AclTableManager();

void enqueue(const swss::KeyOpFieldsValuesTuple &entry) override;
void enqueue(const std::string &table_name, const swss::KeyOpFieldsValuesTuple &entry) override;
void drain() override;
std::string verifyState(const std::string &key, const std::vector<swss::FieldValueTuple> &tuple) override;
ReturnCode getSaiObject(const std::string &json_key, sai_object_type_t &object_type, std::string &object_key) override;

// Get ACL table definition by table name in cache. Return nullptr if not
// found.
Expand Down
Loading

0 comments on commit 6420808

Please sign in to comment.