17#ifndef BACKENDS_EBPF_EBPFOPTIONS_H_
18#define BACKENDS_EBPF_EBPFOPTIONS_H_
20#include "frontends/common/options.h"
22enum XDP2TC { XDP2TC_NONE, XDP2TC_META, XDP2TC_HEAD, XDP2TC_CPUMAP };
37 enum XDP2TC xdp2tcMode = XDP2TC_NONE;
45 void calculateXDP2TCMode() {
52 <<
"XDP2TC 'meta' mode cannot be used if XDP is enabled. "
53 "Falling back to 'head' mode. For more information see "
54 "https://github.com/p4lang/p4c/blob/main/backends/ebpf/psa/README.md#xdp2tc-mode"
56 xdp2tcMode = XDP2TC_HEAD;
59 std::cout <<
"Setting XDP2TC 'head' mode by default for XDP-based hook." << std::endl;
60 xdp2tcMode = XDP2TC_HEAD;
62 std::cout <<
"Setting XDP2TC 'meta' mode by default for TC-based hook." << std::endl;
64 xdp2tcMode = XDP2TC_META;
66 BUG_CHECK(xdp2tcMode != XDP2TC_NONE,
"xdp2tc mode should not be set to NONE, bug?");
Definition frontends/common/options.h:28
Definition ebpfOptions.h:24
std::filesystem::path outputFile
file to output to
Definition ebpfOptions.h:27
bool emitTraceMessages
tracing eBPF code execution
Definition ebpfOptions.h:33
bool emitExterns
Externs generation.
Definition ebpfOptions.h:31
unsigned int maxTernaryMasks
maximum number of unique ternary masks
Definition ebpfOptions.h:39
bool loadIRFromJson
read from json
Definition ebpfOptions.h:29
bool enableTableCache
Enable table cache for LPM and ternary tables.
Definition ebpfOptions.h:41
bool generateToXDP
generate program to XDP layer
Definition ebpfOptions.h:35
Definition parser_options.h:168