22class BFRuntimeSchemaGenerator :
public BFRuntimeGenerator {
24 BFRuntimeSchemaGenerator(
const p4configv1::P4Info &p4info,
bool isTDI,
26 : BFRuntimeGenerator(p4info), isTDI(isTDI), options(options) {}
40 enum BFRuntimeDataFieldIds : P4Id {
46 BF_RT_DATA_START = TD_DATA_END,
48 BF_RT_DATA_ACTION_MEMBER_ID,
49 BF_RT_DATA_SELECTOR_GROUP_ID,
50 BF_RT_DATA_ACTION_MEMBER_STATUS,
51 BF_RT_DATA_MAX_GROUP_SIZE,
52 BF_RT_DATA_HASH_VALUE,
63 bool addMatchTypePriority(std::optional<cstring> &matchType)
const override;
65 bool addActionProfIds(
const p4configv1::Table &table,
67 void addMatchActionData(
const p4configv1::Table &table,
Util::JsonObject *tableJson,
70 std::optional<bool> actProfHasSelector(P4Id actProfId)
const override;
72 static std::optional<ActionProf> fromDPDKActionProfile(
73 const p4configv1::P4Info &p4info,
const p4configv1::ExternInstance &externInstance) {
74 const auto &pre = externInstance.preamble();
75 p4configv1::ActionProfile actionProfile;
76 if (!externInstance.info().UnpackTo(&actionProfile)) {
78 "Extern instance %1% does not pack an ActionProfile object", pre.name());
81 auto tableIds = collectTableIds(p4info, actionProfile.table_ids().begin(),
82 actionProfile.table_ids().end());
83 return ActionProf{pre.name(), pre.id(), actionProfile.size(), tableIds,
84 transformAnnotations(pre)};
const Util::JsonObject * genSchema() const override
Generates the schema as a Json object for the provided P4Info instance.
Definition dpdk/control-plane/bfruntime_ext.cpp:212
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:13
void error(const char *format, Args &&...args)
Report an error with the given message.
Definition lib/error.h:58