forked from p4lang/p4c
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathebpfControl.cpp
642 lines (568 loc) · 23.4 KB
/
ebpfControl.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
/*
Copyright 2013-present Barefoot Networks, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#include "ebpfControl.h"
#include "ebpfTable.h"
#include "ebpfType.h"
#include "frontends/p4/methodInstance.h"
#include "frontends/p4/parameterSubstitution.h"
#include "frontends/p4/tableApply.h"
#include "frontends/p4/typeMap.h"
#include "lib/cstring.h"
#include "lib/error.h"
namespace EBPF {
ControlBodyTranslator::ControlBodyTranslator(const EBPFControl *control)
: CodeGenInspector(control->program->refMap, control->program->typeMap),
control(control),
p4lib(P4::P4CoreLibrary::instance()) {
setName("ControlBodyTranslator");
}
bool ControlBodyTranslator::preorder(const IR::PathExpression *expression) {
auto decl = control->program->refMap->getDeclaration(expression->path, true);
auto param = decl->getNode()->to<IR::Parameter>();
if (param != nullptr) {
if (toDereference.count(param) > 0) builder->append("*");
auto subst = ::get(substitution, param);
if (subst != nullptr) {
builder->append(subst->name);
return false;
}
}
builder->append(expression->path->name); // each identifier should be unique
return false;
}
void ControlBodyTranslator::processCustomExternFunction(const P4::ExternFunction *function,
EBPFTypeFactory *typeFactory) {
if (!control->emitExterns)
::error(ErrorType::ERR_UNSUPPORTED, "%1%: Not supported", function->method);
visit(function->expr->method);
builder->append("(");
bool first = true;
for (auto p : *function->substitution.getParametersInArgumentOrder()) {
if (!first) builder->append(", ");
first = false;
auto arg = function->substitution.lookup(p);
if (p->direction == IR::Direction::Out || p->direction == IR::Direction::InOut) {
builder->append("&");
} else if (p->direction == IR::Direction::In) {
builder->append("(const ");
auto type = typeMap->getType(arg);
auto ebpfType = typeFactory->create(type);
ebpfType->declare(builder, cstring::empty, false);
builder->append(") ");
}
visit(arg);
}
builder->append(")");
builder->endOfStatement(true);
}
void ControlBodyTranslator::processFunction(const P4::ExternFunction *function) {
processCustomExternFunction(function, EBPFTypeFactory::instance);
}
bool ControlBodyTranslator::preorder(const IR::MethodCallExpression *expression) {
if (commentDescriptionDepth == 0) builder->append("/* ");
commentDescriptionDepth++;
visit(expression->method);
builder->append("(");
bool first = true;
for (auto a : *expression->arguments) {
if (!first) builder->append(", ");
first = false;
visit(a);
}
builder->append(")");
if (commentDescriptionDepth == 1) {
builder->append(" */");
builder->newline();
}
commentDescriptionDepth--;
// do not process extern when comment is generated
if (commentDescriptionDepth != 0) return false;
auto mi = P4::MethodInstance::resolve(expression, control->program->refMap,
control->program->typeMap);
auto apply = mi->to<P4::ApplyMethod>();
if (apply != nullptr) {
processApply(apply);
return false;
}
auto ef = mi->to<P4::ExternFunction>();
if (ef != nullptr) {
processFunction(ef);
return false;
}
auto ext = mi->to<P4::ExternMethod>();
if (ext != nullptr) {
processMethod(ext);
return false;
}
auto bim = mi->to<P4::BuiltInMethod>();
if (bim != nullptr) {
builder->emitIndent();
if (bim->name == IR::Type_Header::isValid) {
visit(bim->appliedTo);
builder->append(".ebpf_valid");
return false;
} else if (bim->name == IR::Type_Header::setValid) {
visit(bim->appliedTo);
builder->append(".ebpf_valid = true");
return false;
} else if (bim->name == IR::Type_Header::setInvalid) {
visit(bim->appliedTo);
builder->append(".ebpf_valid = false");
return false;
}
}
auto ac = mi->to<P4::ActionCall>();
if (ac != nullptr) {
// Action arguments have been eliminated by the mid-end.
BUG_CHECK(expression->arguments->size() == 0, "%1%: unexpected arguments for action call",
expression);
cstring msg =
absl::StrFormat("Control: explicit calling action %s()", ac->action->name.name);
builder->target->emitTraceMessage(builder, msg.c_str());
visit(ac->action->body);
return false;
}
::error(ErrorType::ERR_UNSUPPORTED, "Unsupported method invocation %1%", expression);
return false;
}
void ControlBodyTranslator::compileEmitField(const IR::Expression *expr, cstring field,
unsigned hdrOffsetBits, EBPFType *type) {
unsigned alignment = hdrOffsetBits % 8;
unsigned widthToEmit = type->as<IHasWidth>().widthInBits();
cstring swap = cstring::empty;
if (widthToEmit == 16)
swap = "htons"_cs;
else if (widthToEmit == 32)
swap = "htonl"_cs;
if (!swap.isNullOrEmpty()) {
builder->emitIndent();
visit(expr);
builder->appendFormat(".%s = %s(", field.c_str(), swap);
visit(expr);
builder->appendFormat(".%s)", field.c_str());
builder->endOfStatement(true);
}
auto program = control->program;
unsigned bitsInFirstByte = widthToEmit % 8;
if (bitsInFirstByte == 0) bitsInFirstByte = 8;
unsigned bitsInCurrentByte = bitsInFirstByte;
unsigned left = widthToEmit;
for (unsigned i = 0; i < (widthToEmit + 7) / 8; i++) {
builder->emitIndent();
builder->appendFormat("%s = ((char*)(&", program->byteVar.c_str());
visit(expr);
builder->appendFormat(".%s))[%d]", field.c_str(), i);
builder->endOfStatement(true);
unsigned freeBits = alignment == 0 ? (8 - alignment) : 8;
unsigned bitsToWrite = bitsInCurrentByte > freeBits ? freeBits : bitsInCurrentByte;
BUG_CHECK((bitsToWrite > 0) && (bitsToWrite <= 8), "invalid bitsToWrite %d", bitsToWrite);
builder->emitIndent();
if (alignment == 0)
builder->appendFormat("write_byte(%s, BYTES(%u) + %d, (%s) << %d)",
program->headerStartVar.c_str(), hdrOffsetBits, i,
program->byteVar.c_str(), 8 - bitsToWrite);
else // FIXME change to use write_partial_ex
builder->appendFormat("write_partial(%s + BYTES(%u) + %d, %d, (%s) << %d)",
program->headerStartVar.c_str(), hdrOffsetBits, i, alignment,
program->byteVar.c_str(), 8 - bitsToWrite);
builder->endOfStatement(true);
left -= bitsToWrite;
bitsInCurrentByte -= bitsToWrite;
if (bitsInCurrentByte > 0) {
builder->emitIndent();
builder->appendFormat("write_byte(%s, BYTES(%u) + %d + 1, (%s << %d))",
program->headerStartVar.c_str(), hdrOffsetBits, i,
program->byteVar.c_str(), 8 - alignment % 8);
builder->endOfStatement(true);
left -= bitsInCurrentByte;
}
alignment = (alignment + bitsToWrite) % 8;
bitsInCurrentByte = left >= 8 ? 8 : left;
}
}
void ControlBodyTranslator::compileEmit(const IR::Vector<IR::Argument> *args) {
BUG_CHECK(args->size() == 1, "%1%: expected 1 argument for emit", args);
auto expr = args->at(0)->expression;
auto type = typeMap->getType(expr);
auto ht = type->to<IR::Type_Header>();
if (ht == nullptr) {
::error(ErrorType::ERR_UNSUPPORTED, "Cannot emit a non-header type %1%", expr);
return;
}
auto program = control->program;
builder->emitIndent();
builder->append("if (");
visit(expr);
builder->append(".ebpf_valid) ");
builder->blockStart();
// We expect all headers to start on a byte boundary.
unsigned width = ht->width_bits();
if (width % 8 != 0) {
::error(ErrorType::ERR_UNSUPPORTED_ON_TARGET,
"Header %1% size %2% is not a multiple of 8 bits.", expr, width);
return;
}
builder->emitIndent();
builder->appendFormat("if (%s < %s + BYTES(%d)) ", program->packetEndVar.c_str(),
program->headerStartVar.c_str(), width);
builder->blockStart();
builder->emitIndent();
builder->appendFormat("%s = %s;", program->errorVar.c_str(), p4lib.packetTooShort.str());
builder->newline();
builder->emitIndent();
builder->appendFormat("return %s;", builder->target->abortReturnCode().c_str());
builder->newline();
builder->blockEnd(true);
unsigned hdrOffsetBits = 0;
for (auto f : ht->fields) {
auto ftype = typeMap->getType(f);
auto etype = EBPFTypeFactory::instance->create(ftype);
auto et = etype->to<IHasWidth>();
if (et == nullptr) {
::error(ErrorType::ERR_UNSUPPORTED_ON_TARGET,
"Only headers with fixed widths supported %1%", f);
return;
}
compileEmitField(expr, f->name, hdrOffsetBits, etype);
hdrOffsetBits += et->widthInBits();
}
// Increment header pointer
builder->emitIndent();
builder->appendFormat("%s += BYTES(%d);", program->headerStartVar.c_str(), width);
builder->newline();
builder->blockEnd(true);
return;
}
void ControlBodyTranslator::processMethod(const P4::ExternMethod *method) {
auto decl = method->object;
auto declType = method->originalExternType;
if (declType->name.name == EBPFModel::instance.counterArray.name) {
builder->blockStart();
cstring name = EBPFObject::externalName(decl);
auto counterMap = control->getCounter(name);
counterMap->emitMethodInvocation(builder, method);
builder->blockEnd(true);
return;
} else if (declType->name.name == p4lib.packetOut.name) {
if (method->method->name.name == p4lib.packetOut.emit.name) {
compileEmit(method->expr->arguments);
return;
}
}
::error(ErrorType::ERR_UNSUPPORTED_ON_TARGET, "%1%: Unexpected method call", method->expr);
}
void ControlBodyTranslator::processApply(const P4::ApplyMethod *method) {
P4::ParameterSubstitution binding;
cstring actionVariableName, msgStr;
auto table = control->getTable(method->object->getName().name);
BUG_CHECK(table != nullptr, "No table for %1%", method->expr);
msgStr = absl::StrFormat("Control: applying %s", method->object->getName().name);
builder->target->emitTraceMessage(builder, msgStr.c_str());
builder->emitIndent();
if (!saveAction.empty()) {
actionVariableName = saveAction.at(saveAction.size() - 1);
if (!actionVariableName.isNullOrEmpty()) {
builder->appendFormat("unsigned int %s = 0;\n", actionVariableName.c_str());
builder->emitIndent();
}
}
builder->blockStart();
BUG_CHECK(method->expr->arguments->size() == 0, "%1%: table apply with arguments", method);
cstring keyname = "key"_cs;
if (table->keyGenerator != nullptr) {
builder->emitIndent();
builder->appendLine("/* construct key */");
builder->emitIndent();
builder->appendFormat("struct %s %s = {}", table->keyTypeName.c_str(), keyname.c_str());
builder->endOfStatement(true);
table->emitKey(builder, keyname);
}
builder->emitIndent();
builder->appendLine("/* value */");
builder->emitIndent();
cstring valueName = "value"_cs;
builder->appendFormat("struct %s *%s = NULL", table->valueTypeName.c_str(), valueName.c_str());
builder->endOfStatement(true);
if (table->keyGenerator != nullptr) {
builder->emitIndent();
builder->appendLine("/* perform lookup */");
builder->target->emitTraceMessage(builder, "Control: performing table lookup");
builder->emitIndent();
table->emitLookup(builder, keyname, valueName);
}
builder->emitIndent();
builder->appendFormat("if (%s == NULL) ", valueName.c_str());
builder->blockStart();
builder->emitIndent();
builder->appendLine("/* miss; find default action */");
builder->target->emitTraceMessage(builder, "Control: Entry not found, going to default action");
builder->emitIndent();
builder->appendFormat("%s = 0", control->hitVariable.c_str());
builder->endOfStatement(true);
builder->emitIndent();
table->emitLookupDefault(builder, control->program->zeroKey, valueName, actionVariableName);
builder->blockEnd(false);
builder->append(" else ");
builder->blockStart();
builder->emitIndent();
builder->appendFormat("%s = 1", control->hitVariable.c_str());
builder->endOfStatement(true);
builder->blockEnd(true);
if (table->cacheEnabled()) {
table->emitCacheUpdate(builder, keyname, valueName);
builder->blockEnd(true);
}
builder->emitIndent();
builder->appendFormat("if (%s != NULL) ", valueName.c_str());
builder->blockStart();
builder->emitIndent();
builder->appendLine("/* run action */");
table->emitAction(builder, valueName, actionVariableName);
toDereference.clear();
builder->blockEnd(false);
builder->appendFormat(" else ");
builder->blockStart();
if (table->dropOnNoMatchingEntryFound()) {
builder->target->emitTraceMessage(builder, "Control: Entry not found, aborting");
builder->emitIndent();
builder->appendFormat("return %s", builder->target->abortReturnCode().c_str());
builder->endOfStatement(true);
} else {
builder->target->emitTraceMessage(builder,
"Control: Entry not found, executing implicit NoAction");
}
builder->endOfStatement(true);
builder->blockEnd(true);
builder->blockEnd(true);
msgStr = absl::StrFormat("Control: %s applied", method->object->getName().name);
builder->target->emitTraceMessage(builder, msgStr.c_str());
}
bool ControlBodyTranslator::preorder(const IR::ExitStatement *) {
builder->appendFormat("goto %s;", control->program->endLabel.c_str());
return false;
}
bool ControlBodyTranslator::preorder(const IR::ReturnStatement *) {
builder->appendFormat("goto %s;", control->program->endLabel.c_str());
return false;
}
bool ControlBodyTranslator::preorder(const IR::IfStatement *statement) {
bool isHit = P4::TableApplySolver::isHit(statement->condition, control->program->refMap,
control->program->typeMap);
if (isHit) {
// visit first the table, and then the conditional
auto member = statement->condition->to<IR::Member>();
CHECK_NULL(member);
visit(member->expr); // table application. Sets 'hitVariable'
builder->emitIndent();
}
// This is almost the same as the base class method
builder->append("if (");
if (isHit)
builder->append(control->hitVariable);
else
visit(statement->condition);
builder->append(") ");
if (!statement->ifTrue->is<IR::BlockStatement>()) builder->blockStart();
visit(statement->ifTrue);
if (!statement->ifTrue->is<IR::BlockStatement>()) builder->blockEnd(true);
if (statement->ifFalse != nullptr) {
builder->newline();
builder->emitIndent();
builder->append("else ");
if (!statement->ifFalse->is<IR::BlockStatement>()) builder->blockStart();
visit(statement->ifFalse);
if (!statement->ifFalse->is<IR::BlockStatement>()) builder->blockEnd(true);
}
return false;
}
bool ControlBodyTranslator::preorder(const IR::SwitchStatement *statement) {
cstring newName = control->program->refMap->newName("action_run");
saveAction.push_back(newName);
// This must be a table.apply().action_run
auto mem = statement->expression->to<IR::Member>();
BUG_CHECK(mem != nullptr, "%1%: Unexpected expression in switch statement",
statement->expression);
visit(mem->expr);
saveAction.pop_back();
saveAction.push_back(nullptr);
builder->emitIndent();
builder->append("switch (");
builder->append(newName);
builder->append(") ");
builder->blockStart();
BUG_CHECK(mem->expr->type->is<IR::Type_Declaration>(), "%1%: expected table with name",
mem->expr);
cstring tableName = mem->expr->type->to<IR::Type_Declaration>()->name.name;
auto table = control->getTable(tableName);
for (auto c : statement->cases) {
builder->emitIndent();
if (c->label->is<IR::DefaultExpression>()) {
builder->append("default");
} else {
builder->append("case ");
auto pe = c->label->to<IR::PathExpression>();
auto decl = control->program->refMap->getDeclaration(pe->path, true);
BUG_CHECK(decl->is<IR::P4Action>(), "%1%: expected an action", pe);
auto act = decl->to<IR::P4Action>();
cstring fullActionName = table->p4ActionToActionIDName(act);
builder->append(fullActionName);
}
builder->append(":");
builder->newline();
builder->emitIndent();
visit(c->statement);
builder->newline();
builder->emitIndent();
builder->appendLine("break;");
}
builder->blockEnd(false);
saveAction.pop_back();
return false;
}
bool ControlBodyTranslator::preorder(const IR::StructExpression *expr) {
if (commentDescriptionDepth == 0) return CodeGenInspector::preorder(expr);
// Dump structure for helper comment
builder->append("{");
bool first = true;
for (auto c : expr->components) {
if (!first) builder->append(", ");
visit(c->expression);
first = false;
}
builder->append("}");
return false;
}
/////////////////////////////////////////////////
EBPFControl::EBPFControl(const EBPFProgram *program, const IR::ControlBlock *block,
const IR::Parameter *parserHeaders)
: program(program),
controlBlock(block),
headers(nullptr),
accept(nullptr),
xdpInputMeta(nullptr),
xdpOutputMeta(nullptr),
parserHeaders(parserHeaders),
codeGen(nullptr),
emitExterns(program->options.emitExterns) {}
void EBPFControl::scanConstants() {
for (auto c : controlBlock->constantValue) {
auto b = c.second;
if (!b->is<IR::Block>()) continue;
if (b->is<IR::TableBlock>()) {
auto tblblk = b->to<IR::TableBlock>();
auto tbl = new EBPFTable(program, tblblk, codeGen);
tables.emplace(tblblk->container->name, tbl);
} else if (b->is<IR::ExternBlock>()) {
auto ctrblk = b->to<IR::ExternBlock>();
auto node = ctrblk->node;
if (node->is<IR::Declaration_Instance>()) {
auto di = node->to<IR::Declaration_Instance>();
cstring name = EBPFObject::externalName(di);
auto ctr = new EBPFCounterTable(program, ctrblk, name, codeGen);
counters.emplace(name, ctr);
}
} else {
::error(ErrorType::ERR_UNEXPECTED, "Unexpected block %s nested within control",
b->toString());
}
}
}
bool EBPFControl::build() {
hitVariable = program->refMap->newName("hit");
auto pl = controlBlock->container->type->applyParams;
auto it = pl->parameters.begin();
if (program->model.arch == ModelArchitecture::XdpSwitch) {
if (pl->size() != 3) {
::error(ErrorType::ERR_EXPECTED,
"Expected control block %s to have exactly 3 parameters",
controlBlock->getName());
return false;
}
headers = *it;
++it;
xdpInputMeta = *it;
++it;
xdpOutputMeta = *it;
} else {
if (pl->size() != 2) {
::error(ErrorType::ERR_EXPECTED, "Expected control block to have exactly 2 parameters");
return false;
}
headers = *it;
++it;
accept = *it;
}
codeGen = new ControlBodyTranslator(this);
codeGen->substitute(headers, parserHeaders);
scanConstants();
return ::errorCount() == 0;
}
void EBPFControl::emitDeclaration(CodeBuilder *builder, const IR::Declaration *decl) {
if (decl->is<IR::Declaration_Variable>()) {
auto vd = decl->to<IR::Declaration_Variable>();
auto etype = EBPFTypeFactory::instance->create(vd->type);
builder->emitIndent();
bool isPointer = codeGen->isPointerVariable(decl->name.name);
etype->declareInit(builder, vd->name, isPointer);
builder->endOfStatement(true);
if (!isPointer) {
if (auto type = etype->to<EBPFTypeName>()) {
if (type->canonicalTypeIs<EBPFStructType>()) {
// A struct type might be used as a lookup key.
// When a data structure is aligned and is not packed,
// the compiler might generate offsets between fields.
// The BPF verifier may reject using such structures with
// uninitialized offsets as lookup keys.
// Therefore, this piece of code zero-initialize structures
// that might be used as keys.
builder->emitIndent();
builder->appendFormat("__builtin_memset((void *) &%s, 0, sizeof(",
vd->name.name);
etype->declare(builder, cstring::empty, false);
builder->append("))");
builder->endOfStatement(true);
}
}
}
BUG_CHECK(vd->initializer == nullptr, "%1%: declarations with initializers not supported",
decl);
return;
} else if (decl->is<IR::P4Table>() || decl->is<IR::P4Action>() ||
decl->is<IR::Declaration_Instance>()) {
return;
}
BUG("%1%: not yet handled", decl);
}
void EBPFControl::emit(CodeBuilder *builder) {
auto hitType = EBPFTypeFactory::instance->create(IR::Type_Boolean::get());
builder->emitIndent();
hitType->declare(builder, hitVariable, false);
builder->endOfStatement(true);
for (auto a : controlBlock->container->controlLocals) emitDeclaration(builder, a);
builder->emitIndent();
codeGen->setBuilder(builder);
controlBlock->container->body->apply(*codeGen);
builder->newline();
}
void EBPFControl::emitTableTypes(CodeBuilder *builder) {
for (auto it : tables) it.second->emitTypes(builder);
for (auto it : counters) it.second->emitTypes(builder);
}
void EBPFControl::emitTableInstances(CodeBuilder *builder) {
for (auto it : tables) it.second->emitInstance(builder);
for (auto it : counters) it.second->emitInstance(builder);
}
void EBPFControl::emitTableInitializers(CodeBuilder *builder) {
for (auto it : tables) it.second->emitInitializer(builder);
}
} // namespace EBPF