diff --git a/dash-pipeline/SAI/src/dashsai.cpp b/dash-pipeline/SAI/src/dashsai.cpp index 374d55099..ec7d15159 100644 --- a/dash-pipeline/SAI/src/dashsai.cpp +++ b/dash-pipeline/SAI/src/dashsai.cpp @@ -1098,7 +1098,8 @@ sai_status_t DashSai::create( set_attr_to_p4_match(meta_key, &attr_list[i], matchActionEntry); } else { - // FIXME: check extra fields + // attr in extra fields + set_attr_to_p4_misc(meta_table, &attr_list[i], matchActionEntry); } } @@ -1140,7 +1141,8 @@ sai_status_t DashSai::create( set_attr_to_p4_action(meta_param, &attr_list[i], action); } else { - // FIXME: check extra fields + // attr in extra fields + set_attr_to_p4_misc(meta_table, &attr_list[i], matchActionEntry); } } diff --git a/dash-pipeline/SAI/src/p4meta.cpp b/dash-pipeline/SAI/src/p4meta.cpp index 7c9b068e3..42023a1a6 100644 --- a/dash-pipeline/SAI/src/p4meta.cpp +++ b/dash-pipeline/SAI/src/p4meta.cpp @@ -311,6 +311,21 @@ namespace dash set_attr_value_to_p4(meta_param->field, meta_param->bitwidth, attr->value, param); } + void set_attr_to_p4_misc( + _In_ const P4MetaTable &meta_table, + _In_ const sai_attribute_t *attr, + _Inout_ std::shared_ptr matchActionEntry) + { + for (auto &extra_attr: meta_table.extra_fields) { + if (extra_attr.second == attr->id) { + if (extra_attr.first == "PRIORITY") { + matchActionEntry->set_priority(attr->value.u32); + break; + } + } + } + } + std::pair get_match_pair_from_p4_table_entry( _In_ const P4MetaKey *meta_key, _In_ std::shared_ptr matchActionEntry) diff --git a/dash-pipeline/SAI/src/p4meta.h b/dash-pipeline/SAI/src/p4meta.h index 0617aaf44..ec673cddc 100644 --- a/dash-pipeline/SAI/src/p4meta.h +++ b/dash-pipeline/SAI/src/p4meta.h @@ -222,6 +222,11 @@ namespace dash _In_ const sai_attribute_t *attr, _Out_ p4::v1::Action *action); + void set_attr_to_p4_misc( + _In_ const P4MetaTable &meta_table, + _In_ const sai_attribute_t *attr, + _Inout_ std::shared_ptr matchActionEntry); + std::pair get_match_pair_from_p4_table_entry( _In_ const P4MetaKey *meta_key, _In_ std::shared_ptr matchActionEntry);