P4C
The P4 Compiler
Loading...
Searching...
No Matches
EBPF::TCIngressPipeline Class Reference
Inheritance diagram for EBPF::TCIngressPipeline:
[legend]

Public Member Functions

 TCIngressPipeline (cstring name, const EbpfOptions &options, P4::ReferenceMap *refMap, P4::TypeMap *typeMap)
 
void emitGlobalMetadataInitializer (CodeBuilder *builder) override
 
void emitTrafficManager (CodeBuilder *builder) override
 
- Public Member Functions inherited from EBPF::EBPFIngressPipeline
 EBPFIngressPipeline (cstring name, const EbpfOptions &options, P4::ReferenceMap *refMap, P4::TypeMap *typeMap)
 
 DECLARE_TYPEINFO (EBPFIngressPipeline, EBPFPipeline)
 
void emit (CodeBuilder *builder) override
 
void emitPSAControlInputMetadata (CodeBuilder *builder) override
 
void emitPSAControlOutputMetadata (CodeBuilder *builder) override
 
void emitSharedMetadataInitializer (CodeBuilder *builder)
 
- Public Member Functions inherited from EBPF::EBPFPipeline
 EBPFPipeline (cstring name, const EbpfOptions &options, P4::ReferenceMap *refMap, P4::TypeMap *typeMap)
 
 DECLARE_TYPEINFO (EBPFPipeline, EBPFProgram)
 
virtual cstring dropReturnCode ()
 
void emitCPUMAPHeadersInitializers (CodeBuilder *builder)
 Generates a pointer to struct hdr_md. The pointer is used to access data from per-CPU map.
 
virtual void emitCPUMAPInitializers (CodeBuilder *builder)
 
virtual void emitCPUMAPLookup (CodeBuilder *builder)
 
void emitHeaderInstances (CodeBuilder *builder) override
 
void emitHeadersFromCPUMAP (CodeBuilder *builder)
 
void emitInputPortMapping (CodeBuilder *builder)
 
void emitLocalHeaderInstancesAsPointers (CodeBuilder *builder)
 Generates a pointer to struct Headers_t and puts it on the BPF program's stack.
 
void emitLocalVariables (CodeBuilder *builder) override
 Generates a set of helper variables that are used during packet processing.
 
void emitMetadataFromCPUMAP (CodeBuilder *builder)
 
virtual void emitPacketLength (CodeBuilder *builder)
 
virtual void emitTimestamp (CodeBuilder *builder)
 
void emitUserMetadataInstance (CodeBuilder *builder)
 
virtual cstring forwardReturnCode ()
 
bool hasAnyMeter () const
 
bool isEmpty () const
 
bool shouldEmitTimestamp () const
 
- Public Member Functions inherited from EBPF::EBPFProgram
 EBPFProgram (const EbpfOptions &options, const IR::P4Program *program, P4::ReferenceMap *refMap, P4::TypeMap *typeMap, const IR::ToplevelBlock *toplevel)
 return 'true' on success
 
virtual bool build ()
 
 DECLARE_TYPEINFO (EBPFProgram, EBPFObject)
 
virtual void emitC (CodeBuilder *builder, const std::filesystem::path &headerFile)
 
virtual void emitCommonPreamble (CodeBuilder *builder)
 
virtual void emitGeneratedComment (CodeBuilder *builder)
 
virtual void emitH (CodeBuilder *builder, const std::filesystem::path &headerFile)
 
- Public Member Functions inherited from EBPF::EBPFObject
 DECLARE_TYPEINFO (EBPFObject)
 
- Public Member Functions inherited from ICastable
template<typename T >
T & as ()
 Tries to convert the class to type T. A BUG occurs if the cast fails.
 
template<typename T >
const T & as () const
 Tries to convert the class to type T. A BUG occurs if the cast fails.
 
template<typename T >
T * checkedTo ()
 Performs a checked cast. A BUG occurs if the cast fails.
 
template<typename T >
const T * checkedTo () const
 Performs a checked cast. A BUG occurs if the cast fails.
 
- Public Member Functions inherited from RTTI::Base
template<typename T >
bool is () const noexcept
 
virtual bool isA (TypeId typeId) const noexcept=0
 
template<typename T >
const T * to () const noexcept
 Same as to, but returns const pointer to T.
 
template<typename T >
T * to () noexcept
 
virtual TypeId typeId () const noexcept=0
 

Additional Inherited Members

- Static Public Member Functions inherited from EBPF::EBPFObject
static cstring externalName (const IR::IDeclaration *declaration)
 
static cstring getSpecializedTypeName (const IR::Declaration_Instance *di)
 
static cstring getTypeName (const IR::Declaration_Instance *di)
 
- Public Attributes inherited from EBPF::EBPFIngressPipeline
int actUnspecCode
 
unsigned int maxResubmitDepth
 
- Public Attributes inherited from EBPF::EBPFPipeline
cstring compilerGlobalMetadata
 A name of an internal variable storing global metadata.
 
cstring contextVar
 Variable name storing pointer to eBPF packet descriptor (e.g., __sk_buff).
 
EBPFControlPSAcontrol
 
EBPFDeparserPSAdeparser
 
cstring ifindexVar
 Variable storing ingress interface index.
 
cstring inputPortVar
 A variable to store ifindex after mapping (e.g. due to recirculation).
 
cstring name
 A custom name of eBPF program.
 
cstring oneKey
 A variable name storing "1" value. Used to access BPF array map index.
 
unsigned packetMark
 A unique mark used to differentiate packets processed by P4/eBPF from others.
 
cstring packetPathVar
 Variables storing global metadata (packet_path & instance).
 
cstring pktInstanceVar
 
cstring priorityVar
 Variable storing skb->priority value (TC only).
 
cstring sectionName
 eBPF section name, which should a concatenation of classifier/ + a custom name.
 
cstring timestampVar
 Variable name storing current timestamp retrieved from bpf_ktime_get_ns().
 
- Public Attributes inherited from EBPF::EBPFProgram
cstring arrayIndexType = "u32"_cs
 TODO: this should be a compiler option probably.
 
cstring byteVar
 
EBPFControlcontrol
 
EBPFDeparserdeparser
 Deparser may be NULL if not supported (e.g. ebpfFilter package).
 
cstring endLabel
 
cstring errorEnum
 
cstring errorVar
 
cstring functionName
 
cstring headerStartVar
 
cstring lengthVar
 
cstring license = "GPL"_cs
 
EBPFModelmodel
 
cstring offsetVar
 
const EbpfOptionsoptions
 
cstring packetEndVar
 
cstring packetStartVar
 
EBPFParserparser
 
const IR::P4Program * program
 
const TargetprogTarget
 
P4::ReferenceMaprefMap
 
const IR::ToplevelBlock * toplevel
 
P4::TypeMaptypeMap
 
cstring zeroKey
 
- Protected Member Functions inherited from EBPF::EBPFProgram
virtual void emitPipeline (CodeBuilder *builder)
 
virtual void emitPreamble (CodeBuilder *builder)
 
virtual void emitTypes (CodeBuilder *builder)
 
virtual bool isLibraryMethod (cstring methodName)
 
- Protected Member Functions inherited from RTTI::Base
virtual const void * toImpl (TypeId typeId) const noexcept=0
 

Member Function Documentation

◆ emitGlobalMetadataInitializer()

void EBPF::TCIngressPipeline::emitGlobalMetadataInitializer ( CodeBuilder * builder)
overridevirtual

Generates a pointer to skb->cb and maps it to psa_global_metadata to access global metadata shared between pipelines.

Reimplemented from EBPF::EBPFPipeline.

Reimplemented in EBPF::TCTrafficManagerForXDP, and TC::TCIngressPipelinePNA.

◆ emitTrafficManager()

void EBPF::TCIngressPipeline::emitTrafficManager ( CodeBuilder * builder)
overridevirtual

The Traffic Manager for Ingress pipeline implements:

  • Multicast handling
  • send to port

Implements EBPF::EBPFPipeline.

Reimplemented in TC::TCIngressPipelinePNA.