Comments (9)
Upload the llvm-objdump -S -no-show-raw-insn xdp_test.o files:
xdp_test_smallstack.txt
xdp_test_bigstack.txt
from p4c-xdp.
ping......
from p4c-xdp.
I don't know if there is much we can say about this; we do not have any control on how clang generates code.
from p4c-xdp.
OK....I found a workaround.
I rewrite some logical in ControlBodyTranslator::compileEmitField to consume memcpy, and eliminate the write_byte. It helps reduce the stack from about 350 to 128byte. And performance is better also.
I also rewrite some logical in ControlBodyTranslator::preorder to help to judge if we should rewrite re-populate a header.
And also fix the issue that using if-else in control.("if" emit a useless ";" in if-else statement which cause compile error)
I found the counter only support 32bit which is too small, so increase it from 32bit to 64bit if using counterArray which type is hash.
from p4c-xdp.
introducing 64bit counter: 2.7Mpps -->2.5Mpps
using memcpy and eliminating write_byte & avoid re-populate packet's header: 2.5Mpps --> 2.8Mpps
from p4c-xdp.
Do you plan to contribute these changes to our code?
from p4c-xdp.
It is draft code and I am afraid I don't have enough time to make it become a accepted patch recently.
I will upload my draft code diff first in case someone need it.
from p4c-xdp.
if you're allowed to change kernel, then you can increase MAX_BPF_STACK to a little larger value.
from p4c-xdp.
Not only the linux stack size, the llvm-6 and llvm-7 would hit error in compiling if the stack size above 512bytes...
from p4c-xdp.
Related Issues (20)
- Unexpected behavior when running xdp3.o HOT 6
- how to implement a forwoading function using XDP_TX based on xdp7.p4 HOT 1
- What is the difference between bpf_obj_get() in libbpf.h and BPF_OBJ_GET() in init_tables() HOT 3
- Could this compiler support XDP_REDIRECT HOT 16
- compiler support for lpm HOT 5
- compiler support for range lookup HOT 10
- invalid indirect read from stack off HOT 3
- ebpf_ipv4_checksum Not working HOT 1
- Compiler support for htons, htonl, htonll HOT 2
- Compiler support for registers and hash functions HOT 3
- [doc] Vagrant image name HOT 2
- [Q] Vagrant image HOT 1
- Resource Leak
- Using XDP with clang/llvm version 9 HOT 3
- How to include ebpf_xdp.h HOT 3
- Adding PERCPU_ARRAY Question HOT 2
- p4x-xdp support for PSA HOT 9
- Test 17 fails HOT 1
- XDP metadata support HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from p4c-xdp.