Comments (2)
Note that the code in the m_action
in register.p4
is irrelevant to the demo itself and is just here to showcase what can be done with registers.
That being said:
modify_field_rng_uniform(hdrA.f1, a, b)
: generates a random integer betweena
andb
and assigns it to fieldhdrA.f1
register_write(reg, idx, hdrA.f1)
: assigns the value of fieldhdrA.f1
(can also be a constant) toreg[idx]
.register_read(hdrA.f1, reg, idx)
: assigns the value ofreg[idx]
to fieldhdrA.f1
.
When you want to check exactly what a primitive is doing, you can directly refer to this file (https://github.com/p4lang/behavioral-model/blob/master/targets/simple_switch/primitives.h) which implements each standard primitive (usually only a few lines of code per primitive).
You can get some basic help for CLI commands by typing help <command>
in the CLI itself. I believe these slides (http://p4.org/wp-content/uploads/2015/12/Nov-2015-P4-Bootcamp-Labs-Guide.pdf) from the 1st P4 bootcamp include more information on how to use the CLI. There is not yet a complete user guide on how to use the CLI.
from tutorials.
great help thanks a ton
from tutorials.
Related Issues (20)
- MRI example,how does the P4 get theinformationof the switch when it is running? HOT 1
- Output format problem of flow table item in mycontroller.py in P4 runtime HOT 2
- IPv6 issue HOT 1
- Connection refused HOT 1
- How to obtain higher-precision processing delay HOT 4
- Get queues length HOT 1
- Test the programs in the exercises folder with PTF HOT 2
- make run mkdir -p build pcaps logs sudo python3 ../../utils/run_exercise.py -t topology.json -j build/ python3: can't open file '/home/chinni12/tutorials/utils/../../utils/run_exercise.py': [Errno 2] No such file or directory make: *** [Makefile:35: run] Error 2 HOT 2
- Building mininet topology. Traceback (most recent call last): File "/home/snsrl3/Documents/tutorials-master/exercises/basic_tunnel/../../utils/run_exercise.py", line 387, in <module> exercise.run_exercise() File "/home/snsrl3/Documents/tutorials-master/exercises/basic_tunnel/../../utils/run_exercise.py", line 195, in run_exercise self.create_network() File "/home/snsrl3/Documents/tutorials-master/exercises/basic_tunnel/../../utils/run_exercise.py", line 256, in create_network self.net = Mininet(topo = self.topo, File "/usr/local/lib/python3.10/dist-packages/mininet/net.py", line 178, in __init__ self.build() HOT 1
- ping issue HOT 1
- n error occurred during make run Traceback (most recent call last): File "../../utils/run_exercise.py", line 28, in <module> import p4runtime_lib.simple_controller File "/home/inspur/p4/tutorials/utils/p4runtime_lib/simple_controller.py", line 22, in <module> from p4.config.v1 import p4info_pb2 ModuleNotFoundError: No module named 'p4.config' HOT 6
- Way to disable the functionality to write the switch logging into a file? HOT 1
- The "behavioral-model" folder can not be found in the P4 tutorial VM HOT 4
- Permission to submit p4_16-mode.el to MELPA HOT 3
- The thrift server did not start in the basic.p4 exercise even when configuring simple_switch_grpc with the "--with-thrift" option. HOT 8
- VM login and password HOT 8
- To what extent can P4 extract attributes/headers/etc from HTTPS packets HOT 1
- cpu_port support HOT 1
- Is it possible to match multiple tables at the same time in P4? HOT 2
- gRPC Error: failed to connect to all addresses (UNAVAILABLE) 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 tutorials.