Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

p4c-ubpf: new uBPF back-end for p4c #2134

Merged
merged 60 commits into from
Mar 4, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
ecd39c0
Initial phase of implementing the p4c-ubpf compiler
osinstom Apr 8, 2019
ec22005
Adding support for UBPF parser
osinstom Apr 8, 2019
a687110
UBPF Parser - first implementation
osinstom Apr 13, 2019
75fdcf6
The UBPF parser implemented
osinstom Apr 14, 2019
2fcdcf8
UBPF initial control block.
kmateuszssak Apr 17, 2019
acfaa6e
Working Ubpf control block.
kmateuszssak May 6, 2019
99d6854
Change ubpf table name.
kmateuszssak May 6, 2019
78335fa
Small fixes
osinstom May 13, 2019
93643c2
Remove accept parameter from reference model.
kmateuszssak May 13, 2019
118b2b2
Change table key names.
kmateuszssak May 13, 2019
884c40a
Change table key names v2.
kmateuszssak May 13, 2019
d57742f
Some fixes to the p4c-ubpf + docs
osinstom May 21, 2019
dcf0903
Copyright headers added
osinstom May 21, 2019
3d64116
Update README.md
osinstom Jul 4, 2019
9231f53
Packet modifications support
osinstom Jul 16, 2019
dbb237e
Take size of table from P4 code.
kmateuszssak Aug 8, 2019
1090527
registers_support (#4)
kmateuszssak Aug 7, 2019
c0bc2c5
Merge pull request #5 from P4-Research/master2
osinstom Aug 8, 2019
0df4fa5
hash (#6)
kmateuszssak Sep 30, 2019
5a86d96
Refactor #include + Fix registers read (#7)
kmateuszssak Oct 1, 2019
b96fcca
Generate p4info
kmateuszssak Sep 30, 2019
b880030
Support for P4 metadata
osinstom Oct 1, 2019
3089cbb
Fix after p4info merge. Add semicolon after enum declaration.
kmateuszssak Oct 2, 2019
edcbb1d
Change max nr of table entries to 2^27 because of errors while loadin…
kmateuszssak Oct 4, 2019
cfaa628
Change ubpf_model filename, code cleaning
osinstom Oct 7, 2019
5cc9931
Adding tunneling support + PTF tests (#13)
kmateuszssak Dec 19, 2019
c63a939
p4c-ubpf doesn't compile after sync with master; fix build dependenci…
osinstom Dec 20, 2019
322f5c1
Uncomment ebpf_enable in CmakeLists.txt.
kmateuszssak Jan 7, 2020
1adffa0
T202: Update oko (p4rt-ovs) repository address and refactor scripts (…
kmateuszssak Jan 9, 2020
b3eb458
T207: Revert p4info support in p4c (temporary solution) (#15)
kmateuszssak Jan 10, 2020
5893f22
T208: Remove changes in ebpf p4c backend (#16)
kmateuszssak Jan 10, 2020
0ca94d3
T210: Review p4c once again (#17)
osinstom Jan 10, 2020
085294b
Addressing review comments: minor modifications to P4 programs and sc…
osinstom Jan 17, 2020
8ab0e2a
Compile-only tests + code cleanup
kmateuszssak Jan 20, 2020
302d279
Add not committed before symbolic links
kmateuszssak Jan 21, 2020
381d4ee
Fix symbolic links
kmateuszssak Jan 21, 2020
e4330a8
Remove dependencies on scapy in run-ubpf-test.py
osinstom Jan 21, 2020
1fd859e
Documentation for architecture model + code cleanup
osinstom Jan 28, 2020
08b7de0
Remove dependencies on BMv2 helpers.h
osinstom Jan 28, 2020
b8b3f06
Refactor of hash() generation. Generate tuple from Type_List.
osinstom Jan 24, 2020
e22ad6f
Remove useless code
kmateuszssak Jan 24, 2020
38acee5
Move metadata to tests
kmateuszssak Jan 24, 2020
c648326
Path expression code refactor
kmateuszssak Jan 24, 2020
c5c324e
Add check register type
kmateuszssak Jan 24, 2020
7f0b72e
Refactor method to generate register read()
osinstom Jan 28, 2020
2b6020c
Small fixes to test scripts and UBPFRegister
osinstom Jan 29, 2020
997d5db
Refactor pointer variables' handling in UBPFControl/UBPFRegister. Add…
osinstom Jan 29, 2020
db6c4db
Fix build error (invalid use of incomplete type 'class UBPF::UBPFCont…
osinstom Jan 29, 2020
2e12ee3
Refactor Exit and Return statement's handling
osinstom Jan 30, 2020
6bc8674
Implement checksum computation
osinstom Feb 3, 2020
7ec6f33
Optimizations of test environment installation script
osinstom Feb 7, 2020
2be7ec7
Add missing test file
osinstom Feb 7, 2020
b1479ad
Refactor check of packet's length in Parser
osinstom Jan 30, 2020
668e808
User-space only tests (#18)
osinstom Feb 12, 2020
6ae22e4
Fix p4c-ubpf error.
kmateuszssak Feb 18, 2020
cc59b0d
Fix test errors related to frontend
osinstom Feb 19, 2020
fb07d84
Register read refactor (#19)
kmateuszssak Feb 20, 2020
daad335
Macro redefinition
kmateuszssak Feb 20, 2020
f5bcc01
Update travis.yml to exclude ubpf tests for OSx
osinstom Feb 20, 2020
89eb992
Small code refactor and update of docs
osinstom Feb 25, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Take size of table from P4 code.
  • Loading branch information
kmateuszssak committed Feb 14, 2020
commit dbb237ea449b0a8f4d3dc9fb981470346088d5ce
15 changes: 15 additions & 0 deletions backends/ubpf/ubpfTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,21 @@ namespace UBPF {

keyGenerator = table->container->getKey();
actionList = table->container->getActionList();

setTableSize(table);
}

void UBPFTable::setTableSize(const IR::TableBlock *table) {
auto properties = table->container->properties->properties;
size = std::numeric_limits<int>::max();// Default value
for (auto property : properties) {
if (property->name.name == table->container->properties->sizePropertyName && property->value->is<IR::ExpressionValue>()) {
auto pExpressionValue = property->value->to<IR::ExpressionValue>();
auto pConstant = pExpressionValue->expression->to<IR::Constant>();
this->size = pConstant->asInt();
osinstom marked this conversation as resolved.
Show resolved Hide resolved
break;
}
}
}

void UBPFTable::emitKeyType(EBPF::CodeBuilder *builder) {
Expand Down
4 changes: 2 additions & 2 deletions backends/ubpf/ubpfTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ namespace UBPF {
keyTypeName = program->refMap->newName(instanceName + "_key");
valueTypeName = program->refMap->newName(instanceName + "_value");
dataMapName = instanceName;
//TODO: determine from where take this value for simple table
size = 1024;
}
};

class UBPFTable final : public UBPFTableBase {
private:
void setTableSize(const IR::TableBlock *table);
public:
const IR::Key *keyGenerator;
const IR::ActionList *actionList;
Expand Down