Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[libsai] Re-implement APIs create/remove #653

Merged
merged 7 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
320 changes: 284 additions & 36 deletions dash-pipeline/SAI/src/dashsai.cpp

Large diffs are not rendered by default.

31 changes: 31 additions & 0 deletions dash-pipeline/SAI/src/dashsai.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,29 @@ namespace dash
_Inout_ sai_attribute_t *attr_list);

// QUAD api implementation, using p4 meta table
sai_status_t create(
_In_ const P4MetaTable &meta_table,
_In_ sai_object_type_t objectType,
_Out_ sai_object_id_t* objectId,
_In_ sai_object_id_t switchId,
_In_ uint32_t attr_count,
_In_ const sai_attribute_t *attr_list);

sai_status_t create(
_In_ const P4MetaTable &meta_table,
_In_ sai_object_type_t objectType,
_Inout_ std::shared_ptr<p4::v1::TableEntry> matchActionEntry,
_In_ uint32_t attr_count,
_In_ const sai_attribute_t *attr_list);

sai_status_t remove(
_In_ const P4MetaTable &meta_table,
_In_ sai_object_id_t objectId);

sai_status_t remove(
_In_ const P4MetaTable &meta_table,
_Inout_ std::shared_ptr<p4::v1::TableEntry> matchActionEntry);

sai_status_t set(
_In_ const P4MetaTable &meta_table,
_In_ sai_object_id_t objectId,
Expand Down Expand Up @@ -126,6 +149,14 @@ namespace dash
_In_ sai_object_id_t id,
_Out_ std::shared_ptr<p4::v1::TableEntry> &entry);

private: // private helper methods

void mutateSiblingTablesEntry(
_In_ const P4MetaTable &meta_table,
_In_ std::shared_ptr<p4::v1::TableEntry>,
_In_ p4::v1::Update_Type updateType,
_In_ uint32_t action_id = 0);

public: // default attributes helper

static std::vector<sai_attribute_t> populateDefaultAttributes(
Expand Down
Loading
Loading