Comments (5)
Works with the following parser:
parser start {
extract(ext[next]);
extract(ext[next]);
return ingress;
}
We need to figure out if David's code is valid and should run on bmv2.
Also, what about the following:
parser start {
extract(ext[1]);
return ingress;
}
Is it valid or does it contradict the definition of a header stack?
from behavioral-model.
Thanks. With a refined example, I can trigger the behavior a different way: define two header stacks, ext and ext_cpy. Extract to ext. Copy all elements from ext to ext_cpy. Pop from ext_cpy. The bottom-most elements of ext_cpy will not be invalidated, but should, I believe. I've attached revised code, commands, and nano output.
copy_pop_test.txt
commands.txt
nano_out.txt
from behavioral-model.
That is exactly the same thing happening actually. You are copying headers to the stack without allocating space in the stack. If you add a call to push(ext_copy, 2)
before the 2 calls to copy_header
, you will be fine.
I have been investigating a little and I think that the next iteration of the P4 spec will describe the operational semantics of header stacks much more precisely than the current version. When this is released I will see if I can update bmv2.
In the mean time, I will say that as far as bmv2 is concerned, only the following operations can affect the size of a stack: extract(stack[next])
, push(stack, count)
and pop(stack, count)
. Other operations may be used to change header content but cannot be used to affect header validity in the stack. So for example, remove_header(stack[1])
is "undefined behavior" in bmv2 at that point.
from behavioral-model.
OK, makes sense; I hadn't been equating validity/non-validity with allocating space in the stack, because in my mind the space for the stack is allocated when it is declared. And the copy_header semantics per the spec say the mere act of copying one valid header stack element to another makes the destination valid: "If the source header instance was invalid, the destination header instance becomes invalid; otherwise the destination will be valid after the operation."
I will adjust in the meantime.
from behavioral-model.
Strict conformance with the P4_16 spec with regards to stack operational semantics has been enabled by default with release 1.11 (https://github.com/p4lang/behavioral-model/releases/tag/1.11.0). Pop will now shift the entire stack, instead of just the elements of the stack extracted in the parser. It is possible to revert back to the old behavior at compile time with the --disable-WP4-16-stacks
configure flag.
from behavioral-model.
Related Issues (20)
- import thrift
- TCP packets seem not to be processed correctly by bmv2 HOT 2
- Problem using multicast in runtime HOT 1
- Empty action-parameter vector is always accessed in ActionFnEntry::execute HOT 3
- How to build behavioral-model on the MacOS(Apple M1 Pro(13.5)) HOT 1
- How to track fileds of metadata with p4dbg? HOT 2
- Approximate conversion of bmv2 p4 performance to hardware performance HOT 3
- Applying the same table twice HOT 2
- Required to set forwarding pipeline before using the dataplane for streaming packets HOT 10
- Update project to require C++17 HOT 9
- Race conditions when passing in a BMv2 JSON config HOT 12
- To Add PNA support into BMv2. HOT 5
- How to build simple_switch / simple_switch_grpc on Ubuntu 24.04 ? HOT 4
- Why bmi_port.c is a C code? HOT 2
- Race conditions when processing packet in the egress pipeline. HOT 6
- Heap Buffer Overflow when installing many table entries HOT 1
- CMake support HOT 2
- Queue metadata with multiqueue HOT 2
- Where is the original p4 source code for recirc.json HOT 8
- Consider implementing something like Tuple Space Search for ternary table lookups
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 behavioral-model.