Skip to content

Commit

Permalink
Add support for ternary const entries (#3347)
Browse files Browse the repository at this point in the history
* Add support for ternary const entries in ebpf-PSA backend
  • Loading branch information
kmateuszssak authored May 25, 2022
1 parent e790248 commit ea2f917
Show file tree
Hide file tree
Showing 6 changed files with 735 additions and 7 deletions.
18 changes: 11 additions & 7 deletions backends/ebpf/psa/ebpfPsaGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,10 @@ void PSAEbpfGenerator::emitHelperFunctions(CodeBuilder *builder) const {
builder->appendLine(meterExecuteFunc);
builder->newline();
}

cstring addPrefixFunc = EBPFTablePSA::addPrefixFunc(options.emitTraceMessages);
builder->appendLine(addPrefixFunc);
builder->newline();
}

// =====================PSAArchTC=============================
Expand Down Expand Up @@ -360,20 +364,20 @@ void PSAArchTC::emit(CodeBuilder *builder) const {
emitInstances(builder);

/*
* 6. BPF map initialization
* 6. Helper functions for ingress and egress program.
*/
emitInitializer(builder);
builder->newline();
emitHelperFunctions(builder);

/*
* 7. XDP helper program.
* 7. BPF map initialization.
*/
xdp->emit(builder);
emitInitializer(builder);
builder->newline();

/*
* 8. Helper functions for ingress and egress program.
* 8. XDP helper program.
*/
emitHelperFunctions(builder);
xdp->emit(builder);

/*
* 9. TC Ingress program.
Expand Down
Loading

0 comments on commit ea2f917

Please sign in to comment.