Comments (5)
from tutorials.
Thank you for the reply, I was able to figure these out. Another thing I would like to know if its possible to retrieve the counter value inside the program.
https://github.com/p4lang/tutorials/tree/master/examples/counter
This example uses CLI to read the counter value. I would like to put the counter value in a packet header.
from tutorials.
@NofelYaseen By design, P4 counters can only be read from the control plane -- the current value of the counters are not visible from the P4 program.
If you want a counter that you can see the value of from within the P4 program, you may implement it using a Register.
from tutorials.
@jafingerhut Thanks for the suggestion. Is there any function to reset the entire register to 0?
I am using v1model for now:
https://github.com/p4lang/p4c/blob/master/p4include/v1model.p4
from tutorials.
I am not aware of such a function. Using the control plane API for writing each element of the register to 0, and iterating over all indices, should achieve that goal.
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.